Skip to content

General mod Questions thread

1252628303170

Comments

  • kjeronkjeron Member Posts: 2,367
    @Raduziel
    Opcode 100 (Protection from creature type) prevents said creatures from targeting you (manually or through scripts).
    This includes yourself if you match it's parameters (which you do since you have it set to everyone).

    You can get around this by changing the ability target to 7(Caster/No Animation), and the effect targets to 1(Self).
  • RaduzielRaduziel Member Posts: 4,714
    @kjeron It is working now, thanks!
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    What happens to opcodes 263, 292, 303 and 340 if I play the game with Sneak Attack ON?
  • kjeronkjeron Member Posts: 2,367
    @Luke93
    263 does nothing.
    292 works the same.
    303 removes the flanking requirement. (Does nothing for non-party members, as they lack the requirement to begin with).
    340 only works with sneak attacks.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2018
    kjeron said:

    340 only works with sneak attacks.

    Really? But then why it's called Backstab hit effect?
  • kjeronkjeron Member Posts: 2,367
    edited June 2018
    Luke93 said:

    kjeron said:

    340 only works with sneak attacks.

    Really? But then why it's called Backstab hit effect?
    Nevermind, it works for both, it's just the default value that is disabled without 3E enabled.
    It doesn't scale by "CRIPPSTR.2DA" without 3E enabled though, it just uses your character level.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    kjeron said:

    Luke93 said:

    kjeron said:

    340 only works with sneak attacks.

    Really? But then why it's called Backstab hit effect?
    Nevermind, it works for both, it's just the default value that is disabled without 3E enabled.
    It doesn't scale by "CRIPPSTR.2DA" without 3E enabled though, it just uses your character level.
    So, if I play with Sneak Attack ON and a certain weapon makes use of opcode 340, then I can land a crippling strike + the effect from the resource field of 340 on my target, right?
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2018
    So, I noticed that Carbos and Shank don't use their Poison Weapon ability if SCS and RR are installed. Is this a consequence of the fact that SCS is not using the most recent version of Detectable Spells (unlike RR)?
    Post edited by _Luke_ on
  • kjeronkjeron Member Posts: 2,367
    Luke93 said:

    So, if I play with Sneak Attack ON and a certain weapon makes use of opcode 340, then I can land a crippling strike + the effect from the resource field of 340 on my target, right?

    No, the latest opcode 340 will replace the default, and any other opcode 340 effects that came before it.
    You would need to duplicate the effects of Crippling Strike in your own backstab spell if that's what you wanted.
  • RaduzielRaduziel Member Posts: 4,714
    edited June 2018
    How do Opcode 250 (Maximum Damage Each Hit) works?

    I took it from "Kai" to ensure maximum damage during a short amount of time, but instead, it makes the creature hits deliver a damage equal to p1.

    Opcode 250, p1 = 20, p2 = 0, Target = 2 (header is Creature)

    Every strike during this effect delivers 20 points of damage. Creature max damage is 16.

    Thanks!
    Post edited by Raduziel on
  • kjeronkjeron Member Posts: 2,367
    Check what your attacking - if are they unarmed or ranged - they will take +4 damage from melee weapons.

    Opcode 250 works just like the luck effect, but only affects weapon damage dealt (not attack roll or spell damage taken).

  • RaduzielRaduziel Member Posts: 4,714
    @kjeron Another issue that is not an issue.

    Thanks!
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2018
    kjeron said:

    opcode 206, 6s duration, as last effect of the ability

    Can I use opcode 321 ( param2 = 0, duration = 1, timing = Instant/Limited, target = preset target, resource = EVAL ~%SOURCE_RES%~, insert_point = 0 ) as an alternative? I mean, I'd like to understand the difference between 206 and 321...
    Post edited by _Luke_ on
  • kjeronkjeron Member Posts: 2,367
    Luke93 said:

    Can I use opcode 321 ( param2 = 0, duration = 1, timing = Instant/Limited, target = preset target, resource = EVAL ~%SOURCE_RES%~, insert_point = 0 ) as an alternative? I mean, I'd like to understand the difference between 206 and 321...

    For that specific request: " (i.e., you cannot stun the same target if it's already been stunned by this ability and 1 round has not passed)", you would use opcode 206.

    Opcode 206 prevents any further effects of the (resource) for (duration).
    It must be the last effect in a header, as it will block any effects following it.
    It has no affect on effects of the (resource) that are already on the creature.

    Opcode 321 removes any previous effects of the (resource).
    It must be the first effect in a header, as it will remove any effects preceding it.
    It has no affect on instantaneous effects that leave no effect behind.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2018
    Suppose I wanna add opcode 9 to the header of a certain item ----> What is the correct way to write param1 and param2? Imagine I want Red:0, Green:120, Blue:10, Location: Armor (yellow): Skin Color, Cycle Speed: 20. I need to write those numbers in binary format?
  • RaduzielRaduziel Member Posts: 4,714
    edited June 2018
    @Luke93 I know how to use Opcode 9 in DLTCEP. Never used it on NI...
    p1 (explode) (No use: 0 | R: 0 | G: 120 | B:10)

    p2 (explode) (Location: 5 | No use: 0 | Speed: 20 | No use: 0)
    DoF has a lot of files that use Opcode 9. You can check RALATH2.spl as an example.

    Edit: According to the site I use to build RGB colors, you would have a strong green result with 0/120/10.

    If you want different colors in different places you can use more than one Opcode 9.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2018
    Raduziel said:


    Edit: According to the site I use to build RGB colors, you would have a strong green result with 0/120/10.

    This is intended. It's the perfect visual feedback to represent the poisoned status (it's also used by Dagger of Venom +2.....)
    I'd simply like to know how should I write param1 and param2 in my .tpa file.....
    LPF ADD_ITEM_EFFECT
    INT_VAR
      opcode = 9
      parameter1 = ???
      parameter2= ???
    END
  • kjeronkjeron Member Posts: 2,367
    Luke93 said:

    LPF ADD_ITEM_EFFECT
    INT_VAR
    	opcode = 9
    	parameter1 = ((red << 8) + (green << 16) + (blue << 24))
    	parameter2 = (location + (cycle << 16))
    END
    LPF ADD_ITEM_EFFECT INT_VAR opcode = 9 parameter1 = ((0 << 8) + (120 << 16) + (10 << 24)) parameter2 = (3 + (20 << 16)) END
  • GwendolyneGwendolyne Member Posts: 461
    edited June 2018
    I am currently updating a very old mod and I found a piece of code that sounds a little weird:
    COPY_EXISTING ~clck31.itm~ ~override~
    	PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    		WRITE_LONG  0x3E 0
    		WRITE_ASCII 0x3A ~ICLCK21~
    	END
    BUT_ONLY
    Can anybody explain me what the following line means?
    		WRITE_LONG  0x3E 0
    I would have used the following code:
    COPY_EXISTING ~clck31.itm~ ~override~
    	PATCH_IF (SOURCE_SIZE > 0x71) THEN BEGIN // protects against invalid files
    		WRITE_ASCII 0x3A ~ICLCK21~ #8
    	END
    BUT_ONLY
    Post edited by Gwendolyne on
  • argent77argent77 Member Posts: 3,433
    edited June 2018
    If I would guess, this is a typo and should probably be
    WRITE_LONG 0x1E 0
    At least then it would make some sense.

    Or it is an attempt to ensure the string is null-terminated (although WeiDU does that automatically).
    Post edited by argent77 on
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2018
    @kjeron As always, thank you very much.

    I have a couple of questions about headers:

    1) What's the flag Keen edge for?
    2) How can I set/unset the bit related to EE: damage strength bonus using ALTER_ITEM_HEADER?
  • kjeronkjeron Member Posts: 2,367
    Luke93 said:

    1) What's the flag Keen edge for? - IWD2 only, doubles critical threat range
    2) How can I set/unset the bit related to EE: damage strength bonus using ALTER_ITEM_HEADER? - you can't AFAIK, you'll have to manually loop through them.

    	READ_LONG	0x64 ab_off ELSE ~-4~
    	READ_SHORT	0x68 ab_num ELSE 0
    	FOR (i = 0; i < ab_num; ++i)	BEGIN
    		READ_BYTE (ab_off + 0x38 * i + 2) location ELSE 0
    		PATCH_IF location = 1 BEGIN	// is weapon ability
    			//	sort by item parameters as desired
    			READ_BYTE (ab_off + 0x38 * i) header_type
    			PATCH_IF header_type = 1 BEGIN // 1=melee, 2=ranged, 3=magical, 4=launcher
    				READ_BYTE (ab_off + 0x38 * i + 0x10) launcher
    				PATCH_IF launcher = 0 BEGIN // 0=melee/thrown, 1=bow, 2=xbox, 3=sling
    					//	Either:
    					WRITE_BYTE (ab_off + 0x38 * i + 0x26) (THIS BOR BIT2) // set flag
    					WRITE_BYTE (ab_off + 0x38 * i + 0x26) (THIS BAND (255 - BIT2)) // unset flag
    				END
    			END
    		END
    	END

  • GwendolyneGwendolyne Member Posts: 461
    argent77 said:

    If I would guess, this is a typo and should probably be
    WRITE_LONG 0x1E 0
    At least then it would make some sense.

    Or it is an attempt to ensure the string is null-terminated (although WeiDU does that automatically).

    I guess it is the second one, as I found many other ones:
    WRITE_LONG  0x5C 0
    WRITE_ASCII 0x58 ~ICON~
    
    I think I will remove those lines and lighten the code. ;)
  • RaduzielRaduziel Member Posts: 4,714
    I want to make a spell that if the target dies during its effect, the target becomes a creature controlled by the caster.

    I know the answer lies in Opcode 232, p1 = 0, but IDK what the p2 should be... what changes from p2 = 16 and p2 = 17?

    Thanks!
  • kjeronkjeron Member Posts: 2,367
    edited June 2018
    16 = Died(Myself)
    17 = Died([ANYONE]) (within normal script detection range)
  • RaduzielRaduziel Member Posts: 4,714
    Thanks @kjeron
  • RaduzielRaduziel Member Posts: 4,714
    Is there a way to alter the turn undead of a kit from turn to command without altering the alignment?
  • lefreutlefreut Member Posts: 1,462
    How to check the version (2.3 vs 2.5) for BG1EE, SoD and BG2EE? It's easy to do in lua but I don't know how to do it directly with Weidu.
  • argent77argent77 Member Posts: 3,433
    lefreut said:

    How to check the version (2.3 vs 2.5) for BG1EE, SoD and BG2EE? It's easy to do in lua but I don't know how to do it directly with Weidu.

    The version number is hardcoded in the game executable, which is not easily accessible from the outside. The best you can do in WeiDU is to check for game-specific differences between v2.3 and v2.5 (such as new or updated files).

    For example, BG2EE v2.5 added the files OHTEMPUS.2DA, BITS.IDS and WPROF.IDS. The new patch version also added a couple of new script action and trigger definitions to ACTION.IDS and TRIGGER.IDS respectively, which could also be used for a version check.
  • The user and all related content has been deleted.
Sign In or Register to comment.