Skip to content

General mod Questions thread

1293032343570

Comments

  • GwendolyneGwendolyne Member Posts: 461
    It has been a long time I did not code this kind of stuff, but did you try to switch opcode #25 with opcode #78?
  • The user and all related content has been deleted.
  •  TheArtisan TheArtisan Member Posts: 3,277
    Neither here nor there, but I'm thinking about trying to set up an automated way to convert every opcode 25 effect into multiple opcode 12 damage-over-time delayed effects, using the poison damage type. Then stuff like "50% poison resistance" would actually reduce poison damage by 50%. (There is no way to do that with opcode 25 AFAIK.)
    Any case of poison dealing repeated instances of one damage would probably just round back up to one making the % resistance effectively useless.
  • kjeronkjeron Member Posts: 2,367

    Neither here nor there, but I'm thinking about trying to set up an automated way to convert every opcode 25 effect into multiple opcode 12 damage-over-time delayed effects, using the poison damage type. Then stuff like "50% poison resistance" would actually reduce poison damage by 50%. (There is no way to do that with opcode 25 AFAIK.)

    @Artemius_I is correct, Poison Resistance already works against poison damage dealt by opcodes 25 and 78, the values are just so small (and round up) that you don't notice. Increase the damage per tick and it will become noticeable.
  • The user and all related content has been deleted.
  • BubbBubb Member Posts: 1,000
    I am a bit confused about the differences between States, Spell States, and Extended States. (STATE.IDS vs SPLSTATE.IDS vs EXTSTATE.IDS)

    Could someone point me towards a tutorial that defines their differences, or perhaps briefly rundown the differences here? Thanks!
  • kjeronkjeron Member Posts: 2,367
    Bubb said:

    I am a bit confused about the differences between States, Spell States, and Extended States. (STATE.IDS vs SPLSTATE.IDS vs EXTSTATE.IDS)

    Could someone point me towards a tutorial that defines their differences, or perhaps briefly rundown the differences here? Thanks!

    There are 32 STATES, corresponding to the creature flags at 0x20. They are set through a variety of opcodes, and almost all have hardcoded effects related to their name. (Except STATE_DISEASED, which would more accurately be STATE_DISABLED). Some of them still require their related opcode for full functionality - setting them manually on the CRE file will only provide partial effect.

    Aside from a few spellstates which have hardcoded relations to effects:
    • 33 : [BERSERK_ALWAYS_ACTIVE]
      - Set by Opcode[#3*1]: Berserk (Melee/Constant)
      - Set by Opcode[#247*1]: Berserk State (Constant)
      - Alters [STATE_BERSERK]'s 'in combat' features to always be active.
      - Has no effect without [STATE_BERSERK].
    • 35 : [SUPPRESS_HP_INFO]
      - Suppresses the creature's Current and Maximum HP to always display "-/-" or "?", depending on screen.
      - Character portrait is completely overlayed in red, as if fully damaged.
      - Hit Points are only hidden from the player, script triggers can still detect the creature Hit Points.
    • 36 : [DOESNT_AWAKEN_ON_DAMAGE]
      - Set by Opcode[#39*1]: (Unconscious/Knockdown)
    • 38 : [DEAFENED]
      - Set by Opcode[#80]: Deafness
    • 40 : [SNEAK_ATTACK_IMMUNITY]
      - Set by Opcode[#292]: Backstab Immunity
    • 249 : [PRONE]
      - Set by Opcode[#39]: Prone
    • 250 : [DISEASED]
      - Set by Opcode[#78]: Disease
    • 255 : [CYNICISM_EQUIPPED]
      - Set by Opcode[#330*1], Text: Float String (Cynicism)
    (The above list may be out-of-date as of v2.5).
    They serve no other purpose than to be detectable by scripts, dialogues, splprot, and 7eyes. There are 255 SPLSTATES, about half of them in use.

    You can ignore Extended States - they are all mapped to a specific Spellstate, and behave the same as that spellstate.
  • ArunsunArunsun Member Posts: 1,592
    Is there a way to detect if a creature is dead, permanently? Like a trigger that would return true if the creature is affected by some form of permadeath (chunked, petrified then shattered, etc...), but false if the creature is either alive or just dead but raise-able?
  • kjeronkjeron Member Posts: 2,367

    I've seen several mods that dispense with the Polymorph effect, and simply use opcode 111 and add opcode 53 Animation Change to the claw .ITM. Pretty much any .CRE characteristics I like can be applied as equipping effects on the claw .ITM. Bonus: the claw can have an item effect that removes itself, easily undoing the shapechange.
    Anything I haven't thought of?

    Weapons created with opcode 111 cannot use any activated abilities (those behind the "Use Item" button), they just don't show up.
  • GrammarsaladGrammarsalad Member Posts: 2,582
    How do you find out which bams are associated with particular animations (e.g. wolf animation bams). I generally just look bam by bam but there has to be a way to look it up, right?
  • RaduzielRaduziel Member Posts: 4,714
    edited August 2018
    @Grammarsalad

    1) Get the creatures animation file (.INI) at the CRE file

    2) In the .INI file you'll find something like this on the top of the file
    // MGIC golem_ice
    This MGIC is the initial letters of the BAM files related to this creature.

    Edit: You can do the same to search for the sound files related to the creature.
  • RaduzielRaduziel Member Posts: 4,714
    @kjeron @Artemius_I @Gwendolyne @subtledoctor thanks for the feedback, I've used Subtledoctor's approach (delayed damage-effects).

    ---

    I'm trying to understand the logic behind summoning spells.

    Some spells use an Opcode 177 that calls an effect with Opcode 67.

    Other spells use the Opcode 67 directly.

    And other use Opcode 331 that calls a 2DA file.

    The last one I can understand that is used when the summon has a random factor (kind, power or quantity of creatures), but why the Opcode 177 thing?

    Thanks!
  • kjeronkjeron Member Posts: 2,367
    Raduziel said:

    but why the Opcode 177 thing?
    Thanks!

    Opcode 67 plays an animation (VEF/VVC/BAM) at the summoning location.
    This animation file can only be specified in an external EFF, because it's stored in the 2nd resource field, otherwise it will play a default (SPBOOM.BAM).
  • RaduzielRaduziel Member Posts: 4,714
    kjeron said:

    Raduziel said:

    but why the Opcode 177 thing?
    Thanks!

    Opcode 67 plays an animation (VEF/VVC/BAM) at the summoning location.
    This animation file can only be specified in an external EFF, because it's stored in the 2nd resource field, otherwise it will play a default (SPBOOM.BAM).
    Thanks!
  • GwendolyneGwendolyne Member Posts: 461
    That's the only way to play customized VVC effect, or none at all, when summoning creatures. ;)
  • RaduzielRaduziel Member Posts: 4,714
    edited August 2018
    Ok, next question everyone!

    I have a spell that summons a creature. But I want to make it more PnP style, so...

    1) Every turn there will be an increasing 5% chance that the creature will go hostile and turn against the summoner (unless the caster has Protection From Evil over him/her). So 5% (turn 1), 10% (turn 2) all the way to 100% (turn 20).

    2) If a second creature of the same kind is summoned, the first one is dismissed.

    3) The caster may dismiss the creature at any time until it goes hostile.

    4) Mental battle when the creature is summoned (like happens to wizards summoning elementals). Option 1 will only start happening after the mental battle.

    Doable?

    Thanks!
  • The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714
    edited August 2018

    I don't think you can dismiss summons from the caster. I've seen mod(s) that give a "dismiss self" ability to the creature... but that's not helpful if you lose control of it.

    As forosong control, just need to apply a spell to the creature once (maybe via its override script?) which has 20 effects, each with increasing probabilities and delayed durations on timing mode 4.

    Not having the ability to dismiss will make the "lose-control" a very heavy liability.

    I was thinking about something as Opcode 55 targeting the death variable but looks like there is no such thing. The spell would be able to be cast only once but would kill any creature of that death variable (Target 8 - Except Self).


    Edit: Actually, the dismiss-self is useful, as I want to make the caster incapable of dismissing if he/she loses control over the creature.
  • ArunsunArunsun Member Posts: 1,592
    How do I make new .ACM and .MUS file to add custom music (for a mod), using a normal sound file (WAV,MP3, whatever...)?
  • AstroBryGuyAstroBryGuy Member Posts: 3,437
    edited August 2018
    Arunsun said:

    How do I make new .ACM and .MUS file to add custom music (for a mod), using a normal sound file (WAV,MP3, whatever...)?

    @Arunsun - for the EEs or the classic versions, or both?

    If for the EEs, you don't need to encode the sound files as .acm. Just encode them as .ogg and rename the .ogg file .acm (this works for character sounds as well, encode them as .ogg and rename the .ogg to .wav).

    To add the music into the game, you'll need to use the ADD_MUSIC function in WeiDU. There's a tutorial over at Pocket Plane (includes instructions for the .mus file):

    http://forums.pocketplane.net/index.php?topic=56.0

    Note: If you are planning for the mod to be compatible with the classic versions, you will need a program to convert .wav to .acm. Also, ToBEx is generally required to remove the hardcoded limit on the number of entries in SONGLIST.2DA.

    https://www.weidu.org/~thebigg/README-WeiDU.html#hevea_default276
  • RaduzielRaduziel Member Posts: 4,714
    edited August 2018
    Ok, one more round. Should be an easy one this time.

    I have a creature that uses the Skeleton Warrior animation. So far so good.

    I want to make this creature have a base-speed of 18 (considering that, per PnP rules, the base movement is 12 for humans). So a 50% increase.

    I'm using Opcode 126, p1 = 150, p2 = 2 and the creature keeps moving slowly.

    I did the same for another creature, that uses the Ghoul animation, but to reduce its base-speed to 9 (Op 126, p1 = 75, p2 = 2) and it works.

    How can I make the skeleton-creature move faster? Am I doing something wrong or is there a secret-IE-trick that needs to be done? This creature is under blur and translucency effects, IDK if it is relevant.

    Edit: I couldn't find an offset for speed in IESDP's file format. Even if I find it, as IDK what value the game uses as a base for the humans and how does it scale I can't do much through Weidu.

    Thanks.

    ---

    Bonus question: what the offset 0x0274 (Specific -> related to Specific.IDS) does? I see that I can flag a creature as 250 - Spirit, what is the practical effect of doing so?
  • The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714
    edited August 2018

    Some animations have their move speed set according to the animation. You'll need to take that into account. Also I'm not sure percentage values over 100 work. Even if 150% does work, maybe 150% of slow is still pretty slow.

    I think the base walking speed in this engine is 9. So maybe increment by 4/5 or set it to 13/14. (Item Revisions has the Boots of Speed increment speed by 4, so if your players are uding IR you can decide if you want this monster to be the same speed as the boots of Speed, or a bit faster :naughty: )

    150% should be faster than 100% as 1.5 > 1.

    I'm positive the values above 100 work because that's how Expeditious Retreat works: it sets your movement to 200%.

    Boots of Speed doubles the movement rate IIRC, so the creature needs to be slower than that. I'm following a PnP description (as usual lol).

    Having a base value of 9 and knowing that the BoS increases by 4 gives me some parameters to build upon, but without knowing the offset to speed I can't do much with that information.

    Probably this is happening due to the animation, then. I'll see what I can do about it.

    Do you know by any chance where do I find that info at the .INI file? And how do I add a new animation?

    Thanks!
  • kjeronkjeron Member Posts: 2,367
    As far as animations go:
    Normal Skeleton's base movement speed is 9.
    Skeleton "Warrior" (first 3 tiers of animate dead), Skeleton "Fiend" (Bone Golem), and Skeleton "Monster" (last tier of animate dead) all have a base movement speed of 6.
    It's all stored in the INI file under "move_scale="
  • RaduzielRaduziel Member Posts: 4,714
    Thanks! That's all the info I need to solve this :)
  • RaduzielRaduziel Member Posts: 4,714
    edited August 2018
    kjeron said:

    As far as animations go:
    Normal Skeleton's base movement speed is 9.
    Skeleton "Warrior" (first 3 tiers of animate dead), Skeleton "Fiend" (Bone Golem), and Skeleton "Monster" (last tier of animate dead) all have a base movement speed of 6.
    It's all stored in the INI file under "move_scale="

    Raduziel said:

    Thanks! That's all the info I need to solve this :)

    Looks like I'm failing yet.

    Taking 9 as a base speed (equivalent to 12 in PnP), increasing it by 50% (to match PnP's 18) gives us a speed of 13,5. Opcode 126, p1 = 150, p2 = 2.

    Taking 6 as a base speed, to achieve the same 13,5 I increased it by 125%. Opcode 126, p1 = 225, p2 =2.

    But the creature keeps moving at the same speed.


    Solved. Opcode 126 needs to be applied directly to the creature, not through an item.
    Post edited by Raduziel on
  • BubbBubb Member Posts: 1,000
    edited August 2018
    How does the engine know to restrict a spell book from certain characters? I assume it's all based on their class and hard coded, though I just wanted to make sure it's not in a 2DA somewhere. Also, is the mechanism that restricts the spell book from classes also the same as the one that restricts them from kits, like the Inquisitor? Thanks!

    Edit: For anyone who was curious, it does indeed seem that the spell-book restrictions are hardcoded in the engine based on class. In the special case of Paladins, the engine checks if the kit's UNUSABLE column (as defined in KITLIST.2DA) is set to "0x00000010". If it is, the engine denies the kit the cleric spell book.
    Post edited by Bubb on
  • CamDawgCamDawg Member, Developer Posts: 3,438
    edited August 2018
    Raduziel said:

    Bonus question: what the offset 0x0274 (Specific -> related to Specific.IDS) does? I see that I can flag a creature as 250 - Spirit, what is the practical effect of doing so?

    Specifics are just an additional identifier you can utilize to target creatures via scripting, either using the [EA.GENERAL.RACE.CLASS.SPECIFIC.GENDER.ALIGN] object construct or by direct polling with the Specifics() trigger. Given that it's a creature stat, you can also target opcodes at it as well.

    The values themselves are arbitrary, though you probably want to avoid existing values since there are probably scripts targeting them already.
  • [Deleted User][Deleted User] Posts: 0
    edited August 2018
    The user and all related content has been deleted.
  • RaduzielRaduziel Member Posts: 4,714
    Thank you both :)
Sign In or Register to comment.