Skip to content

Getting the most out of Opcodes 318 and 177(EFFs).

2»

Comments

  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited March 2019
    kjeron wrote: »
    It can be patched to check STATE_CONFUSED, just not with those functions.

    How? I mean, apart from checking for STATE_CONFUSED separately (i.e., using 2 additional opcode[#318] just for 'STATE bit_eq STATE_CONFUSED'.....)
  • kjeronkjeron Member Posts: 2,367
    @Luke93 After cloning the effect with value "0x0015602f":
    	READ_LONG 0x64 ab_off
    	READ_SHORT 0x68 ab_num
    	READ_LONG 0x6a fx_off
    	FOR (i = 0; i < ab_num; ++i) BEGIN
    		READ_SHORT (ab_off + i * 0x28 + 0x1e) fx_num
    		READ_SHORT (ab_off + i * 0x28 + 0x20) fx_idx
    		FOR (j = 0; j < fx_num; ++j) BEGIN
    			READ_SHORT	(fx_off + (fx_idx + j) * 0x30)	opcode
    			READ_SHORT	(fx_off + (fx_idx + j) * 0x30 + 0x4)	parameter1
    			PATCH_IF	opcode = 318	AND parameter1 = 0x0015602f BEGIN
    				WRITE_LONG	(fx_off + (fx_idx + j) * 0x30 + 0x4)	0x8015602f
    			END
    		END
    	END
    
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    @kjeron Minor nitpick:
    READ_SHORT	(fx_off + (fx_idx + j) * 0x30 + 0x4)	parameter1	// Should be READ_LONG...
    

    Anyway, isn't that equivalent to
    LPF ADD_SPELL_EFFECT
    INT_VAR
    	.........
    	parameter1 = 0x8015602f
    	.........
    END
    
    ?
  • kjeronkjeron Member Posts: 2,367
    edited March 2019
    Yes, READ_LONG not SHORT - it was just copied from the opcode READ.
    Luke93 wrote: »
    LPF ADD_SPELL_EFFECT
    INT_VAR
    	.........
    	parameter1 = 0x8015602f
    	.........
    END
    
    ?
    Yes, which is what subtledoctor is currently using, it just can't be done directly with CLONE or ALTER.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    kjeron wrote: »
    Yes, which is what subtledoctor is currently using, it just can't be done directly with CLONE or ALTER.

    I see, so ADD_SPELL|ITEM_EFFECT aren't affected by this issue, right? If so, I need to edit my bug report......
  • kjeronkjeron Member Posts: 2,367
    Luke93 wrote: »
    I see, so ADD_SPELL|ITEM_EFFECT aren't affected by this issue, right? If so, I need to edit my bug report......
    Bug report?
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited March 2019
    kjeron wrote: »
    Luke93 wrote: »
    I see, so ADD_SPELL|ITEM_EFFECT aren't affected by this issue, right? If so, I need to edit my bug report......
    Bug report?

    Yes, I created one here.....

    Anyway, as you said, the problem is restricted to CLONE and ALTER (not ADD....)
  • [Deleted User][Deleted User] Posts: 0
    edited March 2019
    The user and all related content has been deleted.
    Post edited by [Deleted User] on
  • kjeronkjeron Member Posts: 2,367
    The old ALTER_SPELL_EFFECT and CLONE_SPELL_EFFECT functions document this behavior - it's retained in the new ALTER_EFFECT and CLONE_EFFECT functions, just not documented:
    ALTER_SPELL_EFFECT: patch effects on spells. This is a PATCH function. All integer variables except check_globals, check_headers, header and savebonus default to -1 and negative values result in no change to the corresponding field. The integer variables check_globals and header default to 0. The integer variable check_headers defaults to 1. The integer variable savebonus defaults to -11 and values lower than -10 result in no change to the corresponding field. The string variable resource defaults to the string "same", which results in no change to the corresponding field.
  • kjeronkjeron Member Posts: 2,367
    (it would break LOTS of mods that might not still be maintained).
    Even if it did break old mods, Weidu reloads it's internal functions for every component, so if the new function was released in a *.tpa file, it could be INCLUDED in the ALWAYS block of any mod that wants to use it, and others would still default to the internal function.

    I'm not sure how it would break old mods though - unless they were actually specifying useless negative values in the function call.
  • The user and all related content has been deleted.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    kjeron wrote: »
    ...just not documented...

    Will be documented......
  • CirdanCirdan Member Posts: 21
    edited December 2019
    Allow me to petition you all for help in using op code 177. I don't know what i'm doing wrong but I can't get the effect to activate or properly target. the idea is a ring that will unsummon any creatures that the caster has summoned. I've posted a screen shot here of the creature im targeting, the IDS table im referencing, the effect im using, the item effect, and the item itself. send help.

    P.S. I was successful in getting the unsummon effect to work on a single creature and even a group. (not w/ multiple actions) But, I ran into issues that other NPCs would get unsummoned as well, so Im using 177 to specify the targeting even more.

    1bcunafz2hbv.png
  • kjeronkjeron Member Posts: 2,367
    @Cirdan
    There is no mechanic to target only the summons of a specific caster.
    A summoned creature does know who summoned it, up until you save&reload, at which point the information is lost, but any interaction with this knowledge would have to run through the summon's AI scripts.
    Other than that a summoned creature is either an "ALLY" or an "ENEMY", the game doesn't keep track of their ownership any further than that.

    You could target all summons that are allies of the caster by giving the item ability the projectile "INAREAPA" #158.
  • GrammarsaladGrammarsalad Member Posts: 2,582
    edited December 2019
    Cirdan wrote: »
    Allow me to petition you all for help in using op code 177. I don't know what i'm doing wrong but I can't get the effect to activate or properly target. the idea is a ring that will unsummon any creatures that the caster has summoned. I've posted a screen shot here of the creature im targeting, the IDS table im referencing, the effect im using, the item effect, and the item itself. send help.

    P.S. I was successful in getting the unsummon effect to work on a single creature and even a group. (not w/ multiple actions) But, I ran into issues that other NPCs would get unsummoned as well, so Im using 177 to specify the targeting even more.

    1bcunafz2hbv.png

    I have a few non script ideas. My mod knowledge is a bit off, so I hope @kjeron let's me know if I utter an impossibility

    Okay, let's start from the beginning. Sorry, I can't see the screen shots with my dumb phone so I'm not sure exactly what you are trying to do. I have a few interpretations and some ideas that should work for any of them, with suitable modifications. Just in case I'm grossly misinterpreting you, I'll set my cards on the table.

    I'm assuming here that either 1) the ring unsummons creatures summoned by a particular npc (e.g. Jon Irenicus(sp)) Or 2) it unsummons creatures summoned by the wearer of the ring. Another 3) possibility that just occurred to me is that the ring may summon creatures and also allow the user to unsummon those specific creatures (would be pretty useful if the ring summoned a hostile demon, for example). All of these are possible, I think.

    If, so, you could do something like this.

    a) I'm designating "spell A" as the spell that unsummons the creatures (i.e. that will be cast by the ring).

    b) The ring should cast spell A using effect 148 as it's unsummon ability

    c) I'm designating "spell B" as the spell that protects against spell A (using say effect 318)

    d) I'm designating "spell C" as the spell that removes spell B. It needs to be cast using a projectile that covers a large enough area that would affect all creatures just summoned in that area, but not much bigger. See note 2 after step two

    Step one: regexp glob all summoned creatures and apply spell B to them (with timing permanent after death)

    Step two: you need to alter all relevant summoning spells to cast spell C after summoning it's creatures, if and only if the relevant creature casts that spell (hopefully targeting just summoned creatures). The idea here is to remove that protection from Spell A from all creatures the relevant creatures summons just after they summon them (i.e. in the very spell that

    Note 1: This is likely the most tricky step and how to proceed depends on what you want to do. I think that the easiest way to do it would be to create a unique spell state and apply it to that creature (either as an on equip effect of the ring, or by applying it to the specific npc or creature) and then set it( using 326) so that only creatures with the given unique spell state cast the subspell. . It's easier If the ring only unsummons cretures that it summons itself. In that case, you just need to it to cast a 148 that applies spell C after it casts the summoning spell.

    Note 2: a problem with this method is that it will still affect summoned creatures that are nearby when the relevant creatures are summoned. You can protect from this somewhat (e.g. by adding 318 effects protecting enemies or allies of source to the beginning of spell C) but you likely can't protect against it completely. You should also try to be sure that the projectile you choose is only covers enough area to affect your just summoned creatures but not more than that.
Sign In or Register to comment.