Skip to content

General mod Questions thread

1282931333470

Comments

  • RaduzielRaduziel Member Posts: 4,714
    1 and 2) I'll leave this behind, then.

    3) That's true, I totally forgot this. Hope Beamdog didn't.

    Thanks, @Arunsun
  • ArunsunArunsun Member Posts: 1,592
    Is there a way to trigger an effect upon casting a spell from a certain school? e.g. Getting a 6 second +1 bonus to luck upon casting a Necromancy spell.
  • The user and all related content has been deleted.
    ArunsunRaduziel
  • ArunsunArunsun Member Posts: 1,592

    Arunsun said:

    Is there a way to trigger an effect upon casting a spell from a certain school? e.g. Getting a 6 second +1 bonus to luck upon casting a Necromancy spell.

    Just patch all Necromancy spells to have the extra effect? (Gated through 177 if you need to limit it to a kit, or 326 if gated through a spellstate or something similar.)
    Ah yes, of course... I've been away from NI for too long, it seems. Thank you :smiley:
  • BubbBubb Member Posts: 999
    Thanks for the replies about the hex editing everyone -

    To update everyone on the situation, I messaged JuliusBorisov about the situation. He said that while he couldn't get an official reply, he guessed that as long as you don't share the exe file itself, it should be OK to hex-edit the exe.

    I believe it is safe to move forward! :)
    Arunsun
  • GwendolyneGwendolyne Member Posts: 461
    What is the max amount of gold the party can gather?
  • The user and all related content has been deleted.
  • GwendolyneGwendolyne Member Posts: 461
    edited August 2018
    That's what I figured out: 0 - 4 294 967 295. But I wanted confirmation. ;)
  • BubbBubb Member Posts: 999
    Just don't intend for players to get anywhere near that - interestingly enough there is no overflow protection on gold, so if you exceed 4,294,967,295 gold you roll-over back to 0. That's one way to reward cheaters, :D
  • GwendolyneGwendolyne Member Posts: 461
    I just want to take ALL their gold! ;)
  • RaduzielRaduziel Member Posts: 4,714

    I just want to take ALL their gold! ;)

    Are you creating a Taxes Mod?
    semiticgoddess
  • RaduzielRaduziel Member Posts: 4,714
    Quick question:

    I want to take ALL the earth elementals from a game and make it immune to electricity. I made a quick test using:
    ACTION_FOR_EACH creature IN ELEARPR ELEARPR2 ELEARPR3 BEGIN

    ACTION_IF FILE_EXISTS_IN_GAME ~%creature%.cre~ THEN BEGIN

    COPY_EXISTING ~%creature%.cre~ ~override~
    WRITE_BYTE 0x05b 100

    END

    END

    But with no success.

    A little help?
  • The user and all related content has been deleted.
    Raduziel
  • RaduzielRaduziel Member Posts: 4,714
    edited August 2018
    @subtledoctor Thanks!

    Can I use this instead:
    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
    	READ_BYTE	0x273	class
    		PATCH_IF class = 188 BEGIN
    			WRITE_BYTE 0x05b 100
    		END
    BUT_ONLY IF_CHANGES
    Edit: Yes, I can.
    Post edited by Raduziel on
  • The user and all related content has been deleted.
    Arunsun
  • RaduzielRaduziel Member Posts: 4,714
    edited August 2018

    Assuming mods that add earth elementals all code their class correctly... best bet is to take a pretty-heavily-modded install, use NI to search for all earth elementals, and inspect find something they all have in common. Class = 188 might work well, but I'd wager the animation field would work even more reliably.

    There are two animations for earth elementals. How do I target both in a single code?

    Thanks!

    Edit: Actually, accordingly to Animate.ids there are three animations for Earth Elemental
    0x7300 ELEMENTAL_EARTH
    0x7301 ELEMENTAL_EARTH_SMALL
    0xE24B ELEMENTAL_EARTH_IWD
  • The user and all related content has been deleted.
  • GwendolyneGwendolyne Member Posts: 461
    Or use a better compatible code:
    OUTER_SET elem_earth1 = IDS_OF_SYMBOL (animate ~ELEMENTAL_EARTH~)
    OUTER_SET elem_earth2 = IDS_OF_SYMBOL (animate ~ELEMENTAL_EARTH_SMALL~)
    OUTER_SET elem_earth3 = IDS_OF_SYMBOL (animate ~ELEMENTAL_EARTH_IWD~)
    ...
    PATCH_IF (anim = elem_earth1) OR (anim = elem_earth2) OR (anim = elem_earth3) BEGIN
    Raduziel
  • RaduzielRaduziel Member Posts: 4,714

    PATCH_IF (anim = x) OR (anim = y) OR (anim = z) BEGIN
    ...or something like that. I'm extremely rusty but it should be easy enough.
    It was.

    I'll leave the complete code just in case someone as green as I read this:

    //Elemental Changes

    /*Air Elemental*/

    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
    READ_LONG 0x028 animation
    PATCH_IF (animation = 29472) OR (animation = 29473) BEGIN
    WRITE_BYTE 0x063 50
    WRITE_BYTE 0x05b 50
    WRITE_BYTE 0x05a 50
    WRITE_BYTE 0x05f 50
    END
    BUT_ONLY_IF_IT_CHANGES

    /*Earth Elemental*/

    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
    READ_LONG 0x028 animation
    PATCH_IF (animation = 29440) OR (animation = 29441) OR (animation = 57931) BEGIN
    WRITE_BYTE 0x05b 100
    END
    BUT_ONLY_IF_IT_CHANGES

    /*Water Elemental*/

    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
    READ_LONG 0x028 animation
    PATCH_IF (animation = 57933) OR (animation = 57964) BEGIN
    WRITE_BYTE 0x05b ~-100~
    WRITE_BYTE 0x05a 50
    WRITE_BYTE 0x05f 50
    WRITE_BYTE 0x05c 50
    END
    BUT_ONLY_IF_IT_CHANGES


    Those values were copied from Animate.IDS. The values were converted from Hexadecimal to Decimal (I use this site to do so).
  • RaduzielRaduziel Member Posts: 4,714
    @Gwendolyne Sorry, I've missed your post completely. I already altered the code but it is good to have this new technic under my sleeve. Thanks!
  • GwendolyneGwendolyne Member Posts: 461
    No problem. What's important is that you found a way to code what you wanted to do. ;)
    Raduziel
  • ArunsunArunsun Member Posts: 1,592
    For a cleaner code I would go for that:
    //Elemental Changes                            

    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~
    READ_LONG 0x028 animation
    PATCH_IF (animation = 29472) OR (animation = 29473) BEGIN /*Air Elemental*/
    WRITE_BYTE 0x063 50
    WRITE_BYTE 0x05b 50
    WRITE_BYTE 0x05a 50
    WRITE_BYTE 0x05f 50
    END
    PATCH_IF (animation = 57933) OR (animation = 57964) BEGIN /*Earth Elemental*/
    WRITE_BYTE 0x05b ~-100~
    WRITE_BYTE 0x05a 50
    WRITE_BYTE 0x05f 50
    WRITE_BYTE 0x05c 50
    END
    PATCH_IF (animation = 29440) OR (animation = 29441) OR (animation = 57931) BEGIN /*Water Elemental*/
    WRITE_BYTE 0x05b 100
    END
    BUT_ONLY_IF_IT_CHANGES
    It is essentially the same, but it should lead to a slightly faster install (as the copy every creature while reading their animation would only be done once), and it looks cleaner IMHO.
    A rule of thumb my IT teachers would always tell me is that if you copy paste a line of code, there's probably something you could have done better.
    Raduziel
  • RaduzielRaduziel Member Posts: 4,714
    @Arunsun I'll keep this rule of thumb in mind from now on. Thanks for the insight!
  • ArunsunArunsun Member Posts: 1,592
    Could one make a spell with different effects asking for a save for one type, but with different penalties?
    Like for instance, a spell that:
    Kill the creature if it fails a save vs death at -4.
    Disintegrate the creature if it fails a save vs death at 0.

    With both effects in one ability, no intermediate spells or anything.

    If so, will it only do one throw or will it reroll for the second effect?
    Let's say my character has a saving throw vs death stat of 15 and rolls an 16. Will it take that one throw into account for both the effect that asks for a save with no penalty (which will be successful) and the one that asks for a save with a -4 penalty (which will be unsuccessful) or will it roll another time for the second effect? Or will it not work at all?
    [Deleted User]
  • RaduzielRaduziel Member Posts: 4,714
    @Arunsun I'm failing to see why the normal way would be a problem:

    Spell X

    Effect 1 (Kill). Saving Throw vs Death -4 penalty

    Effect 2 (Disintegrate). Saving Throw vs Death

    ---

    Worst case scenario you can apply a small interval (1 second) between each effect - doing this will allow the target to save twice.

    ---

    I'm over 23h awake, so excuse me if I missed something.
  • ArunsunArunsun Member Posts: 1,592
    Raduziel said:

    @Arunsun I'm failing to see why the normal way would be a problem:

    Spell X

    Effect 1 (Kill). Saving Throw vs Death -4 penalty

    Effect 2 (Disintegrate). Saving Throw vs Death

    ---

    Worst case scenario you can apply a small interval (1 second) between each effect - doing this will allow the target to save twice.

    ---

    I'm over 23h awake, so excuse me if I missed something.

    Some spells in 3E and 5E deal a certain amount of damage, and if the target is brought down to lower than -10 HP, its body is disintegrated. What I want is somewhat close to that behaviour, but using saving throws.
    So there might not be any problem, maybe this:
    Effect 1 (Kill). Saving Throw vs Death -4 penalty

    Effect 2 (Disintegrate). Saving Throw vs Death

    Will work as I intend to, but I would like to know how the game handles it.
    Will each effect roll its separate save? Or will the spell roll a single Saving Throw despite the multiple effect requiring a save with a different penalty, and the effects will or will not be applied, separately, based on that one Saving Throw (which would be what I want)?
    I know that if the effects within the spell ability have the same type of saving throw (e.g. death) and penalty (e.g. -4) they will all be applied or not applied based on a single Saving Throw. But if they have the same type and different penalty do they each take a roll?
  • RaduzielRaduziel Member Posts: 4,714
    Single Saving Throw, AFAIK.
  • RaduzielRaduziel Member Posts: 4,714
    Is it possible to apply Opcode 25 without the string "Poison" appearing? I'm trying to use for a Bleeding effect.

    Thanks!
  •  TheArtisan TheArtisan Member Posts: 3,277
    @Raduziel

    The string is hardcoded (well you could remove it, but it'd probably remove it for all poisons). You could try using Protection from Display Specific String [267] to block it, but there's a better way. Use Apply Effect on Condition [272] with Frequency set to 1 and Type set to 3. For the resource make a spell that deals damage to the target. It will reapply the spell every second.
  • kjeronkjeron Member Posts: 2,367
    Raduziel said:

    Is it possible to apply Opcode 25 without the string "Poison" appearing? I'm trying to use for a Bleeding effect.
    Thanks!

    Not without removing it from every other instance of poison.
    The string is applied by "EFFTEXT.2da" by opcode.
Sign In or Register to comment.