Qwinn
Edited by Qwinn, 28 May 2009 - 03:18 PM.
Posted 28 May 2009 - 01:28 PM
Edited by Qwinn, 28 May 2009 - 03:18 PM.
Posted 28 May 2009 - 02:48 PM
COPY_EXISTING ~AR0109.ARE~ ~override~ LAUNCH_PATCH_MACRO ~Q_ARE_InitVars~ LAUNCH_PATCH_MACRO ~Q_AREAdd_InitVars~ SET "Q_New_Actor" = 1 SET "Q_New_Trigg" = 2 SET "Q_New_Vertx" = 10 LAUNCH_PATCH_MACRO ~Q_AREAdd_Process~ [b][The includes that you're suggesting here][/b] BUT_ONLY_IF_IT_CHANGES
Edited by Qwinn, 28 May 2009 - 03:17 PM.
Posted 28 May 2009 - 03:03 PM
PATCH_FOR_EACH "S1" IN
~Actor~ ~Trigg~ ~Spawn~ ~Entra~ ~Conta~ ~Items~ ~Ambie~ ~Varia~ ~Doors~
~Tiled~ ~Vertx~ ~Explo~ ~Anima~ ~Songs~ ~RestS~
...runs 15 times. The first pass through the loop, %S1% equals ~Actor~. The second pass, %S1% equals ~Trigg~. The third time, %S1% equals ~Spawn~. In this way, I have the loop run once for each type of section that can be added to an area. First thing it does:
SET "Q_NewSect" = $Q_New("%S1%")
Edited by Qwinn, 28 May 2009 - 03:09 PM.
Posted 28 May 2009 - 03:12 PM
It is documented, sort of: "$variable(modifier list) ... is equivalent to saying ~variable_%modifier1%_%modifier2%_etc.~". I can use most of WeiDU's different array commands ($, DEFINE_ARRAY, and DEFINE_ASSOCIATIVE_ARRAY) separately, but it would be nice if there was more information available for how to combine them and see about using PHP_EACH with them, as I was testing something the other day and think the two DEFINE_ array commands end up spitting out something behind the scenes very much like the array construct.I said that $Q_New("%S1%") would resolve to $Q_NewActor.
Except, it doesn't. I actually set the new records I want to Q_New_Actor. The difference is that second underscore.
Where is that second underscore coming from? It must be getting automatically inserted by Weidu. Don't ask me how the hell I figured that out, it's been a long time. Either it's documented somewhere in the weidu readme and I forgot that, or I figured it out through lots of DEBUG statements.
Qwinn
Posted 28 May 2009 - 03:21 PM
Edited by Qwinn, 28 May 2009 - 03:27 PM.
Posted 28 May 2009 - 03:48 PM
Edited by Qwinn, 28 May 2009 - 03:57 PM.
Posted 28 May 2009 - 03:59 PM
Posted 28 May 2009 - 04:00 PM
Edited by Qwinn, 28 May 2009 - 04:01 PM.
Posted 28 May 2009 - 04:11 PM
COPY_EXISTING ~ARyourareaname.ARE~ ~override~ LAUNCH_PATCH_MACRO ~Q_ARE_InitVars~ LAUNCH_PATCH_MACRO ~Q_AREAdd_InitVars~
SET "Q_New_Actor" = 0 // Number of New Actors SET "Q_New_Trigg" = 0 // Number of New Triggers SET "Q_New_Spawn" = 0 // Number of New Spawn Points SET "Q_New_Entra" = 0 // Number of New Entrances SET "Q_New_Conta" = 0 // Number of New Containers SET "Q_New_Items" = 0 // Number of New Items SET "Q_New_Ambie" = 0 // Number of New Ambients SET "Q_New_Varia" = 0 // Number of New Variables SET "Q_New_Doors" = 0 // Number of New Doors SET "Q_New_Tiled" = 0 // Number of New Tiled Objects SET "Q_New_Vertx" = 0 // Number of New Vertexes SET "Q_New_Explo" = 0 // Number of New Explored Bitmap SET "Q_New_Anima" = 0 // Number of New Animations
SET "Q_New_Actor" = 1 // Number of New Actors SET "Q_New_Trigg" = 2 // Number of New Triggers SET "Q_New_Vertx" = 10 // Number of New Vertexes
LAUNCH_PATCH_MACRO ~Q_AREAdd_Process~
"Q_NewOffset_Actor" // Begin writing your new actors here. "Q_NewOffset_Trigg" // Begin writing your new triggers here. "Q_NewOffset_Spawn" // Etc. "Q_NewOffset_Entra" "Q_NewOffset_Conta" "Q_NewOffset_Items" "Q_NewOffset_Ambie" "Q_NewOffset_Varia" "Q_NewOffset_Doors" "Q_NewOffset_Tiled" "Q_NewOffset_Vertx" "Q_NewOffset_Explo" "Q_NewOffset_Anima"
BUT_ONLY_IF_IT_CHANGES
Edited by Qwinn, 28 May 2009 - 06:18 PM.
Posted 28 May 2009 - 05:13 PM
Does that mean that string1 becomes the value from the current string in the list OR that the current string in the list becomes the value of string1?will set the string1 variable to each value in string list and process each patch.
SET offset_of_actor_offset 0x54 //assign the offset to a variable because we need it later to do the patch for each SET offset_of_spawn_offset 0x60 //assign the offset to a variable because we need it later to do the patch for each etc... READ_LONG %offset_of_actor_offset% ~actor_offset~ //get the actual current/starting offset READ_LONG %offset_of_spawn_offset% ~spawn_offset~ //get the actual current/starting offset etc.. PATCH_FOR_EACH string1 IN ~actor~ ~spawn~ etc.. BEGIN SPRINT offset_of_offset ~offset_of_%string1%_offset~ //assign a generic variable with the combined value of text and string1 which equaled a previous defined offset SET new_offset = EVALUATE_BUFFER (%%string1%_offset%+%new_bytes%) //set the new offset using string1 and text to equal the starting offset + new bytes WRITE_LONG %offset_of_offset% %new_offset% //update the starting offset (see sprint above for definition) by new bytes ENDThat would update each offset by that amount of new_bytes which would be previously determined by whatever was being added. That sprint and evaluate_buffer thing was a trick showed to me I think by Mike1072 over at ppg in the weidu thread. He said I could otherwise do an array which is what you basically do. I understand this method arrays not so much...
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
Posted 28 May 2009 - 05:32 PM
Edited by Qwinn, 28 May 2009 - 06:18 PM.
Posted 28 May 2009 - 05:51 PM
I think it can be described asAs far as the patch for each...
Retired from modding.
Posted 28 May 2009 - 06:09 PM
Edited by Qwinn, 28 May 2009 - 06:12 PM.
Posted 28 May 2009 - 06:23 PM
I understand the simplicity of it. That's not the issue. I know that the macro would simplify a lot of the code. I didn't really understand why the offsets were always as variables and as such wasn't sure where things were going. I'm beginning to understand what you've done as far as putting the initial offset values that would eventually need to be updated into variable names. It helps with the update process that you've developed for an insert of multiple sections. I just had to get my hands dirty and try to do what you were doing to see why you were doing what you were doing. Does that make sense?Look, in this post, I'll make the purpose and use of these macros really REALLY simple. As simple as can be.
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
Posted 28 May 2009 - 06:50 PM
Posted 28 May 2009 - 08:05 PM
Edited by Qwinn, 28 May 2009 - 08:08 PM.
Posted 30 May 2009 - 05:54 AM
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm
Posted 30 May 2009 - 06:16 AM
Edited by Qwinn, 30 May 2009 - 06:17 AM.
Posted 30 May 2009 - 05:51 PM
Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle
Posted 30 May 2009 - 07:21 PM
Ha! ROTFLPS: Your goal, plainab, should you choose to accept this mission, will be to accomplish the task with as little code as possible .
DEFINE_ACTION_FUNCTION ~install_fixpack_for_bg~ BEGIN //put everything decided to be a FIX from the fixpack here END
BEGIN ~Install BG Core Fixes~ INCLUDE ~bg_fixpack\tph\fixpack.tph~ LAUNCH_ACTION_FUNCTION ~install_fixpack_for_bg~That will make the header longer than the mod. Short enough for you....
My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm