Skip to content

General mod Questions thread

1181921232470

Comments

  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535


    Ah! You made my eyes bleed. Macros, man. Learn to love macros.

    Called Shot, Blind: Hit! ;)


    - CS_CAST should have a ranged hit effect (opcode 249, I think) which triggers an .EFF file

    Are you talking about CS_CAST or the melee ability of CS_CAST?


    - CS_TARG should have your called shot effects, and we just added a 318 effect above them so that undead will be unaffected.

    Again, are you talking about CS_TARG or the melee ability of CS_TARG? I guess the latter....


    Finally, the CS prefix was registered in 2007 by "Chronis." I don't know who that is or which mods use it, but I suggest using a prefix yourself to avoid filename clashes.

    Didn't know about this one......
  • [Deleted User][Deleted User] Posts: 0
    edited April 2018
    The user and all related content has been deleted.
    Post edited by [Deleted User] on
    _Luke_Raduziel
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited April 2018
    kjeron said:

    In those EFF's, fill in the parent resource field with something similar, but not exactly matching the spell, so it doesn't interfere with a mirror match.

    What do you mean exactly? Could you provide an example of mirror match?
  • ArunsunArunsun Member Posts: 1,592
    edited April 2018
    I'm having an issue making unstackable mutually exclusive buffs that override one another:
    Here's how I proceeded:
    On every spell, I have:
    OPcode 146 casting a spell that removes the effects of every buff that's already applied as a first effect
    OPcode 146 casting a spell with a permanent drawback
    A bunch of temporary drawbacks that are the same on all my buffs.
    A few effects: the buff in itself

    The issue I have is that obviously the first OPcode casts the spell after the rest of the effects are applied, effectively rendering them null (besides the one from the second effect, since it's a spell that isn't canceled by the spell from the first effect). So from what I understand the first spell to be cast (the main spell) is totally resolved before the secondary spells (those with the cast spell opcode) and these are cast in turn after that.
    What solution would work? I thought of these:
    Replacing the first effect directly with a bunch of "Remove effect by resources" (those contained within the spell cast by that effect) so that these apply first, then adding all my effects. EDIT: Went for that, seems to work.
    Casting all the effects I want to apply through a subspell, and use another effect 146 to cast this subspell afterwards.
    Post edited by Arunsun on
  • kjeronkjeron Member Posts: 2,367
    edited April 2018
    Luke93 said:

    What do you mean exactly? Could you provide an example of mirror match?

    Two creatures using the same ability, or one creature firing against a creature with the Physical Mirror spell.

    Creature A activates Called Shot.
    Creature A shoots creature B.
    Creature B activates their own Called Shot, if the base spell and it's effects shared the same parent resource, it would also remove the effects of getting hit by Creature A's Called Shot.

    Creature A activates Called Shot.
    Creature B casts Physical Mirror.
    Creature A shoots creature B, and gets hit by their own attack from Phsyical Mirror.
    Creature A activates Called Shot again, if the base spell and it's effects shared the same parent resource, it will also remove the effects of getting hit by the previous Called Shot.

    Putting all of the hit-effects into a subspell as @subtledoctor was suggesting will bypass this, as the subspell becomes the parent resource for the hit-effects, and obviously it cannot have the same filename as the base spell.
    Post edited by kjeron on
    Arunsun[Deleted User]_Luke_Raduziel
  • ArunsunArunsun Member Posts: 1,592
    Just a quick question concerning LU***.2da files. I'm looking to make a multiclass kit, and I was wondering about the min_level column. What exactly does it refer to? For example, Mage HLAs (besides bonus spells) in multiclass tables are always marked with min_level 32. What's that 32? these HLAs are meant to be taken when the mage level is 18 or more, and I can't find what 32 corresponds to. I first thought it was total level, but that doesn't match since you get your mage level 18 at the same time as your fighter level 20, so 38 total.
  • The user and all related content has been deleted.
    Arunsun
  • kjeronkjeron Member Posts: 2,367
    HLA MIN_LEVEL field value:
    1: available to anyone
    16: available to multiclass characters with 14+ priest(cleric/druid) levels
    32: available to multiclass characters with 18+ wizard(mage) levels
    Arunsunsemiticgoddess
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited April 2018
    @subtledoctor So, I'm following your suggestion and everything seems to work fine now. As a side note, RR Poison Weapon is built in the same way: a single Ranged-hit effect that triggers a subspell containing the hit-effects (the only difference is that Wisp uses opcode 177 instead of 318/324 to make Golems, Undead, Elementals immune to the poison).

    However, I have a question: what should I add to your piece of code (why did you put Instant/limited, duration = 1 instead of Instant/permanent until death?)
    COPY_EXISTING ~CS_TARG.spl~ ~override~
      LPF ADD_SPELL_EFFECT INT_VAR insert_point = 0 opcode = 318 target = 2 timing = 0 duration = 1 parameter2 = 1 STR_VAR resource = EVAL ~%SOURCE_RES%~ END
    in order to set the Description Note field? Something like STR_VAR special = ~Unaffected by spell X~?
    Moreover, if I need more opcodes 318, it is sufficient to edit the previous code with insert_point = 1, 2, 3 and so forth, right?
    Post edited by _Luke_ on
  • The user and all related content has been deleted.
    _Luke_
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited April 2018


    - The 'Special' field takes an integer, I think (it's under "INT_VAR" in the macro?). So you need a string reference there. Maybe it can use RESOLVE_STRREF? Not sure...

    Yeah, it worked. The problem is that the string doesn't appear in the combat log when an undead creature (e.g., SKELE2) is hit....
    Ratatoskr
  • kjeronkjeron Member Posts: 2,367
    Luke93 said:

    The problem is that the string doesn't appear in the combat log when an undead creature (e.g., SKELE2) is hit....

    Even several vanilla spells make use of the field in that manner for opcode 318, but it is not functional for them either.
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    WeiDu question!

    In IWD2, the game has separate fields for "Total level" and "Challenge rating." In the early game, those fields are usually the same, but later in the game, "Challenge rating" doesn't increase as fast as "Total level." I want to patch all critters so that their challenge rating is always equal to their total level (I want to change the challenge rating, not the level). How would I do this?
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    I got it!

    I borrowed some code from a post by Ghreyfain in 2004 and tweaked it. First, we need a line to check all creature files:

    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~

    To find a specific value in those files, though, or edit them, we need to know the offsets. You can find them by going to the hex section in Near Infinity and clicking on those dots to the right.

    That little box at the bottom says what each little byte represents, which includes the name of the offset. It's kind of hard to find which one you want, but the "Total level" field's offset is 8A. So our next line is

    READ_BYTE "0x8A" "totallevel"

    This takes the value in the "Total level" field and sets it to "totallevel," a new variable (we can choose any name we like for this variable). We're going to use this variable to set a condition for the next line, which will set the "Challenge rating" field of the critter file in question to 30.

    WRITE_SHORT 0x25A 30

    The offset for "Challenge rating" is 25A, hence the 0x25A in that line. But, to make sure we don't patch every critter in the game to give it a challenge rating of 30, our next line adds a condition:

    IF_EVAL ("%totallevel%" = "0x1E")

    In hex, 1E is equal to 30. What this line does is check the "totallevel" variable (which we set to the critter's "Total level" value on the second line) and then, if that variable is equal to 30, then it writes 30 to the "Challenge rating" field.

    These four lines will find every creature in the game, check to see if they're level 30, and then give them a challenge rating of 30 if they are.

    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~

    READ_BYTE "0x8A" "totallevel"

    WRITE_SHORT 0x25A 30

    IF_EVAL ("%totallevel%" = "0x1E")

    Since I want all critters to have a challenge rating equal to their total level, I have to copy and paste these four lines 30 times, replacing the "30" on the third line with 1, 2, 3, etc., and replacing the 0x1E on the fourth line with the hex versions of those numbers. Thus, to patch level 1 and 2 critters, we'd use these two four-line orders (the changes are in red):

    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~

    READ_BYTE "0x8A" "totallevel"

    WRITE_SHORT 0x25A 1

    IF_EVAL ("%totallevel%" = "0x2")

    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~

    READ_BYTE "0x8A" "totallevel"

    WRITE_SHORT 0x25A 2

    IF_EVAL ("%totallevel%" = "0x2")

    Voila!
    Bubb
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    I've long been wondering what those kind of commands did! By replacing some values, this sequence can patch all kinds of stuff. You can just replace the

    COPY_EXISTING_REGEXP ~.*\.cre~ ~override~

    with

    COPY_EXISTING_REGEXP ~.*\.spl~ ~override~

    to patch spells instead of creatures, for example. I know a lot of you guys have known this for years, but I'm quite pleased to actually understand how these commands work.
  • ArunsunArunsun Member Posts: 1,592
    edited April 2018

    WeiDu question!

    In IWD2, the game has separate fields for "Total level" and "Challenge rating." In the early game, those fields are usually the same, but later in the game, "Challenge rating" doesn't increase as fast as "Total level." I want to patch all critters so that their challenge rating is always equal to their total level (I want to change the challenge rating, not the level). How would I do this?

    Don't have IWD2 so I can't give you the exact code since I can't have the offsets
    COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
    	READ_BYTE offset ~class~ //offset is the byte at which the class is written. On BG it's 273
    	READ_BYTE offset ~level1~ //offset is the byte at which the level of the first class is written. On BG it's 234
    	SET "level2" =0 //Set the level variables for class 2 and 3 to 0 because that's what it will be most of the time, and the game has a 1 as a default
    	SET "level3" =0
    	PATCH_MATCH ~%class%~ WITH //Patch if "class" is equal to one of the following value
    	7  8 9 10 13 14 15 16 17 18 BEGIN //If this is a 2+ multiclass. The values might not be the same, check class.ids
    		  	READ_BYTE offset ~level2~ //appoint the real value of level 2
    	END
    
    	
    	10 17  BEGIN //same as above for triple multi class
    		READ_BYTE offset ~level3~		
    		  
    	END
    	DEFAULT
    	
    	END
    	WRITE_BYTE offset (~%level1%~ + ~%level0%~ + ~%level3%~) //sums the three levels and writes it at the offset of challenge rating
    
    BUT_ONLY
    Post edited by Arunsun on
    semiticgoddess
  • semiticgoddesssemiticgoddess Member Posts: 14,903
    @Arunsun: Thank you! I also worked out a solution of my own, mentioned above. I notice your code looks differen't from mine--is mine okay?

    Adding together the levels shouldn't actually be necessary in IWD2. In IWD2, "Total level" is a separate field, which I think is always set to the sum of their levels. So a critter with a "Rogue levels" of 2 and a "Mage Levels" of 14 would have a "Total level" of 16 by default.
  • ArunsunArunsun Member Posts: 1,592
    edited April 2018

    @Arunsun: Thank you! I also worked out a solution of my own, mentioned above. I notice your code looks differen't from mine--is mine okay?

    Adding together the levels shouldn't actually be necessary in IWD2. In IWD2, "Total level" is a separate field, which I think is always set to the sum of their levels. So a critter with a "Rogue levels" of 2 and a "Mage Levels" of 14 would have a "Total level" of 16 by default.

    Well if the total level is a separate field then it's much simpler.
    COPY_EXISTING_REGEXP GLOB ~^.+\.cre$~ ~override~
    	READ_BYTE 0x8a ~totallevel~ 
    	WRITE_BYTE 0x25a ~%totallevel%~
    
    BUT_ONLY
    WeiDU can take integer variables for values, no need to copy the same thing 30 times. Yours would work too be it would be super suboptimal as it would copy every creature and check their level 30 times which would take like 5 minutes instead of 10 seconds.

    By the way, you wrote "WRITE_SHORT". I don't know on how many bytes the challenge rating is written but I'd wager it's a single byte so use WRITE_BYTE instead. WRITE_SHORT writes 2 bytes. Additionnally, in your condition, you wrote 0x1E. You could've written 30. 0x is just a prefix that says "what comes next is written in hexadecimal". There are others (mostly 0b, which means that what's just after is in binary) but you may use the standard base 10 numbers.

    Oh and in NI, in the edit menu of any file, the right column is the hexadecimal offset, which is much simpler than going through the hex code directly.
    semiticgoddess
  • [Deleted User][Deleted User] Posts: 0
    edited April 2018
    The user and all related content has been deleted.
    semiticgoddess
  • kjeronkjeron Member Posts: 2,367

    Btw where you use "COPY_EXISTING_REGEXP" you really want to use

    COPY_EXISTING_REGEXP GLOB
    GLOB is enabled by default for COPY_EXISTING_REGEXP, you only need to specify NO_GLOB when you do not want it.
    semiticgoddessArunsun
  • ArunsunArunsun Member Posts: 1,592
    I add a few questions concerning mod compatibility and maps.
    In one of my mods I would like to revamp some SoD maps for new content which you can access once in SoA.
    How does EET behave with maps from the previous games? Meaning, if I'm in SoA, can I access the BG maps just like that, or are they just on the map but unaccessible like, say, Spellhold, in which case I would have something special to do to make them accessible from SoA?
    In my situation, I would like to do more than just changing the NPCs that are present on the map. I would also like to make some graphic changes (i.e removing the tents etc...). So that would take changing the map WED, MOS and TIS. Can I do that while staying on the same ARE file ? Or do I need, for instance, to make it so when my party arrives onto the map, they are teleported by the map script to another map which matches what I want? I know that something like that is done in The Grey Clan but it's an old mod so maybe there are better ways of doing things now...
  • The user and all related content has been deleted.
  • WarChiefZekeWarChiefZeke Member Posts: 2,651
    Druids got kind of shafted in terms of their available multiclass options. Are there any mods that give druids some of the PnP allowed multiclasses, such as Druid/Mage or Fighter/Mage/Druid?
  • [Deleted User][Deleted User] Posts: 0
    edited April 2018
    The user and all related content has been deleted.
    WarChiefZeke
  • WarChiefZekeWarChiefZeke Member Posts: 2,651

    Druids got kind of shafted in terms of their available multiclass options. Are there any mods that give druids some of the PnP allowed multiclasses, such as Druid/Mage or Fighter/Mage/Druid?

    You would need to tear apart the priest spell system and apply spells via a different method, like with a sphere system. And then make a cleric kit that gets druid abilities and druid spells. And them make a sysem to allow kitted multiclasses available. Then you could have druid/mage, and druid/thief, and druid/ranger.

    And, we've done just that. :wink:

    EDIT - we didn't make a triple-class version though, sorry. You could apply our druid/mage kit to an F/M/C... it would probably work fine, it would only be limited in getting the standard F/M/C HLAs instead of the custom druid/mage list.

    EDIT 2 - there might be item usability issues too... not sure.
    Man, I can't believe it was that complicated! Thanks for letting me know.

    Druid/Mage was really what I was looking for anyways. Does this allow dual classing from Druid to Mage by any chance?
  • The user and all related content has been deleted.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535

    I have already ported modrons and other PsT animations into IA. If you intend to release your mod both for classical and EE games, I will give you the registered slots.
    I have also ported almost all the Diablo II demons. If you need them, I can share them. They will be implemented into the next IA release.

    Are you saying that you're good at creating new animations? If so, have you ever thought about creating a new animation for Ninjatōs/Wakizashis? As you probably know, their current equipped appearance is that of Long swords/Short swords. The problem is that those two exotic weapons certainly don't look like ordinary Long swords/Short swords....
  • GwendolyneGwendolyne Member Posts: 461
    I fear it might not be doable.

    The best way to do it would be to use the 3D creatures and weapons models, modify the sword shape, extract the sword animation, then convert them into bam files. But as the original sources have been "lost", I don't see any easy to do it. At least, it is far, so far beyond my skills. ;)
  • The user and all related content has been deleted.
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535

    The animations in the game are so tiny and pixellated anyway, it seems like it would not be worth the (massive) effort of creating new .bams just for those two weapons...

    Yes, you're right. @Gwendolyne But what about editing only their animation slot?
    For example, you could take inspiration from the 1PP's original improved katana paperdoll (see the attached archive). Seems to be quite suitable for ninjatōs...
Sign In or Register to comment.