Topaz
Member Since 18 Dec 2002Offline Last Active Apr 18 2005 03:31 AM
Community Stats
- Group Member
- Active Posts 24
- Profile Views 1699
- Age 42 years old
- Birthday January 14, 1982
-
Gender
Not Telling
User Tools
Posts I've Made
In Topic: The Modder's Friend
28 October 2004 - 05:48 AM
So your weekly mod workflow encompasses around 700 MB?? congratulations...
In Topic: ADD_KNOWN_SPELL
28 October 2004 - 05:03 AM
What do I have today: lots of questions and a weidu error! Some piece of my code can't be patched in. Syntax errors are all out, though... To be honest I don't understand the error message.
Here is my code so far, intermingled with questions...
I want a REGEXP starting with an _ , to patch only Tutu content. I tried _.*\.cre, but WeiDU interpretes this as a real name, not a regexp. Can I use underscores?
Also, every time you use "%someVariable%" does it use the same value you read using READ_ or does it "auto-update"? (Prolly a very stupid question:))
Is it possible to use symbolic addresses, and variables instead of constants?
This works: WRITE_SHORT ("%memorizationOffset%" + 0x72 /*+ n*0x10*/) 5
But does this?: WRITE_SHORT ("%memorizationOffset%" + 0x72 /*+ n*0x10*/) "%#spellLvl1%"
Also, I tried to combine all this code in a while loop:
Now it is necessary that with each increment of n,
the accessed variable "%#spellLvl(n+1)%" changes, otherwise the number of lvl 1 spells would be set for all levels. Is this possible?
Okay, this is the end of the code you just waded trough. But one more (pretty important) question, please. As you might have noticed, the fill in names block will always fill in spwi112. That's not what I want to do... How do I access a set of strings that get patched in here? Maybe I sound unclear (I get that a lot), because I don't know enough about tp2's, but at this time I see it could be solved by making a set of strings, containing all spells, needed, and let the tp2 code jump from spell to spell... This smells like a 2da file a lot. Is it possible to make a dummy 2da file that WeiDU reads?
That's exactly wahat I'm gonna do... but the teardown approach is a bit drastic since strings are pretty easy to overwrite.
Something I still don't get however (and this may sound stupid ) is this:
This might take a while. Copying 1 file(s) ... ERROR: [AERBOD01.CRE] -> [override/AERBOD01.CRE] Patching Failed (COPY) (Invalid_argument("String.sub")) ERROR Installing [Updated and Tougher Mages for BGTutu], rolling back to previous state Will uninstall 93 files for [TUTUMAGES_SETUP.TP2] component 0. Uninstalled 93 files for [TUTUMAGES_SETUP.TP2] component 0. ERROR: Invalid_argument("String.sub") PLEASE email the file TUTUMAGES_SETUP.DEBUG to gravity665@hotmail.com
Here is my code so far, intermingled with questions...
/////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // Edit Spellbooks /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// PRINT ~This might take a while.~ COPY_EXISTING_REGEXP ~.*\.cre~ ~override~ READ_BYTE 0x234 "level" //problem with dual/multiclassed:what is level1/level2? READ_BYTE 0x273 "class" READ_LONG 0x2a0 "knownSpellsOffset" READ_LONG 0x2a8 "memorizationOffset" READ_LONG 0x2b0 "memorizedSpellsOffset" READ_LONG 0x2b4 "numMemorizedSpells" READ_LONG 0x244 "kit" READ_LONG 0x2c4 "EffectsOffset" READ_LONG 0x2bc "itemsOffset" READ_LONG 0x2b8 "itemSlotOffset"
I want a REGEXP starting with an _ , to patch only Tutu content. I tried _.*\.cre, but WeiDU interpretes this as a real name, not a regexp. Can I use underscores?
Also, every time you use "%someVariable%" does it use the same value you read using READ_ or does it "auto-update"? (Prolly a very stupid question:))
/////////////////////////////////////////////////////////////////////// // ADD_KNOWN_SPELL /////////////////////////////////////////////////////////////////////// //Still not sure whether to use or not; If I use it, it //should probably be synchronous with the memorized spells blocks /////////////////////////////////////////////////////////////////////// //ADD_KNOWN_SPELL ~SPWI112~ #0 ~wizard~ /////////////////////////////////////////////////////////////////////// // Spell level memorization /////////////////////////////////////////////////////////////////////// // This reads how many levels the mage has and sets a variable for every spell level /////////////////////////////////////////////////////////////////////// SET "readLevel"=0 WHILE (("%level%"=1) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 1 SET "#spellLvl2" = 0 SET "#spellLvl3" = 0 SET "#spellLvl4" = 0 //just to be sure SET "#spellLvl5" = 0 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=2) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 2 SET "#spellLvl2" = 0 SET "#spellLvl3" = 0 SET "#spellLvl4" = 0 SET "#spellLvl5" = 0 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=3) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 2 SET "#spellLvl2" = 1 SET "#spellLvl3" = 0 SET "#spellLvl4" = 0 SET "#spellLvl5" = 0 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=4) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 3 SET "#spellLvl2" = 2 SET "#spellLvl3" = 0 SET "#spellLvl4" = 0 SET "#spellLvl5" = 0 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=5) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 4 SET "#spellLvl2" = 2 SET "#spellLvl3" = 1 SET "#spellLvl4" = 0 SET "#spellLvl5" = 0 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=6) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 4 SET "#spellLvl2" = 2 SET "#spellLvl3" = 2 SET "#spellLvl4" = 0 SET "#spellLvl5" = 0 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=7) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 4 SET "#spellLvl2" = 3 SET "#spellLvl3" = 2 SET "#spellLvl4" = 1 SET "#spellLvl5" = 0 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=8) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 4 SET "#spellLvl2" = 3 SET "#spellLvl3" = 3 SET "#spellLvl4" = 2 SET "#spellLvl5" = 0 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=9) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 4 SET "#spellLvl2" = 3 SET "#spellLvl3" = 3 SET "#spellLvl4" = 2 SET "#spellLvl5" = 1 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=10) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 4 SET "#spellLvl2" = 4 SET "#spellLvl3" = 3 SET "#spellLvl4" = 2 SET "#spellLvl5" = 2 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=11) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 4 SET "#spellLvl2" = 4 SET "#spellLvl3" = 4 SET "#spellLvl4" = 3 SET "#spellLvl5" = 3 SET "#spellLvl6" = 0 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=12) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 4 SET "#spellLvl2" = 4 SET "#spellLvl3" = 4 SET "#spellLvl4" = 4 SET "#spellLvl5" = 4 SET "#spellLvl6" = 1 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=13) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 5 SET "#spellLvl2" = 5 SET "#spellLvl3" = 5 SET "#spellLvl4" = 4 SET "#spellLvl5" = 4 SET "#spellLvl6" = 2 SET "#spellLvl7" = 0 SET "readLevel"=1 END WHILE (("%level%"=14) AND ("%readLevel%"=0)) BEGIN SET "#spellLvl1" = 5 SET "#spellLvl2" = 5 SET "#spellLvl3" = 5 SET "#spellLvl4" = 4 SET "#spellLvl5" = 4 SET "#spellLvl6" = 2 SET "#spellLvl7" = 1 SET "readLevel"=1 END //for specialist mages: increase numspells/lvl with 1 SET "readKit"=0 WHILE ((("%kit%"=64) OR ("%kit%"=128) OR ("%kit%"=256) OR ("%kit%"=512) OR ("%kit%"=1024) OR ("%kit%"=2048) OR ("%kit%"=4096) OR ("%kit%"=8192)) AND ("%readKit%"=0)) BEGIN SET "#spellLvl1" = ("%#spellLvl1%" +1) SET "#spellLvl2" = ("%#spellLvl2%" +1) SET "#spellLvl3" = ("%#spellLvl3%" +1) SET "#spellLvl4" = ("%#spellLvl4%" +1) SET "#spellLvl5" = ("%#spellLvl5%" +1) SET "#spellLvl6" = ("%#spellLvl6%" +1) SET "#spellLvl7" = ("%#spellLvl7%" +1) SET "readKit"=1 /*************************************************************************** *Patch #spells memorizable, #spells memorizable? and Memorized spell count. All 3 should be the same. *If you want to check out Memorized spell count in NI, look at the offset to which Memorized Spells Offset (2b0) points, *and add 12 (0xC) to it. Logically, this value should be equal to the #spells memorizable field. *Mostly it is not, even in BGII. The #spells memorizable field is mostly incorrect. ***************************************************************************/ //SET "n" = 0 //WHILE ("%n%" < 8) WRITE_SHORT ("%memorizationOffset%" + 0x72 /*+ n*0x10*/) "%#spellLvl1%" WRITE_SHORT ("%memorizationOffset%" + 0x74) "%#spellLvl1%" WRITE_SHORT ("%memorizationOffset%" + 0x7C) "%#spellLvl1%" WRITE_SHORT ("%memorizationOffset%" + 0x72 + 0x10) "%#spellLvl2%" WRITE_SHORT ("%memorizationOffset%" + 0x74 + 0x10) "%#spellLvl2%" WRITE_SHORT ("%memorizationOffset%" + 0x7C + 0x10) "%#spellLvl2%" WRITE_SHORT ("%memorizationOffset%" + 0x72 + 0x20) "%#spellLvl3%" WRITE_SHORT ("%memorizationOffset%" + 0x74 + 0x20) "%#spellLvl3%" WRITE_SHORT ("%memorizationOffset%" + 0x7C + 0x20) "%#spellLvl3%" WRITE_SHORT ("%memorizationOffset%" + 0x72 + 0x30) "%#spellLvl4%" WRITE_SHORT ("%memorizationOffset%" + 0x74 + 0x30) "%#spellLvl4%" WRITE_SHORT ("%memorizationOffset%" + 0x7C + 0x30) "%#spellLvl4%" WRITE_SHORT ("%memorizationOffset%" + 0x72 + 0x40) "%#spellLvl5%" WRITE_SHORT ("%memorizationOffset%" + 0x74 + 0x40) "%#spellLvl5%" WRITE_SHORT ("%memorizationOffset%" + 0x7C + 0x40) "%#spellLvl5%" WRITE_SHORT ("%memorizationOffset%" + 0x72 + 0x50) "%#spellLvl6%" WRITE_SHORT ("%memorizationOffset%" + 0x74 + 0x50) "%#spellLvl6%" WRITE_SHORT ("%memorizationOffset%" + 0x7C + 0x50) "%#spellLvl6%" WRITE_SHORT ("%memorizationOffset%" + 0x72 + 0x60) "%#spellLvl7%" WRITE_SHORT ("%memorizationOffset%" + 0x74 + 0x60) "%#spellLvl7%" WRITE_SHORT ("%memorizationOffset%" + 0x7C + 0x60) "%#spellLvl7%"
Is it possible to use symbolic addresses, and variables instead of constants?
This works: WRITE_SHORT ("%memorizationOffset%" + 0x72 /*+ n*0x10*/) 5
But does this?: WRITE_SHORT ("%memorizationOffset%" + 0x72 /*+ n*0x10*/) "%#spellLvl1%"
Also, I tried to combine all this code in a while loop:
SET "n" = 0 WHILE ("%n%" < 8) WRITE_SHORT ("%memorizationOffset%" + 0x72 + "%n%"*0x10) "%#spellLvl1%" WRITE_SHORT ("%memorizationOffset%" + 0x74 + "%n%"*0x10) "%#spellLvl1%" WRITE_SHORT ("%memorizationOffset%" + 0x7C + "%n%"*0x10) "%#spellLvl1%" SET "n" = "%n%" + 1
Now it is necessary that with each increment of n,
the accessed variable "%#spellLvl(n+1)%" changes, otherwise the number of lvl 1 spells would be set for all levels. Is this possible?
/////////////////////////////////////////////////////////////////////// // Memorized Spells: reserve spaces /////////////////////////////////////////////////////////////////////// // based on total number of spells /////////////////////////////////////////////////////////////////////// SET "totalNumMemorizedSpells" = ("%#spellLvl1%" + "%#spellLvl2%" + "%#spellLvl3%" + "%#spellLvl4%" + "%#spellLvl5%" + "%#spellLvl6%" + "%#spellLvl7%") WHILE ("%numMemorizedSpells%" <= "%totalNumMemorizedSpells%") BEGIN WRITE_LONG 0x2c4 ("%EffectsOffset%" + 0x6) WRITE_LONG 0x2bc ("%itemsOffset%" + 0x6) WRITE_LONG 0x2b8 ("%itemSlotOffset%" + 0x6) INSERT_BYTES ("%memorizedSpellsOffset%" + ("%numMemorizedSpells%" *0x6)) 0x06 WRITE_LONG 0x2b4 ("%numMemorizedSpells%" + 1) END WHILE("%numMemorizedSpells%" > "%totalNumMemorizedSpells%") //if there are more spells memorized than is allowed by the rules BEGIN WRITE_LONG 0x2c4 ("%EffectsOffset%" - 0x6) WRITE_LONG 0x2bc ("%itemsOffset%" - 0x6) WRITE_LONG 0x2b8 ("%itemSlotOffset%" - 0x6) DELETE_BYTES ("%memorizedSpellsOffset%" + ("%numMemorizedSpells%" *0x6)) 0x06 WRITE_LONG 0x2b4 ("%numMemorizedSpells%" - 1) END /////////////////////////////////////////////////////////////////////// // Memorized Spells: fill in names /////////////////////////////////////////////////////////////////////// // based on number of spells per level // I replace spells. Without STRING_COMPARE. The "choosing algoritm" makes choices and ///fills in. /////////////////////////////////////////////////////////////////////// SET "n1" = 0 WHILE("%n1%" <= "%#spellLvl1%"-1) BEGIN WRITE_ASCII ("%memorizedSpellsOffset%" + "%n1%" * 0x6) ~spwi112~ SET "n1" = "%n1%"+1 END IF_EVAL (("%class%" = 1) OR ("%class%" = 13) OR ("%class%" = 14) OR ("%class%" = 206) OR ("%class%" = 7) OR ("%class%" = 17) OR ("%class%" = 10)) //truclass,m/t,m/c,bard_all,f/m,f/m/c,f/m/t
Okay, this is the end of the code you just waded trough. But one more (pretty important) question, please. As you might have noticed, the fill in names block will always fill in spwi112. That's not what I want to do... How do I access a set of strings that get patched in here? Maybe I sound unclear (I get that a lot), because I don't know enough about tp2's, but at this time I see it could be solved by making a set of strings, containing all spells, needed, and let the tp2 code jump from spell to spell... This smells like a 2da file a lot. Is it possible to make a dummy 2da file that WeiDU reads?
Unless you're going to give them more or less spells than they had previously, I would forego the teardown/rebuild approach, though that's a personal preference.
That's exactly wahat I'm gonna do... but the teardown approach is a bit drastic since strings are pretty easy to overwrite.
Something I still don't get however (and this may sound stupid ) is this:
Why do you want to delete Barkskin if you have just replaced it with Aid? I mean, ther is *no* spell called Barkskin anymore./* Now we start a new main WHILE loop to delete spells...*/
In Topic: ADD_KNOWN_SPELL
24 October 2004 - 05:17 PM
I took a good look at your code, Cam, and although it gives me a lot of ideas how to bring things in practice, it substitutes spells, and pretty intricately btw. I really can't say which piece of code is responsible for spell substition based on the sphere. As you probably realize, I want to substitute and add spells if necessary.
In your tp2, I noticed you use WHILEs much as you would use an IF:
WHILE ((("%class%" = 3) OR ... AND (0 < "%ms_num%")). Won't this cause an infinite loop because those conditions will always be true?
Is ADD_KNOWN_SPELL strictly needed? Will setting unknown spells as memorized crash the game?
Could this pseudocode outline work?:
Once I have theze bytes inserted make spell choices...somewhat random:
WRITE_ASCII both "adding" and replacing spells.
In your tp2, I noticed you use WHILEs much as you would use an IF:
WHILE ((("%class%" = 3) OR ... AND (0 < "%ms_num%")). Won't this cause an infinite loop because those conditions will always be true?
Is ADD_KNOWN_SPELL strictly needed? Will setting unknown spells as memorized crash the game?
Could this pseudocode outline work?:
SET "#spellsLvl2"=n //there are n 2nd level spells; n is set only once per level; look at 1st post to see where n would be set. SET "counter"=1 WHILE ("%counter%" =< "%#spellsLvl2%") // i want n level 2 spells added ItemslotOffset=ItemslotOffset+'sizeofspell'; ItemsOffset=ItemsOffset+'sizeofspell'; numMemorizedSpells=numMemorizedSpells+1; INSERT_BYTES ("%memorizedSpellsOffset%" + "%numMemorizedSpells%" * 'sizeofspell') 'sizeofspell'; "%counter%"++;
Once I have theze bytes inserted make spell choices...somewhat random:
WRITE_ASCII both "adding" and replacing spells.
In Topic: About the Weave...
29 September 2004 - 02:24 AM
I never heard anything about the Shadow Weave: Has it got something to do with the failed kidnapping of Elminster by dreadmasters of Shar in the novel 'The Temptation of Elminster'? If I remember correctly, Shar appoints her minions to catch E because of her will to control the Weave (the real one)... and the story takes place around 800 DR, but is she controlling the 'Shadow Weave' already at that time? Pffft...and why the hell would you want TWO weaves!?
In Topic: Need someone to proofread script
16 September 2004 - 08:38 AM
Thanks for your responses. Maybe I was a bit unclear. I ran the script trough weidu and NI so compiling isn't the problem. It enhances the enemy mages, not party members. Good to know 2000 lines is peanuts .
The script runs fine in game, but there are some problems with
*RandomNums which always seem to trigger
*mages who talk right away after you see them (EDIT: when meeting them right away after entering) : they wait too long before casting (I solved that somewhat by changing _initdlg.bcs, but they are still somewhat slower, I think). I think it happens because the spell memorization is done with globals (as for every level and kit of a mage).
*guys who don't cast once every round but like once every 1.5 rounds. I have lowered the castnattack timer to 4, but I guess that's not really necessary
* and things that'll pop up later, I'm sure
Erm... actually you don't need Tutu to check it out, but as I wrote this, I always had to see the effect in-game. Probably that counts for you too.
Come on, if I can write a script, YOU certainly can proofread it.
EDIT: I'll just add the weidumod to speed things up... the script is named tutumages.baf.
The script runs fine in game, but there are some problems with
*RandomNums which always seem to trigger
*mages who talk right away after you see them (EDIT: when meeting them right away after entering) : they wait too long before casting (I solved that somewhat by changing _initdlg.bcs, but they are still somewhat slower, I think). I think it happens because the spell memorization is done with globals (as for every level and kit of a mage).
*guys who don't cast once every round but like once every 1.5 rounds. I have lowered the castnattack timer to 4, but I guess that's not really necessary
* and things that'll pop up later, I'm sure
Erm... actually you don't need Tutu to check it out, but as I wrote this, I always had to see the effect in-game. Probably that counts for you too.
Come on, if I can write a script, YOU certainly can proofread it.
EDIT: I'll just add the weidumod to speed things up... the script is named tutumages.baf.
- Spellhold Studios
- → Viewing Profile: Posts: Topaz
- Guidelines