Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

-HOW TO DO STUFF IN WEIDU-

12357

Comments

  • semiticgodsemiticgod Member, Moderator Posts: 13,339
    @subtledoctor: Thank you! I got it to work. Instead of opcode 272, I used 232, which allowed me to make the check happen whenever the critter in question was hit, instead of once per round (which would very seldom work for Archers, since Called Shot's STR drain is so brief).

  • RaduzielRaduziel Member Posts: 4,476
    Thanks!

    Can I give any animation from animate.ids to a creature?

    Let's say make a creature with the Glyph of Warding animation.

  • subtledoctorsubtledoctor Member Posts: 11,174

    make the check happen whenever the critter in question was hit, instead of once per round

    Duh, that makes much more sense. Nice!

  • RaduzielRaduziel Member Posts: 4,476
    Did anyone download Weidu v243?

    My antivirus isn't allowing me to get it.

  • GwendolyneGwendolyne Member Posts: 243
    As usual. It is a false positive. Bypass your antivirus. ;)

    Raduziel
  • subtledoctorsubtledoctor Member Posts: 11,174
    Raduziel said:

    Is there a way to alter the Turn Undead effects for a kit?

    As a stupid example: Make it capable of turn Undead and Myconids.

    Actually I've just been experimenting a bit and I think I've got a way to use items as ability toggles. So if you're willing to use a quickslot for it (you're supposed to present your holy symbol, right?), then this kind of thing might be possible for anyone.

    Raduziel
  • RaduzielRaduziel Member Posts: 4,476
    edited January 2018

    Raduziel said:

    Is there a way to alter the Turn Undead effects for a kit?

    As a stupid example: Make it capable of turn Undead and Myconids.

    Actually I've just been experimenting a bit and I think I've got a way to use items as ability toggles. So if you're willing to use a quickslot for it (you're supposed to present your holy symbol, right?), then this kind of thing might be possible for anyone.
    I'm willing.

  • semiticgodsemiticgod Member, Moderator Posts: 13,339
    @subtledoctor: That sounds really cool. How does it work?

  • subtledoctorsubtledoctor Member Posts: 11,174
    edited January 2018

    @subtledoctor: That sounds really cool. How does it work?

    What, the toggle? Right now I only have it in concept form. My test install is on an iPad which makes testing kind of slow. But what I've almost fully implemented is, the item sits in your quickslot and uses opcode 146 to cast SpellA; SpellA has timing mode 1 (permanent until death), and raises your caster level by some value (say, 50), and triggers a 177/232 contingency .EFF with condition of hp<102%, triggering SpellB, which cancels itself and has some arbitrary effect that lasts 7 seconds; this will repeat every 6 seconds. There is your arbitrary "Turn Undead" or whatever ability.

    Meanwhile, SpellA will have a 2nd ability header with min_level = 51; this ability will 321 cancel SpellB, 206 protect from SpellB for 7 seconds, and 321 cancel SpellA, restoring your caster level to its appropriate value. So you can (theoretically) activate the aura/ability/whatever, and then cancel it, by just repeatedly using the item. (The item must have the "max charges" in its ability header set to 0, for infinite at-will use.)

    Now, it occurs to me that you can't really do this with spellcasters, because they will suddenly have maximum caster level while the aura/ability is in effect. So you must either a) disable spellcasting during that effect; or b) stop using caster level and convert the conditional effect of SpellA to filter by a stat or spellstate, instead of caster level. The latter is perfectly feasible, on paper at least. I just haven't fully put together the concept. (I'm using this for now with my spontaneous specialist casting mod, which already uses caster level changes anyway, so there is no need (yet) for me to shift it over to a spellstate condition.)

    Post edited by subtledoctor on
    Raduzielsemiticgod
  • RatatoskrRatatoskr Member Posts: 347
    edited January 2018
    Hello again. Hopefully another quick question this time.

    Is there an easy way to make my new interjection for a character play after all the interjections from other mods, even if mine is installed last?

    Weights seem kind of complicated and I didn't see anything else in the weidu faq. So I guess the real question is, "can I use weights with interject copy trans, and if so, how?"

    Post edited by Ratatoskr on
  • semiticgodsemiticgod Member, Moderator Posts: 13,339
    @subtledoctor: How would I patch all critters including party members with a visual range bonus? I was wondering what gameplay would be like if I doubled or tripled everyone's field of vision. I thought it might be interesting since there are so many differences in spell and missile weapon ranges that never become relevant because they're limited by visual range.

    Raduziel
  • ArdanisArdanis Member Posts: 1,617
    Pretty sure the extended sight range still doesn't clear the black fog beyond the 30', even though you see critters walking among.
    As for gameplay effect, EE content has some tightly packed areas where actors are barely out of each other's sight. E.g. attacking Vichand in the Crusader camp in SoD would trigger the whole camp because they can now see him being attacked. Not quite critical, but you may have wanted to know.

  • RaduzielRaduziel Member Posts: 4,476
    I was creating some BAM files right now and, as I used the same PVRZ number for all of them (26) I ended up with 26 of the same picture.

    Looking at the NearInfinity documentation I found an instruction (given by @argent77 ) to use a special Weidu function to handle this (as I can't foresee other mods that adds BAMs and uses PVRZ number).

    How can I do it?

    Thanks!

  • argent77argent77 Member Posts: 2,734
    The relevant WeiDU functions for dealing with PVRZ are UPDATE_PVRZ_INDICES and INSTALL_PVRZ. Both functions are described in the WeiDU docs.

    Example for installing a BAM V2 file:
    // 1. Install your BAM V2 file COPY ~%MOD_FOLDER%/bam/myfile.bam~ ~override~ // Called in preparation for step 2 LPF UPDATE_PVRZ_INDICES RET original_base_index new_base_index END // 2. Install associated PVRZ file ACTION_IF (original_base_index >= 0 AND new_base_index >= 0) BEGIN // Only needed if source pvrz page index < 1000. // Alternatively, replace %zero% with a fixed string of zeros in the "source_file" path below. OUTER_PATCH_SAVE zero ~0000~ BEGIN DELETE_BYTES 0 STRING_LENGTH ~%original_base_index%~ END // Install pvrz with updated indices LAF INSTALL_PVRZ INT_VAR original_base_index new_base_index STR_VAR source_file = EVAL ~%MOD_FOLDER%/bam/mos%zero%%original_base_index%.pvrz~ END END
    You would have to expand the second part a bit if your BAM consists of multiple PVRZ files.

    Raduziel
  • RaduzielRaduziel Member Posts: 4,476
    @argent77 Thanks!

    Let's pretend I'm a 6 yo that just saw a cat having sex.

    Please, correct my example if I'm wrong:


    //Baervan Holy Symbol - code gently given by Argent77

    COPY ~Deities&Pantheons\Itm\HolySymbols\BAM\BAERS.bam~ ~override~
    LPF UPDATE_PVRZ_INDICES
    RET
    original_base_index
    new_base_index
    END

    ACTION_IF (original_base_index >= 0 AND new_base_index >= 0) BEGIN
    OUTER_PATCH_SAVE zero ~0000~ BEGIN
    DELETE_BYTES 0 STRING_LENGTH ~%original_base_index%~
    END

    LAF INSTALL_PVRZ
    INT_VAR
    original_base_index
    new_base_index
    STR_VAR
    source_file = EVAL ~%MOD_FOLDER%/bam/MOS1000.pvrz~
    END
    END

    COPY ~Deities&Pantheons\Itm\HolySymbols\BAM\BAERL.bam~ ~override~
    LPF UPDATE_PVRZ_INDICES
    RET
    original_base_index
    new_base_index
    END

    ACTION_IF (original_base_index >= 0 AND new_base_index >= 0) BEGIN
    OUTER_PATCH_SAVE zero ~0000~ BEGIN
    DELETE_BYTES 0 STRING_LENGTH ~%original_base_index%~
    END

    LAF INSTALL_PVRZ
    INT_VAR
    original_base_index
    new_base_index
    STR_VAR
    source_file = EVAL ~%MOD_FOLDER%/bam/MOS1001.pvrz~
    END
    END

  • argent77argent77 Member Posts: 2,734
    edited February 2018
    Some minor corrections. The source_file paths have to be updated, and the "zero" code is not needed in your example.
    //Baervan Holy Symbol - code gently given by Argent77 COPY ~Deities&Pantheons/Itm/HolySymbols/BAM/BAERS.bam~ ~override~ LPF UPDATE_PVRZ_INDICES RET original_base_index new_base_index END ACTION_IF (original_base_index >= 0 AND new_base_index >= 0) BEGIN LAF INSTALL_PVRZ INT_VAR original_base_index new_base_index STR_VAR source_file = ~Deities&Pantheons/Itm/HolySymbols/BAM/MOS1000.pvrz~ END END COPY ~Deities&Pantheons/Itm/HolySymbols/BAM/BAERL.bam~ ~override~ LPF UPDATE_PVRZ_INDICES RET original_base_index new_base_index END ACTION_IF (original_base_index >= 0 AND new_base_index >= 0) BEGIN LAF INSTALL_PVRZ INT_VAR original_base_index new_base_index STR_VAR source_file = ~Deities&Pantheons/Itm/HolySymbols/BAM/MOS1001.pvrz~ END END

    I'm assuming that PVRZ files are found in the same folder as the BAM files.

    Edit: You can probably place your code into a FOR_EACH loop to remove duplicate code.
    ACTION_FOR_EACH file IN ~BAERS~ ~BAERL~ BEGIN COPY ~Deities&Pantheons/Itm/HolySymbols/BAM/%file%.bam~ ~override~ LPF UPDATE_PVRZ_INDICES RET original_base_index new_base_index END ACTION_IF (original_base_index >= 0 AND new_base_index >= 0) BEGIN LAF INSTALL_PVRZ INT_VAR original_base_index new_base_index STR_VAR source_file = EVAL ~Deities&Pantheons/Itm/HolySymbols/BAM/MOS%original_base_index%.pvrz~ END END END

    Post edited by argent77 on
    Raduziel
  • RaduzielRaduziel Member Posts: 4,476
    Thanks, that will help me a lot! :)

  • RaduzielRaduziel Member Posts: 4,476
    Is there a better way to writing the following line:
    ACTION_FOR_EACH file IN ~BAERS~ ~BAERL~ ~BARAS~ ~BARAL~ ~CLANS~ ~CLANL~ ~CYRIS~ ~CYRIL~ ~HELMS~ ~HELML~ ~ILMAS~ ~ILMAL~ ~LATHS~ ~LATHL~ ~OGHMS~ ~OGHML~ ~SHARS~ ~SHARL~ ~SUNES~ ~SUNEL~ ~TALOS~ ~TALOL~ ~TEMPS~ ~TEMPL~ ~TYRS~ ~TYRL~ BEGIN
    COPY ~Deities&Pantheons/Itm/HolySymbols/BAM/%file%.bam~ ~override~
    ?

    Thanks.

  • subtledoctorsubtledoctor Member Posts: 11,174
    Raduziel said:

    Is there a better way to writing the following line:

    ACTION_FOR_EACH file IN ~BAERS~ ~BAERL~ ~BARAS~ ~BARAL~ ~CLANS~ ~CLANL~ ~CYRIS~ ~CYRIL~ ~HELMS~ ~HELML~ ~ILMAS~ ~ILMAL~ ~LATHS~ ~LATHL~ ~OGHMS~ ~OGHML~ ~SHARS~ ~SHARL~ ~SUNES~ ~SUNEL~ ~TALOS~ ~TALOL~ ~TEMPS~ ~TEMPL~ ~TYRS~ ~TYRL~ BEGIN
    COPY ~Deities&Pantheons/Itm/HolySymbols/BAM/%file%.bam~ ~override~
    ?

    Thanks.
    Not really. You can hit enter after each one (or two, or three, or whatever - Weidu doesn't care about it) to arrange them vertically and make them more visible. Or, if you are using that list multiple times and want to be more efficient, you could put all of those in an array and then use (ACTION_)PHP_EACH to do the COPY and whatever other operations you want...

    Raduziel
  • RaduzielRaduziel Member Posts: 4,476
    I'll only use this once, the problem is that maybe this list will get bigger and bigger.

    Thanks! :)

  • RaduzielRaduziel Member Posts: 4,476
    edited February 2018
    Last question before I can move on to the last phase of my new kitpack:

    How can I direct a priest kit to a specific line of the priest stronghold?

    And: can I direct one kit to a stronghold that is not the priest one?

    Let's say I want to make a kit being able to get the Thief stronghold. Other to get the Fighter one. Other to the druid's stronghold. And finally, make sure that some kits will be correctly directed to the quest given by Talos/Helm/Lathander.

    Can it be done? I took a look at Divine Remix and even talked to @CamDawg , but the code there looks like Greek to me (what a surprise!)

    Thanks!

    Post edited by Raduziel on
  • subtledoctorsubtledoctor Member Posts: 11,174
    edited February 2018
    Raduziel said:

    How can I direct a priest kit to a specific line of the priest stronghold?

    I've had this link open in my browser for over a year, but haven't had the time to actually investigate further or implement anything.

    I woukd start there, and by looking at Divine Remix and maybe also Tweaks Anthology.

    If if you nail down the technique, ket me know! :wink:

    Raduziel
  • RaduzielRaduziel Member Posts: 4,476
    Dialog files.

    A new sea to sail apparently.

    I'll see what I can do, thanks for the link :)

  • CamDawgCamDawg Member, Developer Posts: 3,394
  • subtledoctorsubtledoctor Member Posts: 11,174
    Neither here nor there but an EFFECT_TO_EFF macro would be amazeballs.

  • RaduzielRaduziel Member Posts: 4,476
    @CamDawg Is every stronghold conditioned to the spawning of an actor?

    If so, do you have a list of all the actors in all the areas for all the strongholds?

    Thanks!

  • subtledoctorsubtledoctor Member Posts: 11,174
    Raduziel said:

    If so, do you have a list of all the actors in all the areas for all the strongholds?

    He posted a list in this thread.

    Raduziel
  • RaduzielRaduziel Member Posts: 4,476

    Raduziel said:

    If so, do you have a list of all the actors in all the areas for all the strongholds?

    He posted a list in this thread.
    Thanks!

  • RaduzielRaduziel Member Posts: 4,476
    CamDawg said:

    A new tutorial, Of cleric kits and strongholds, is available.

    I'm getting a parsing error
    Install Component [Strongholds Alterings (requires the respective kit component)]?
    [I]nstall, or [N]ot Install or [Q]uit?
    Installing [Strongholds Alterings (requires the respective kit component)] [1.0]

    [DeitiesOfFaerun/Components/StrongholdAlterings.tpa] PARSE ERROR at line 112 column 1-4
    Near Text: IF
    GLR parse error

    [DeitiesOfFaerun/Components/StrongholdAlterings.tpa] ERROR at line 112 column 1-4
    Near Text: IF
    Parsing.Parse_error
    ERROR: parsing [DeitiesOfFaerun/Components/StrongholdAlterings.tpa]: Parsing.Parse_error
    Stopping installation because of error.

    ERROR Installing [Strongholds Alterings (requires the respective kit component)], rolling back to previous state
    Unable to Unlink [DeitiesOfFaerun/Backup/22/OTHER.22]: Unix.Unix_error(1, "unlink", "DeitiesOfFaerun/Backup/22/OTHER.22")
    [DeitiesOfFaerun/Backup/22/UNSETSTR.22] SET_STRING uninstall info not found
    Will uninstall 0 files for [DEITIESOFFAERUN/DEITIESOFFAERUN.TP2] component 22.
    Uninstalled 0 files for [DEITIESOFFAERUN/DEITIESOFFAERUN.TP2] component 22.

    [DeitiesOfFaerun/Components/StrongholdAlterings.tpa] PARSE ERROR at line 112 column 1-4
    Near Text: IF
    GLR parse error

    [DeitiesOfFaerun/Components/StrongholdAlterings.tpa] ERROR at line 112 column 1-4
    Near Text: IF
    Parsing.Parse_error
    ERROR: parsing [DeitiesOfFaerun/Components/StrongholdAlterings.tpa]: Parsing.Parse_error
    Error Uninstalling [DEITIESOFFAERUN/DEITIESOFFAERUN.TP2] component 22:
    Parsing.Parse_error
    This part of the code seems to be the problem
    //Add Baervan, Baravar and Oghma to non-cleric quest-line

    OUTER_SPRINT extend ~~
    ACTION_IF FILE_EXISTS_IN_GAME ~RABAER.2da~ BEGIN
    OUTER_SPRINT extend ~%extend%
    Kit(Player1,RABAER)~
    END
    ACTION_IF FILE_EXISTS_IN_GAME ~RABARA.2da~ BEGIN
    OUTER_SPRINT extend ~%extend%
    Kit(Player1,RABARA)~
    END
    ACTION_IF FILE_EXISTS_IN_GAME ~RAOGHM.2da~ BEGIN
    OUTER_SPRINT extend ~%extend%
    Kit(Player1,RAOGHM)~
    END

    COPY_EXISTING ~AR0900.bcs~ ~override~
    DECOMPILE_AND_PATCH BEGIN
    REPLACE_TEXTUALLY ~\!Class(Player1,FIGHTER_MAGE_CLERIC)[ %TAB%%LNL%%MNL%%WNL%]+!Class(Player1,CLERIC_RANGER)~
    ~\1 %extend%~
    END
    BUT_ONLY

    EXTEND_BOTTOM BHARVAL 2
    IF ~Alignment(Player1,NEUTRAL) %extend%~ THEN DO ~OpenDoor("DOR0902b") EscapeAreaMove("AR0902",577,650,14)~ UNSOLVED_JOURNAL #3439 EXIT
    END
    Any ideas, @CamDawg ?

  • CamDawgCamDawg Member, Developer Posts: 3,394
    Dialogue code is separate from tp2 code. IOW, this bit:
    EXTEND_BOTTOM BHARVAL 2
    IF ~Alignment(Player1,NEUTRAL) %extend%~ THEN DO ~OpenDoor("DOR0902b") EscapeAreaMove("AR0902",577,650,14)~ UNSOLVED_JOURNAL #3439 EXIT
    END
    Needs to be put into a separate file and COMPILEd via your tp2/tpa.

    Raduziel
Sign In or Register to comment.