Jump to content

Recommended Posts

One fun thing about RP that BG2 blows completely out of the water is equipment choice, level, and relative wealth. Well, OK, so there are many areas where it differs from a P&P AD&D game, but there are lots of mods out there to fix some of this... but for Aran, let's give the players some choice.

 

From a RP perspective, it is silly for a L7 fighter to not have a decent magical weapon, good armor, and perhaps even some supplies. I have never been a mercenary, but I would assume that they are like musicians in one respect - a horn player will eat nothing but crackers for days/weeks/months/years before giving up his horn. After all, how are you going to work your way out of debt if you have a garbage old beat-up single Conn, and everyone else is showing up with pro equipment, well maintained and well rehearsed in its strengths and weaknesses in relation to your playing style? And that is not a matter of life and death, like a good shield or sword might be. So we can mess about with helping Aran have gear. We can even let players decide:

  • Is Aran down-and-out poor, having sold off his best gear?
  • Is Aran treasure-poor but equipped with decent L7 equipment?
  • Is Aran equipped with the best equipment possible, because I am going to dual-class him and take his gear so I can be L33T and overpowered, at least up until I run into the first SCSII-enhanced gibberling?

 

Heck, we can take that one step farther. We can set up those four choices of stats with appropriate proficiencies, and give players choice over what gear he has. That could be modified by what RP option was chosen about his relative equipment wealth; if he is poor and down-and-out, he might have a regular mundane long sword, but if he is average that will be a +1 long sword, and if he has been successful he may be starving but he won't stop gripping the pommel of that +2 long sword until he is forced to.

 

OK, lots of fun - lots of choice; that brings up two additional considerations.

 

Q. Why not give the player full choice of everything?

A. I've watched Nythrun, and I'm no Nythrun. Between eric, miloch, and Nythrun, Level1NPCs will eventually allow people to completely respec Aran any way they want. I'm counting on that - why else would I be adding dialog options that check to see if Aran is CLERIC_ALL, or MAGE_ALL, or KIT:HEARTWARDER_OF_SUNE and such?

Plus, there is a defining of character that can take place. If Aran is setting up to Dual to Cleric, my take is that he would be messing around with many different cleric-able weapons, but not specializing in any of them. After all, his primary start is sword and board, and he is not driven to excel in one specific focused area. Aran as a Kensai? Have you heard him talk? The level of precision and self-control necessary for Bushido does not seem likely to be something Aran would be able to handle.

So from a RP standpoint, keeping within character, I can set up some baselines that fit his personality, confident that eventually folks will get to L1NPC him into that magical Kensai->Mage dual class for their power-gaming run.

 

Q. What about the confusing raft of choices? I just want to play - worse, I have a BWP install, and I don't understand all the custom install templates. Why can't I just install him and be done with it?

A. Good point. BWP has solved user input at install through scripting, but it can be a huge job to understand what is going on. So, a 'default' configuration needs to be available, so the user does not have to make tons of choices if they don't want to.

 

OK, so on to implementing this mess of choices.

 

MARCO-ME (ok, ok, pun intended. Macrame. Feeble humor, but that's what I got.)

 

Before we get started on implementing this, though, let's mess around with a fancy thing called DEFINE_PATCH_MACRO.

 

Say I have 4 or 5 .cres (or even more) that have the same stuff done to them, with very minor variations. The regular way is to declare everything out front - 5, or 6 variations on

 

CODE

/* Area C-AW01 Entry Point - Bouncer on Promenade */

COPY_EXISTING ~kpgrd01.cre~ ~override/c-aw01ep.cre~

SAY NAME1 ~Manson~

SAY NAME2 ~Manson~

REMOVE_CRE_ITEM ~rndtre02~

WRITE_LONG INITIAL_MEETING (BNOT 0x0)

WRITE_LONG DIALOGUE_HOSTILE (BNOT 0x0)

WRITE_LONG MORALE (BNOT 0x0)

WRITE_LONG HAPPY (BNOT 0x0)

WRITE_LONG UNHAPPY_ANNOYED (BNOT 0x0)

WRITE_LONG UNHAPPY_SERIOUS (BNOT 0x0)

WRITE_LONG UNHAPPY_BREAKING (BNOT 0x0)

WRITE_LONG LEADER (BNOT 0x0)

WRITE_LONG TIRED (BNOT 0x0)

WRITE_LONG BORED (BNOT 0x0)

WRITE_LONG BATTLE_CRY1 (BNOT 0x0)

WRITE_LONG BATTLE_CRY2 (BNOT 0x0)

WRITE_LONG BATTLE_CRY3 (BNOT 0x0)

WRITE_LONG BATTLE_CRY4 (BNOT 0x0)

WRITE_LONG BATTLE_CRY5 (BNOT 0x0)

WRITE_LONG HURT (BNOT 0x0)

WRITE_LONG AREA_FOREST (BNOT 0x0)

WRITE_LONG AREA_CITY (BNOT 0x0)

WRITE_LONG AREA_DUNGEON (BNOT 0x0)

WRITE_LONG AREA_DAY (BNOT 0x0)

WRITE_LONG AREA_NIGHT (BNOT 0x0)

WRITE_LONG SELECT_COMMON1 (BNOT 0x0)

WRITE_LONG SELECT_COMMON2 (BNOT 0x0)

WRITE_LONG SELECT_COMMON3 (BNOT 0x0)

WRITE_LONG SELECT_COMMON4 (BNOT 0x0)

WRITE_LONG SELECT_COMMON5 (BNOT 0x0)

WRITE_LONG SELECT_COMMON6 (BNOT 0x0)

WRITE_LONG SELECT_ACTION1 (BNOT 0x0)

WRITE_LONG SELECT_ACTION2 (BNOT 0x0)

WRITE_LONG SELECT_ACTION3 (BNOT 0x0)

WRITE_LONG SELECT_ACTION4 (BNOT 0x0)

WRITE_LONG SELECT_ACTION5 (BNOT 0x0)

WRITE_LONG SELECT_ACTION6 (BNOT 0x0)

WRITE_LONG SELECT_ACTION7 (BNOT 0x0)

WRITE_LONG SELECT_RARE1 (BNOT 0x0)

WRITE_LONG SELECT_RARE2 (BNOT 0x0)

WRITE_LONG CRITICAL_HIT (BNOT 0x0)

WRITE_LONG CRITICAL_MISS (BNOT 0x0)

WRITE_LONG TARGET_IMMUNE (BNOT 0x0)

WRITE_LONG INVENTORY_FULL (BNOT 0x0)

WRITE_LONG PICKED_POCKET (BNOT 0x0)

WRITE_LONG HIDDEN_IN_SHADOWS (BNOT 0x0)

WRITE_LONG SPELL_DISRUPTED (BNOT 0x0)

WRITE_LONG SET_A_TRAP (BNOT 0x0)

WRITE_LONG BIO (BNOT 0x0)

WRITE_EVALUATED_ASCII 0x34 ~%DEST_RES%~ #8 /* small portrait */

WRITE_ASCII 0x248 ~None~ #8 /* override AI script */

WRITE_ASCII 0x250 ~None~ #8 /* disable class AI script */

WRITE_ASCII 0x258 ~None~ #8 /* disable race AI script */

WRITE_ASCII 0x260 ~None~ #8 /* disable general AI script */

WRITE_ASCII 0x268 ~None~ #8 /* disable default AI script */

WRITE_EVALUATED_ASCII 0x2cc ~%DEST_RES%~ #8 /* dialogue */

WRITE_EVALUATED_ASCII 0x280 ~%DEST_RES%~ #32 /* death variable */

 

 

But what if I could work this out with just one line, instead of everything? I can...

CODE

COPY_EXISTING ~kpgrd01.cre~ ~override/c-aw01ep.cre~ /* Area C-AW01 Entry Point - Bouncer on Promenade */

SAY NAME1 ~Manson~

SAY NAME2 ~Manson~

REMOVE_CRE_ITEM ~rndtre02~

LAUNCH_PATCH_MACRO ~support_cre_cleanup~

 

 

... if I set up what I want to happen in a macro, like this...

CODE

DEFINE_PATCH_MACRO ~support_cre_cleanup~ BEGIN

WRITE_LONG INITIAL_MEETING (BNOT 0x0)

WRITE_LONG DIALOGUE_HOSTILE (BNOT 0x0)

WRITE_LONG MORALE (BNOT 0x0)

WRITE_LONG HAPPY (BNOT 0x0)

WRITE_LONG UNHAPPY_ANNOYED (BNOT 0x0)

WRITE_LONG UNHAPPY_SERIOUS (BNOT 0x0)

WRITE_LONG UNHAPPY_BREAKING (BNOT 0x0)

WRITE_LONG LEADER (BNOT 0x0)

WRITE_LONG TIRED (BNOT 0x0)

WRITE_LONG BORED (BNOT 0x0)

WRITE_LONG BATTLE_CRY1 (BNOT 0x0)

WRITE_LONG BATTLE_CRY2 (BNOT 0x0)

WRITE_LONG BATTLE_CRY3 (BNOT 0x0)

WRITE_LONG BATTLE_CRY4 (BNOT 0x0)

WRITE_LONG BATTLE_CRY5 (BNOT 0x0)

WRITE_LONG HURT (BNOT 0x0)

WRITE_LONG AREA_FOREST (BNOT 0x0)

WRITE_LONG AREA_CITY (BNOT 0x0)

WRITE_LONG AREA_DUNGEON (BNOT 0x0)

WRITE_LONG AREA_DAY (BNOT 0x0)

WRITE_LONG AREA_NIGHT (BNOT 0x0)

WRITE_LONG SELECT_COMMON1 (BNOT 0x0)

WRITE_LONG SELECT_COMMON2 (BNOT 0x0)

WRITE_LONG SELECT_COMMON3 (BNOT 0x0)

WRITE_LONG SELECT_COMMON4 (BNOT 0x0)

WRITE_LONG SELECT_COMMON5 (BNOT 0x0)

WRITE_LONG SELECT_COMMON6 (BNOT 0x0)

WRITE_LONG SELECT_ACTION1 (BNOT 0x0)

WRITE_LONG SELECT_ACTION2 (BNOT 0x0)

WRITE_LONG SELECT_ACTION3 (BNOT 0x0)

WRITE_LONG SELECT_ACTION4 (BNOT 0x0)

WRITE_LONG SELECT_ACTION5 (BNOT 0x0)

WRITE_LONG SELECT_ACTION6 (BNOT 0x0)

WRITE_LONG SELECT_ACTION7 (BNOT 0x0)

WRITE_LONG SELECT_RARE1 (BNOT 0x0)

WRITE_LONG SELECT_RARE2 (BNOT 0x0)

WRITE_LONG CRITICAL_HIT (BNOT 0x0)

WRITE_LONG CRITICAL_MISS (BNOT 0x0)

WRITE_LONG TARGET_IMMUNE (BNOT 0x0)

WRITE_LONG INVENTORY_FULL (BNOT 0x0)

WRITE_LONG PICKED_POCKET (BNOT 0x0)

WRITE_LONG HIDDEN_IN_SHADOWS (BNOT 0x0)

WRITE_LONG SPELL_DISRUPTED (BNOT 0x0)

WRITE_LONG SET_A_TRAP (BNOT 0x0)

WRITE_LONG BIO (BNOT 0x0)

WRITE_EVALUATED_ASCII 0x34 ~%DEST_RES%~ #8 /* small portrait */

WRITE_ASCII 0x248 ~None~ #8 /* override AI script */

WRITE_ASCII 0x250 ~None~ #8 /* disable class AI script */

WRITE_ASCII 0x258 ~None~ #8 /* disable race AI script */

WRITE_ASCII 0x260 ~None~ #8 /* disable general AI script */

WRITE_ASCII 0x268 ~None~ #8 /* disable default AI script */

WRITE_EVALUATED_ASCII 0x2cc ~%DEST_RES%~ #8 /* dialogue */

WRITE_EVALUATED_ASCII 0x280 ~%DEST_RES%~ #32 /* death variable */

END

 

Easy, huh? With this predefined snippet of code I can slap most of the .cre silent, set the portrait and dialog and dv and anything else I want to the name of the .cre, disabled the scripts I don't want - everything in one swoop.

 

DEFINE_PATCH_MACRO basically says "here is a list of things I want to do within a patching operation". Putting it at the top of your mod or component means later on, instead of writing it all out or copying and pasting blocks, you can refer to it buy using LAUNCH_PATCH_MACRO.

 

Now, how can we leverage this a bit more, to make life easier? We have to come up with a way to set some of the choices above to "variables", so we can... duh... vary them. We actually already have, because we have leveraged the bigg's WeiDU variables, %DEST_RES%, which equals the name of the resource being worked on by the code at the moment (See Mike1072's post below for a clearer explanation of this).

 

Let's play with this idea for Aran. First off, we want 4 basic choices, as we have said before - Tinker, Tailor, Soldier, Spy (Dual-Classable stats for Ftr->Mage, Ftr->Cleric, Fighter, Ftr->Thief). We would also like to be able to choose some basic equipment and armor, and perhaps roleplay the level of gear he has. We also need a "yeah, whatever - stop messing about and just install the damned NPC and let's get on with it" option.

 

But we can make it much more far-reaching than that. We can let the user choose some of the input.

Link to comment

In the interests of simplicity, and keeping my rapidly thinning hair from leaving my head completely, if a player wants the full rebuild they should use Level 1 NPCs. To make my life easier, I am choosing the proficiencies he would have as a fighter; Jack-Of-All-Trades (JOAT) but Master of None. So each .cre will have pre-built 'ranges' of equipment you can choose, with the idea that if a dude has been thinking about that whole Mage thing, he probably has thought ahead and practiced with weapons that allow spellcasting. He may be fighting in his day job with a sword and shield, but if he wants to become a Cleric (and he doesn't have ME2 Element 0 built up, or access to Ashes of Embers) he has probably been practicing with a blunt weapon. Here comes a .tp2 macro that can help out with this, allowing players to choose three things - quality of starting equipment, some choice of type of equipment, and choice of armor.

 

Step one is to make sure that we have FORCED_SUBCOMPONENT stuff working, as we covered in other threads. We set up 5 components, one of which *has* to be installed, and all of which only install if the main component is there. Even more importantly, all of which pull out if the main component is uninstalled, so a "one click uninstall" is possible. Pet peeve of mine. When I say "uninstall", I mean "get the hell off my install so I can reinstall - and stop asking me if I want to uninstall each blasted component individually (grrrrrr....)".

 

Review -

BEGIN = "start the component - ask the player if they want to install all the stuff in this section".

FORCED_SUBCOMPONENT = "This is not really a component - it is one of several mutually exclusive subcomponents. It is FORCED because we don't want the player to skip it or not choose - it would hose their game if they did."

REQUIRE_COMPONENT = "if the weidu log says that the component we are asking about is installed, go ahead - if it doesn't, then either uninstall (technically, in this case "uninstall" actually means "don't reinstall", but that is another whole topic about how weidu works and why Weimer and the bigg deserve 10,00 virgins in the afterlife, or better yet a handful of experienced cuties very much enamoured of them) or skip asking about installing this".

 

BEGIN  ~Aran Whitehand, "No Choices Wanted" (Fighter)~
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~

BEGIN  ~Aran Whitehand, Mage Dual-Class stats configuration (Tinker)~  // name the subcomponent 
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  // require one of this set of subcomponents to be chosen - defines "master set"
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~ // checks to see if the mod is installed, so components will "pull out" completely if uninstalled

BEGIN  ~Aran Whitehand, Cleric Dual-Class stats configuration (Tailor)~ 
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~

BEGIN  ~Aran Whitehand, Fighter stats configuration (Soldier)~ 
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~

BEGIN  ~Aran Whitehand, Thief Dual-Class stats configuration (Spy)~
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~

OK, now let's see what we can do about choices. How this works:

  1. Begin with 4 separate .cre built with appropriate stats, legally created as a L7 fighter, with proficiencies that make sense for his base .cre.
    example: Set up for Dual to Mage means he has explored a weapon that is usable by mages. He has to have shield and long sword because of his characterization.
  2. Pre-set some basic player choices via ACTION_READLN during the installation of each possible .cre
  3. Copy the chosen base .cre into the game renaming it and patching it with player choices.

BEGIN  ~Aran Whitehand, "No Choices Wanted" (Fighter)~
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~
/* Set up the variables for a default .cre so BWP folks don't have to deal with READLN */
OUTER_SET ~aran_wealth~ = 2 // experienced mercenary  with some resources	
OUTER_SET ~aran_weapon_set~ = 1 // default: Long Sword, Shield, Dagger
OUTER_SET ~aran_armor_choice~ = 4 // splint 	
/* Patch the .cre */
COPY ~testarea/c-arnftr.cre~ ~override/c-aran7.cre~
	  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN
				  LAUNCH_PATCH_MACRO ~aran_cre_setup~
	  END
BUT_ONLY_IF_IT_CHANGES

 

This first component shortcuts us to the end - the "cliff notes" version. Over this process, we end up with three variables set by the user. Then we copy the .cre and run a macro that uses these choices to fill in the "blanks" in the .cre. If that didn't make sense, don't worry - we play about with it farther down this thread.

 

The other subcomponents add player choice:

 

BEGIN  ~Aran Whitehand, Mage Dual-Class stats configuration (Tinker)~  // name the subcomponent 
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  // require one of this set of subcomponents to be chosen - defines "master set"
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~ // checks to see if the mod is installed, so components will "pull out" completely if uninstalled
/* choose wealth level */  
PRINT ~Please choose from the following choices to modify starting armor and weapons available to him:
[1] Aran is down-and-out poor and has sold off most of his good equipment.
[2] Aran has kept most of his good gear.
[3] Aran has kept the best gear available to a successful mercenary.~
OUTER_SPRINT ~aran_wealth~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~aran_wealth~) OR (~aran_wealth~ > 0x4) OR (~aran_wealth~ < 0x1)) BEGIN
	PRINT ~Please select 1, 2, or 3 and press enter.~
	ACTION_READLN ~aran_wealth~
END
/* mage dual-class build */
PRINT ~You are probably going to Dual-Class Aran to Mage. He currently has proficiencies as follows:
** Long Sword 
** Quarterstaff
** Dagger

Please choose from the following starting weapon choices:
[1] Long Sword, Shield, Dagger
[2] Long Sword, Shield, Quarterstaff
[3] Long Sword, Shield, Potions of healing~
OUTER_SPRINT ~weapon_choices~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~weapon_choices~) OR (~weapon_choices~ > 0x4) OR (~weapon_choices~ < 0x1)) BEGIN
	  PRINT ~Please select 1, 2, or 3 and press enter.~
	  ACTION_READLN ~weapon_choices~
END
ACTION_IF (~weapon_choices~ = 1) THEN BEGIN
   	OUTER_SET ~aran_weapon_set~ = 1 // default: Long Sword, Shield, Dagger
END
ACTION_IF (~weapon_choices~ = 2) THEN BEGIN
   	OUTER_SET ~aran_weapon_set~ = 2 // Long Sword, Shield, Quarterstaff
END
ACTION_IF (~weapon_choices~ = 3) THEN BEGIN
   	OUTER_SET ~aran_weapon_set~ = 3 // Long Sword, Shield, Potions of healing
END
/* Choose the armor he gets */
PRINT ~Please choose from the following starting armor choices for Aran:
[1] Leather
[2] Studded Leather
[3] Chain
[4] Splint
[5] Plate~
OUTER_SPRINT ~aran_armor_choice~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~aran_armor_choice~) OR (~aran_armor_choice~ > 0x6) OR (~aran_armor_choice~ < 0x1)) BEGIN
	  PRINT ~Please select 1, 2, 3, 4, or 5 and press enter.~
	  ACTION_READLN ~aran_armor_choice~
END
COPY ~testarea/c-arnmge.cre~ ~override/c-aran7.cre~ // copy the base .cre into the game, and
	  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // if the .cre is valid, then
		LAUNCH_PATCH_MACRO ~aran_cre_setup~  // patch in player choices using this pre-defined code
	  END
// BUT_ONLY_IF_IT_CHANGES // WYSIWYG. If the .cre in the buffer changes due to this patching (it will) then write the changes; if it doesn't, don't bother. DON'T DO THIS HERE! Explanations will follow!

BEGIN  ~Aran Whitehand, Cleric Dual-Class stats configuration (Tailor)~ 
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~
	/* choose wealth level */   
PRINT ~Please choose from the following choices to modify starting armor and weapons available to him:
[1] Aran is down-and-out poor and has sold off most of his good equipment.
[2] Aran has kept most of his good gear.
[3] Aran has kept the best gear available to a successful mercenary.~
OUTER_SPRINT ~aran_wealth~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~aran_wealth~) OR (~aran_wealth~ > 0x4) OR (~aran_wealth~ < 0x1)) BEGIN
	PRINT ~Please select 1, 2, or 3 and press enter.~
	ACTION_READLN ~aran_wealth~
END
/* cleric dual-class build */	
PRINT ~You are probably going to Dual-Class Aran to Cleric. He currently has proficiencies as follows:
* Long Sword
* Hammer
* Mace
* Flail
** Sword and Shield Style

Please choose from the following starting weapon choices:
[1] Long Sword, Shield, Mace
[2] Long Sword, Shield, Quarterstaff
[3] Long Sword, Shield, Hammer
[4] Long Sword, Shield, Flail~
OUTER_SPRINT ~weapon_choices~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~weapon_choices~) OR (~weapon_choices~ > 0x4) OR (~weapon_choices~ < 0x1)) BEGIN
	PRINT ~Please select 1, 2, 3, or 4 and press enter.~
	ACTION_READLN ~weapon_choices~
END
ACTION_IF (~weapon_choices~ = 1) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 4 // Long Sword, Shield, Mace
END
ACTION_IF (~weapon_choices~ = 2) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 2 // Long Sword, Shield, Quarterstaff
END
	ACTION_IF (~weapon_choices~ = 3) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 12 // Long Sword, Shield, Hammer
END
	ACTION_IF (~weapon_choices~ = 4) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 5 // Long Sword, Shield, Flail
END
/* Choose the armor he gets */
PRINT ~Please choose from the following starting armor choices for Aran:
[1] Leather
[2] Studded Leather
[3] Chain
[4] Splint
[5] Plate~
OUTER_SPRINT ~aran_armor_choice~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~aran_armor_choice~) OR (~aran_armor_choice~ > 0x6) OR (~aran_armor_choice~ < 0x1)) BEGIN
	  PRINT ~Please select 1, 2, 3, 4, or 5 and press enter.~
	  ACTION_READLN ~aran_armor_choice~
END
COPY ~testarea/c-arnclr.cre~ ~override/c-aran7.cre~
	  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN
		LAUNCH_PATCH_MACRO ~aran_cre_setup~
	  END

BEGIN  ~Aran Whitehand, Fighter stats configuration (Soldier)~ 
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~
/* choose wealth level */  
  PRINT ~Please choose from the following choices to modify starting armor and weapons available to him:
[1] Aran is down-and-out poor and has sold off most of his good equipment.
[2] Aran has kept most of his good gear.
[3] Aran has kept the best gear available to a successful mercenary.~
OUTER_SPRINT ~aran_wealth~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~aran_wealth~) OR (~aran_wealth~ > 0x4) OR (~aran_wealth~ < 0x1)) BEGIN
	PRINT ~Please select 1, 2, or 3 and press enter.~
	ACTION_READLN ~aran_wealth~
END
/* fighter single-class build */		
PRINT ~You are probably going to leave Aran as a fighter. He currently has proficiencies as follows:
** Long Sword
** Bastard Sword
* Long Bow
* Sword and Shield

Please choose from the following starting weapon choices:
[1] Long Sword, Shield, Dagger
[2] Long Sword, Shield, Long Bow
[3] Long Sword, Shield, Potions of healing
[4] Bastard Sword, Shield, Dagger
[5] Bastard Sword, Shield, Long Bow
[6] Long Sword, Shield, Hammer~
OUTER_SPRINT ~weapon_choices~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~weapon_choices~) OR (~weapon_choices~ > 0x5) OR (~weapon_choices~ < 0x1)) BEGIN
	PRINT ~Please select 1, 2, 3, 4, or 5 and press enter.~
	ACTION_READLN ~weapon_choices~
END
ACTION_IF (~weapon_choices~ = 1) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 1 // Long Sword, Shield, Dagger
END
ACTION_IF (~weapon_choices~ = 2) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 6 // Long Sword, Shield, Long Bow
END
ACTION_IF (~weapon_choices~ = 3) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 3 // Long Sword, Shield, Potions of healing
END
ACTION_IF (~weapon_choices~ = 4) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 7 // Bastard Sword, Shield, Dagger
END
ACTION_IF (~weapon_choices~ = 5) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 8 // Bastard Sword, Shield, Long Bow
END
ACTION_IF (~weapon_choices~ = 6) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 12 // Long Sword, Shield, Hammer
END	
/* Choose the armor he gets */
PRINT ~Please choose from the following starting armor choices for Aran:
[1] Leather
[2] Studded Leather
[3] Chain
[4] Splint
[5] Plate~
OUTER_SPRINT ~aran_armor_choice~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~aran_armor_choice~) OR (~aran_armor_choice~ > 0x6) OR (~aran_armor_choice~ < 0x1)) BEGIN
	  PRINT ~Please select 1, 2, 3, 4, or 5 and press enter.~
	  ACTION_READLN ~aran_armor_choice~
END
COPY ~testarea/c-arnftr.cre~ ~override/c-aran7.cre~
	  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN
		LAUNCH_PATCH_MACRO ~aran_cre_setup~
	  END

BEGIN  ~Aran Whitehand, Thief Dual-Class stats configuration (Spy)~
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~
/* choose wealth level */
	PRINT ~Please choose from the following choices to modify starting armor and weapons available to him:
[1] Aran is down-and-out poor and has sold off most of his good equipment.
[2] Aran has kept most of his good gear.
[3] Aran has kept the best gear available to a successful mercenary.~
OUTER_SPRINT ~aran_wealth~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~aran_wealth~) OR (~aran_wealth~ > 0x4) OR (~aran_wealth~ < 0x1)) BEGIN
PRINT ~Please select 1, 2, or 3 and press enter.~
	ACTION_READLN ~aran_wealth~
END
/* thief dual-class build */
PRINT ~You are probably going to Dual-Class Aran as a Thief. He currently has proficiencies as follows:
** Long Sword
** Short Sword
* Dagger
* Crossbow

Please choose from the following starting weapon choices:
[1] Long Sword, Shield, Dagger
[2] Long Sword, Shield, Crossbow
[3] Long Sword, Shield, Potions of healing
[4] Short Sword, Shield, Dagger
[5] Short Sword, Shield, Crossbow~
OUTER_SPRINT ~weapon_choices~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~weapon_choices~) OR (~weapon_choices~ > 0x5) OR (~weapon_choices~ < 0x1)) BEGIN
	PRINT ~Please select 1, 2, 3, 4, or 5 and press enter.~
	ACTION_READLN ~weapon_choices~
END
ACTION_IF (~weapon_choices~ = 1) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 1 // Long Sword, Shield, Dagger
END
ACTION_IF (~weapon_choices~ = 2) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 9 // Long Sword, Shield, Crossbow
END
ACTION_IF (~weapon_choices~ = 3) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 3 // Long Sword, Shield, Potions of healing
END
ACTION_IF (~weapon_choices~ = 4) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 10 // Short Sword, Shield, Dagger
END
ACTION_IF (~weapon_choices~ = 5) THEN BEGIN
	OUTER_SET ~aran_weapon_set~ = 11 // Short Sword, Shield, Crossbow
END	
/* choose the armor he gets */
PRINT ~Please choose from the following starting armor choices for Aran:
[1] Leather
[2] Studded Leather
[3] Chain
[4] Splint
[5] Plate~
OUTER_SPRINT ~aran_armor_choice~ ~placeholder_value~
OUTER_WHILE (!(IS_AN_INT ~aran_armor_choice~) OR (~aran_armor_choice~ > 0x6) OR (~aran_armor_choice~ < 0x1)) BEGIN
	  PRINT ~Please select 1, 2, 3, 4, or 5 and press enter.~
	  ACTION_READLN ~aran_armor_choice~
END
COPY ~aranw/cre/c-arnthf.cre~ ~override/c-aran7.cre~
	  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN
		LAUNCH_PATCH_MACRO ~aran_cre_setup~
	  END

 

So now we have to define the macro that uses the values...

Link to comment

DEFINE_PATCH_MACRO ~aran_cre_setup~ BEGIN  
// the line above this is the list of instructions, applied within a 
// COPY MYCRE.CRE PATCH_IF SOURCE_SIZE (x) THEN BEGIN (do this) END.
// It is the (do this) part.
SPRINT ~added_shield~ ~nothing~
SPRINT ~added_weapon1~ ~nothing~
SPRINT ~added_weapon2~ ~nothing~
SPRINT ~added_ammo~ ~nothing~
SPRINT ~added_bow~ ~nothing~
SPRINT ~added_item~ ~nothing~  
SAY NAME1 ~Aran~
SAY NAME2 ~Aran Whitehand~
SAY INITIAL_MEETING ~[c-awsini] Now, there be an idea... joinin' up on an adventure.~ [c-awsini] /* soundref 0 */
SAY MORALE ~[c-aws001] Helm's bones - RETREAT!~ [c-aws001] /* soundref 1 */
SAY HAPPY ~[c-aws002] Aye, 'tis a fair group. 'Tis better than a clear day on Trade Way.~ [c-aws002] /* soundref 2 */
SAY UNHAPPY_ANNOYED ~[c-aws003] By Tymorra's bright coin, you make some strange decisions. I don't rightly agree.~ [c-aws003] /* soundref 3 */
SAY UNHAPPY_SERIOUS ~[c-aws004] I gave up some serious opportunities to travel with you. Wasn't expectin' this kind of 'adventure'. Stop this, or I'll dissolve th' contract.~ [c-aws004] /* soundref 4 */
SAY UNHAPPY_BREAKING_POINT ~[c-aws005] I'll see you in the hands o' Kelemvor, but not one second before.~ [c-aws005] /* soundref 5 */
SAY LEADER ~[c-aws006] I'll lead, but 'tisn't my strong point.~ [c-aws006] /* soundref 6 */
SAY TIRED ~[c-aws007] Time to make camp. This gear is startin' to chafe.~ [c-aws007] /* soundref 7 */
SAY BORED ~[c-aws008] By Torm's Blood, are we beggin' to be ambushed? Standin' 'round with our swords up our...~ [c-aws008] /* soundref 8 */
SAY BATTLE_CRY1 ~[c-aws009] Archers to th' rear!~ [c-aws009] /* soundref 9 */
SAY BATTLE_CRY2 ~[c-aws010] Spellcasters die first!~ [c-aws010] /* soundref 10 */
SAY BATTLE_CRY3 ~[c-aws011] By Tymorra's Luck!~ [c-aws011] /* soundref 11 */
SAY BATTLE_CRY4 ~[c-aws012] By Sune's Bottom!~ [c-aws012] /* soundref 12 */
SAY BATTLE_CRY5 ~[c-aws013] Send 'em to Kelemvor's Scythe!~ [c-aws013] /* soundref 13 */
SAY DAMAGE ~[c-aws014]~ [c-aws014] /* soundref 18  ah...  */
SAY DYING ~[c-aws015]~ [c-aws015] /* soundref 19  aarrgh... */
SAY HURT ~[c-aws016] Send the rest o' them to hell for me...~ [c-aws016] /* soundref 20 */
SAY AREA_FOREST ~[c-aws017] Need less trees, more road. Too many places for enemies to hide.~ [c-aws017] /* soundref 21 */
SAY AREA_CITY ~[c-aws018] Trade time! Some trade, then some drinkin', then some sleep... or more drinkin'.~ [c-aws018] /* soundref 22 */
SAY AREA_DUNGEON ~[c-aws019] I gave up comfortable inns an' guardin' simple caravans to poke around this dank musty place. I'm a bloody idiot.~ [c-aws019] /* soundref 23 */
SAY AREA_DAY ~[c-aws020] Lathander's fat arse is up at last. 'Bout time he shed some light around here.~ [c-aws020] /* soundref 24 */
SAY AREA_NIGHT ~[c-aws021] Bloody dark. Good for coverin' enemies an' ambushes. Someone light a torch, eh?~ [c-aws021] /* soundref 25 */
SAY SELECT_COMMON1 ~[c-aws022] Yep?~ [c-aws022] /* soundref 26 */
SAY SELECT_COMMON2 ~[c-aws023] What's to be done?~ [c-aws023] /* soundref 27 */
SAY SELECT_COMMON3 ~[c-aws024] Do I needs lead?~ [c-aws024] /* soundref 28 */
SAY SELECT_COMMON4 ~[c-aws025] Aye?~ [c-aws025] /* soundref 29 */
SAY SELECT_COMMON5 ~[c-aws026] Yes?~ [c-aws026] /* soundref 30 */
SAY SELECT_COMMON6 ~[c-aws027] I'm listenin'.~ [c-aws027] /* soundref 31 */
SAY SELECT_ACTION1 ~[c-aws028] Got it.~ [c-aws028] /* soundref 32 */
SAY SELECT_ACTION2 ~[c-aws029] Sune's sweet cheeks, I heard.~ [c-aws029] /* soundref 33 */
SAY SELECT_ACTION3 ~[c-aws030] On it.~ [c-aws030] /* soundref 34 */
SAY SELECT_ACTION4 ~[c-aws031] Understood.~ [c-aws031] /* soundref 35 */
SAY SELECT_ACTION5 ~[c-aws032] Sune's Bosom, I'm movin', already!.~ [c-aws032] /* soundref 36 */
SAY SELECT_ACTION6 ~[c-aws033] Ilmater's Blood. I said I'd do it.~ [c-aws033] /* soundref 37 */
SAY SELECT_ACTION7 ~[c-aws034] Less talk, more action.~ [c-aws034] /* soundref 38 */
SAY SELECT_RARE1 ~[c-aws035] Watch where you point that thing.~ [c-aws035] /* soundref 63 */
SAY SELECT_RARE2 ~[c-aws036] Aye, I'm here.~ [c-aws036] /* soundref 64 */
SAY CRITICAL_HIT ~[c-aws037] Good.~ [c-aws037] /* soundref 65 */
SAY CRITICAL_MISS ~[c-aws038] Cyric's Black Heart!~ [c-aws038] /* soundref 66 */
SAY TARGET_IMMUNE ~[c-aws039] Bounced off. Damn.~ [c-aws039] /* soundref 67 */
SAY INVENTORY_FULL ~[c-aws040] I'm already carryin' more than my share.~ [c-aws040] /* soundref 68 */
SAY PICKED_POCKET ~[c-aws041] Hey, look what I found.~ [c-aws041] /* soundref 69 */
SAY HIDDEN_IN_SHADOWS ~[c-aws042] Huntin'...~ [c-aws042] /* soundref 70 */
SAY SPELL_DISRUPTED ~[c-aws043] Never did get that one right...~ [c-aws043] /* soundref 71 */
SAY SET_A_TRAP ~[c-aws044] Try that, you bugger.~ [c-aws044] /* soundref 72 */
SAY BIO ~[c-aranbio] When you ask him about his past, ARAN WHITEHAND grasps at a nearby twig to chew on. He explains that he grew up in a small independent family-run Coster plying the Trade Way and Coast Way from Waterdeep both north and south. Working as both Pen and Sword (scribe and fighting guard) made him attractive as an independent, since he could balance accounts, keep inventory, and still operate as a sellsword. A few campaigns with mercenary companies, a few battles, and lots of wandering about has brought him to Amn. He hastens to note that he is not the man to send in to negotiate anything, preferring to wield weapons rather than the spoken word - but if you want a trading contract written up, he's the right man for the job.~ [c-aran44]
/* OK, now let's set his dialog, script name, scripts, default portrait, and hair/skin for the default portraits... */
WRITE_ASCII 0x2cc ~C-ARAN~ #8 /* dialogue */
WRITE_ASCII 0x280 ~C-ARAN~ #32 /* DV */
WRITE_ASCII 0x248 ~C-ARAN~ #8 /*  override script */
WRITE_ASCII 0x0268 ~WTARSGT~ #8 /*  Creature script - Default  */
WRITE_ASCII 0x34  ~c-aranws~ #8  /* assign small portrait */
WRITE_ASCII 0x3c  ~c-aranwm~ #8  /* assign medium portrait */
WRITE_BYTE 0x2F 12 /* skin color (light carnation pink) */
WRITE_BYTE 0x32 3  /* hair color (light gold) */
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 1)) THEN BEGIN /* down-and-out Aran leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat01~ #0 #0 #0 IDENTIFIED ARMOR  // leather
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 1)) THEN BEGIN /* average Aran leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat02~ #0 #0 #0 IDENTIFIED ARMOR  // leather +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 1)) THEN BEGIN /* successful Aran leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat11~ #0 #0 #0 IDENTIFIED ARMOR  // leather +2
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 2)) THEN BEGIN /* down-and-out Aran studded leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat04~ #0 #0 #0 IDENTIFIED ARMOR  // studded leather
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 2)) THEN BEGIN /* average Aran studded leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat05~ #0 #0 #0 IDENTIFIED ARMOR  // studded leather +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 2)) THEN BEGIN /* successful Aran studded leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat15~ #0 #0 #0 IDENTIFIED ARMOR  // studded leather +2
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 3)) THEN BEGIN /* down-and-out Aran chainmail */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~chan01~ #0 #0 #0 IDENTIFIED ARMOR  // chain
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 3)) THEN BEGIN /* average Aran chainmail */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~chan02~ #0 #0 #0 IDENTIFIED ARMOR  // chain +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 3)) THEN BEGIN /* successful Aran chainmail */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~chan08~ #0 #0 #0 IDENTIFIED ARMOR  // chain +2
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 4)) THEN BEGIN /* down-and-out Aran splint armor */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~chan04~ #0 #0 #0 IDENTIFIED ARMOR  // splint
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 4)) THEN BEGIN /* average Aran splint armor */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~chan05~ #0 #0 #0 IDENTIFIED ARMOR  // splint +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 4)) THEN BEGIN /* successful Aran splint armor */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~chan08~ #0 #0 #0 IDENTIFIED ARMOR  // chain +2, no generic high-end splint
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 5)) THEN BEGIN /* down-and-out Aran plate mail */
	ADD_CRE_ITEM ~%tutu_var%helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~%tutu_var%plat01~ #0 #0 #0 IDENTIFIED ARMOR  // plate "mail"
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 5)) THEN BEGIN /* average Aran */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~plat10~ #0 #0 #0 IDENTIFIED ARMOR  // plate "mail" +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 5)) THEN BEGIN /* successful Aran */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~plat09~ #0 #0 #0 IDENTIFIED ARMOR  // plate "mail" +2
END
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 1)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_weapon2~ ~dagg01~ // dagger
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 1)) THEN BEGIN /* average Aran */
	/* 2 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_weapon2~ ~dagg02~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 1)) THEN BEGIN /* successful Aran */
	/* 3 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_weapon2~ ~dagg24~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 2)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 2 // Long Sword, Shield, Quarterstaff */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_weapon2~ ~staf01~ // quarterstaff
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 2)) THEN BEGIN /* average Aran */
	/* 2 - 2 // Long Sword, Shield, Quarterstaff */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_weapon2~ ~staf02~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 2)) THEN BEGIN /* successful Aran */
	/* 3 - 2 // Long Sword, Shield, Quarterstaff */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_weapon2~ ~staf24~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 3)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 3 // Long Sword, Shield, Potions of healing */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_item~ ~potn52~ 
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 3)) THEN BEGIN /* average Aran */
	/* 2 - 3 // Long Sword, Shield, Potions of healing */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_item~ ~potn52~ 
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 3)) THEN BEGIN /* successful Aran */
	/* 3 - 3 // Long Sword, Shield, Potions of healing */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_item~ ~potn52~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 4)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 4 // Long Sword, Shield, Mace */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_weapon2~ ~blun04~ // mace
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 4)) THEN BEGIN /* average Aran */
	/* 2 - 4 // Long Sword, Shield, Mace */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_weapon2~ ~blun05~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 4)) THEN BEGIN /* successful Aran */
	/* 3 - 4 // Long Sword, Shield, Mace */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_weapon2~ ~blun33~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 5)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 5 // Long Sword, Shield, Flail */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_weapon2~ ~blun02~ // flail
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 5)) THEN BEGIN /* average Aran */
	/* 2 - 5 // Long Sword, Shield, Flail */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_weapon2~ ~blun03~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 5)) THEN BEGIN /* successful Aran */
	/* 3 - 5 // Long Sword, Shield, Flail */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_weapon2~ ~blun32~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 6)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 6 // Long Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_bow~ ~bow24~ // long bow
	SPRINT ~added_ammo~ ~arow02~
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 6)) THEN BEGIN /* average Aran */
	/* 2 - 6 // Long Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_bow~ ~bow25~
	SPRINT ~added_ammo~ ~arow11~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 6)) THEN BEGIN /* successful Aran */
	/* 3 - 6 // Long Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_bow~ ~bow25~
	SPRINT ~added_ammo~ ~arow11~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 7)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 7 // Bastard Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h01~ // bastard sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_weapon2~ ~dagg01~ // dagger
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 7)) THEN BEGIN /* average Aran */
	/* 2 - 7 // Bastard Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h02~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_weapon2~ ~dagg02~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 7)) THEN BEGIN /* successful Aran */
	/* 3 - 7 // Bastard Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h72~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_weapon2~ ~dagg24~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 8)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 8 // Bastard Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h01~ // bastard sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_bow~ ~bow24~ // long bow
	SPRINT ~added_ammo~ ~arow02~ // arrows
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 8)) THEN BEGIN /* average Aran */
	/* 2 - 8 // Bastard Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h02~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_bow~ ~bow25~
	SPRINT ~added_ammo~ ~arow11~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 8)) THEN BEGIN /* successful Aran */
	/* 3 - 8 // Bastard Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h72~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_bow~ ~bow25~
	SPRINT ~added_ammo~ ~arow11~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 9)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 9 // Long Sword, Shield, Crossbow  */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_bow~ ~xbow05~ // crossbow
	SPRINT ~added_ammo~ ~bolt02~ // bolts
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 9)) THEN BEGIN /* average Aran */
	/* 2 - 9 // Long Sword, Shield, Crossbow  */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_bow~ ~xbow18~
	SPRINT ~added_ammo~ ~bolt06~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 9)) THEN BEGIN /* successful Aran */
	/* 3 - 9 // Long Sword, Shield, Crossbow  */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_bow~ ~xbow18~
	SPRINT ~added_ammo~ ~bolt06~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 10)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 10 // Short Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h07~ // short sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_weapon2~ ~dagg01~ // dagger
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 10)) THEN BEGIN /* average Aran */
	/* 2 - 10 // Short Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h09~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_weapon2~ ~dagg02~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 10)) THEN BEGIN /* successful Aran */
	/* 3 - 10 // Short Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h74~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_weapon2~ ~dagg24~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 11)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 11 // Short Sword, Shield, Crossbow */
	SPRINT ~added_weapon1~ ~sw1h07~ // short sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_bow~ ~xbow05~ // crossbow
	SPRINT ~added_ammo~ ~bolt02~ // bolts
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 11)) THEN BEGIN /* average Aran */
	/* 2 - 11 // Short Sword, Shield, Crossbow */
	SPRINT ~added_weapon1~ ~sw1h09~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_bow~ ~xbow18~
	SPRINT ~added_ammo~ ~bolt06~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 11)) THEN BEGIN /* successful Aran */
	/* 3 - 11 // Short Sword, Shield, Crossbow */
	SPRINT ~added_weapon1~ ~sw1h74~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_bow~ ~xbow18~
	SPRINT ~added_ammo~ ~bolt06~
END
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 12)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 12 // Long Sword, Shield, Hammer */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_weapon2~ ~hamm01~ // hammer
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 12)) THEN BEGIN /* average Aran */
	/* 2 - 12 // Long Sword, Shield, Hammer */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_weapon2~ ~hamm02~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 12)) THEN BEGIN /* successful Aran */
	/* 3 - 12 // Long Sword, Shield, Hammer */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_weapon2~ ~hamm12~
END
PATCH_IF (~%added_shield%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_shield%~  #0  #0 #0 IDENTIFIED SHIELD
END
PATCH_IF (~%added_weapon1%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_weapon1%~ #0  #0 #0 IDENTIFIED WEAPON1 EQUIP
END
PATCH_IF (~%added_weapon2%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_weapon2%~ #0  #0 #0 IDENTIFIED WEAPON3
END
PATCH_IF (~%added_bow%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_bow%~  #0  #0 #0 IDENTIFIED WEAPON2
END
PATCH_IF (~%added_ammo%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_ammo%~ #20 #0 #0 IDENTIFIED QUIVER1
END
PATCH_IF (~%added_item%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_item%~ #5 #0 #0 IDENTIFIED QITEM1
END
END

 

Out of time for tonight, so back with explanations, breakdowns, and screenies tomorrow.

Link to comment

Some comments:

 

1)

 

%DEST_RES% is set to the resource name of the destination file when a COPY command is executed. In the example:

 

COPY_EXISTING ~kpgrd01.cre~   ~override/c-aw01ep.cre~

 

%DEST_RES% would contain the value "c-aw01ep" until another COPY command is executed. (%SOURCE_RES% would contain the value "kpgrd01" - see the WeiDU readme for other variables that get set when you COPY a file.)

 

So, in this case, the character's small portrait, dialogue, and death variable will all be assigned a value matching the resulting .cre name.

 

2)

 

	COPY ~testarea/c-arnmge.cre~ ~override/c-aran7.cre~ // copy the base .cre into the game, and
	  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN // if the .cre is valid, then
		LAUNCH_PATCH_MACRO ~aran_cre_setup~  // patch in player choices using this pre-defined code
	  END
BUT_ONLY_IF_IT_CHANGES // WYSIWYG. If the .cre in the buffer changes due to this patching (it will) then write the changes; if it doesn't, don't bother.

BUT_ONLY_IF_IT_CHANGES will actually prevent the file from being copied if no changes are made to it. When you are altering an existing resource, this stops WeiDU from making unnecessary backups of an unchanged file. When you are copying in a new file, you definitely want the file to end up in the game, so you should avoid using BUT_ONLY.

 

3)

 

1. Begin with 4 separate .cre built with appropriate stats, legally created as a L7 fighter, with proficiencies that make sense for his base .cre.

example: Set up for Dual to Mage means he has explored a weapon that is usable by mages. He has to have shield and long sword because of his characterization.

I'm sure you're aware that fighter/mages can use any weapons or fighting styles available to fighters. When a fighter duals to mage, he will temporarily lose access to his fighter proficiencies and items, but he will receive a free proficiency point in a mage-usable weapon. Once he levels up enough that his mage levels surpass his fighter levels, he will regain access to his fighter proficiencies and items. That being said, quarterstaves wouldn't be a bad category to specialise in for this build, but a dagger-wielding warrior would be a rarity.

 

4)

 

In this section of code:

 

	PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 1)) THEN BEGIN /* down-and-out Aran leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat01~ #0 #0 #0 IDENTIFIED ARMOR  // leather
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 1)) THEN BEGIN /* average Aran leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat02~ #0 #0 #0 IDENTIFIED ARMOR  // leather +1
END ELSE
...

Aran is being assigned the same helmet in each section. This code could be simplified by assigning ~helm01~ outside of the PATCH_IF statements, leaving only the armour assignments inside.

 

	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 1)) THEN BEGIN /* down-and-out Aran leather */
	ADD_CRE_ITEM ~leat01~ #0 #0 #0 IDENTIFIED ARMOR  // leather
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 1)) THEN BEGIN /* average Aran leather */
	ADD_CRE_ITEM ~leat02~ #0 #0 #0 IDENTIFIED ARMOR  // leather +1
END ELSE
...

 

(I also saw a %tutu_var% reference floating around in the code - for a Tutu-compatible mod, items should preferably use the Tutu versions of items on a Tutu install, but since Aran is BG2-only, the %tutu_var% should be removed.)

 

5)

 

STR_CMP is a confusing command. STRING_EQUAL can serve the same function, but it makes more sense when you glance at the code.

 

	PATCH_IF (~%added_ammo%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_ammo%~ #20 #0 #0 IDENTIFIED QUIVER1
END

The way this code behaves, if %added_ammo% does not contain the value "nothing", then the item is added.

 

Using STRING_EQUAL, the check becomes:

	PATCH_IF (NOT ~%added_ammo%~ STRING_EQUAL ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_ammo%~ #20 #0 #0 IDENTIFIED QUIVER1
END

This should be easier to decipher, especially for someone unfamiliar with WeiDU.

Link to comment

@Mike1072 -

  1. You have a MUCH clearer way of saying it! COPY (or COPY_EXISTING) sets up %SOURCE_RES% and %DEST_RES% based on what is copied, with %SOURCE_RES% being the file that is picked up, and %DEST_RES% being whatever you rename it when you copy it into place.
  2. I trip over this every time. To clarify what Mike1072 is re-teaching me,
     
    COPY_EXISTING ~mycre.cre~ ~override~ is taking an existing in-game resource, and the only reason to do that is to read it to find information, check it to make sure it is ok, to make some changes on it... which means that we only want to change the existing .cre in-game (patch it) if it needs to be patched. If the .cre already matches what we are going to do with it, we want to leave it alone, for all sorts of reasons, including the 'make a backup copy' part of WeiDU installing. So BUT_ONLY_IF_IT_CHANGES protects the install from unnecessary stuff happening.
     
    BUT -
     
    COPY_EXISTING ~mycre1.cre~ ~override/mycre1.cre~ is taking an already existing resource, cloning it, and adding a new version of it into the game. #1 - if everything goes right, it WILL change, so the B_O_I_I_C is a waste of time to type out. #2 - if for some reason it finds the .cre in-game matches (failed install, some other oddity) it will not copy the resource and rename it. "Wait", you say, "but if the patch does not succeed, don't we want to *not* have the resource in the game"? Well, from a troubleshooting perspective, we *need* the resource in the game. In fact, it will fail the install to *not* have the resource in the game. So we want the file copied no matter what.
     
    The classic miss-application of B_O_I_I_C is what I did in the early days of learning (and still sometimes do) -
     
    /* the "how-not-to" demonstration - don't use this */
    COPY ~mymod/mycre1.cre~ ~override~
      SAY ~string1~
      SAY ~string1~
    BUT_ONLY_IF_IT_CHANGES


    Which means if the .cre in the file already has all the strings set and such, *it doesn't get copied into the game*. Bleh!
     
    I have worked my way around to trying to do one of two things for control of output when it comes to .cres, both extremes that seldom really show up in people's code:
     
    - COPY_EXISTING an ingame resource and strip it, patch it to what I want, moving on (this means the base .cre is already in place and probably working, but it means that if someone has added +3 Swords of Doom to all of the guards in D'Arnise Hold before my mod comes along, then whatever I create with that resource has those tucked away in inventory somewhere - them's the breaks).
     
    - COPY a blank .cre with absolutely minimal stuff set ahead of time, and allow as much as possible to be set by the .tp2.
     
    I admit freely my over-zealousness on these points, but I started modding on Tutu, where strrefs were (to a certain extent) malleable. So I like to declare as much of the .cre as I can understand, rather than just create a copy of what I want in NI/DLTCEP and hole/pray that the user's target install dialog.tlk is static. Good old posts on this at PPG and SHS.
     

  3. Fair point. To be completely honest, I use Ashes of Embers or B!Tweaks to modify weapons usage so that all classes can use any weapon, and my two favorite weapons usages for non-Paladins are sword+dagger dual wield or sword+shield. I might want to revisit this, as my own playstyle might not make sense for him. Within roleplaying, though, I was trying to picture what a dude who was fascinated enough with thievery or magic would naturally be attracted to - when a person makes a voluntary career change that significant, it seems to usually follow what they already love and have picked up as a hobby. So I thought of a cleric-pondering Aran wandering through the blunts, playing with them, getting good with most of them - but not specializing on any given one. With the dagger/mage, I figured he is already into cooking and carving, and at the same time interested in magic, so a fair "growth" of interest might be the dagger route as he collects, experiments with their usage, plays around.... I saw the interchange being like:
     
    [FLAMING_FIST_FRIEND] Quit playing with that pansy-arsed little blade, Aran, and put up your sword. Who do you think you are, a blighted mage?
    [ARAN] I know, I know... useless little buggerss on th' Shield wall. But they have their uses, they do.
    [FLAMING_FIST_FRIEND] Bollux. Those little pinprickers have no real leverage to speak of, their reach is lousy, and.... HEY!
    [ARAN] I done told you they was a might useful. Now, pull your trousers back up. You be scarin' th' ladies. Don't look at me like that - I'll buy you a new belt, next payday, eh?
     
  4. RE: %tutu_var% - that's what I get for copying and pasting sections of Level 1 NPCs and then playing with it! I'll fix it up.
     
    On the same subject, good call on the duplication of code - I am looking at changing those resources, though. The original inspiration comes from an incredibly watered down Level 1 NPCs, and as such needs serious tweaking (not Nythrun's work, my cheap knockoff). For example, right now, the "well-prepared" Aran choices are actually what L1NPCs has as ToB starting equipment - way overpowered. So today's cleanup will include looking at the actual items and adjusting them.
     
  5. RE: STR_CMP - Cool - yes, much easier to explain using your code. I was trying to figure out how to explain that comfortably, and that example makes it much easier.

 

Thanks!

Link to comment

Breaking Down What the Patch Does

 

Well, lots of code thrown all at once, and it was two weeks of study, trial, and lots and lots of error. Errors upon errors. Then their errors had babies, and it was like watching a rabbit herd on time-lapse photography. So, I will try out a layman's (half-understood) explanation of each of the parts that comes into play.

 

COPY ~testarea/c-arnmge.cre~ ~override/c-aran7.cre~ 
PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN 
	LAUNCH_PATCH_MACRO ~aran_cre_setup~  
END

 

This part means find the base .cre that was created with the stats we want for dual class to mage, copy the pre-created and edited base .cre into the game, and name it c-aran7.cre:

COPY ~testarea/c-arnmge.cre~ ~override/c-aran7.cre~

 

Next, if the .cre is valid as determined by its size (something you can research, or just copy from trusted mods - different resources have different sizes, and we are interested in this because sometimes files get corrupted, and sometimes ALLOW_MISSING or other operations might create 0 byte files that need to be avoided or your code will fail with an "illegal offset byte something-or-other" error and get a 10 yard penalty, first-down) , then

PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN

 

Now that we have opened up the .cre and are tinkering with its guts, bits and bytes all exposed and vulnerable, start manipulating the base .cre by patching in player choices using this pre-defined code

LAUNCH_PATCH_MACRO ~aran_cre_setup~

...and Stop. We are done, and c-aran7.cre is in the game with our changes.

END

 

Now we define the set of things we want to get done to the .cre.

The overview -

DEFINE_PATCH_MACRO ~aran_cre_setup~ // when you get the "handle" player_choice_cre, start doing the following stuff...
END // ok, definitions over.Stop doing stuff.

 

The shorthand - what we are trying to do

DEFINE_PATCH_MACRO ~aran_cre_setup~ 
 do the regular "universal" stuff, like setting scripts/dialog/dv/default portrait, etc.
 then check what equipment quality was chosen, and use that to modify the next choice
 then check what equipment was chosen and put it on the .cre
 then check what armor was chosen and put it on the .cre
END

 

Now from all those ACTION_READLN materials (discussed elsewhere) we have a set of possible variables already in place:

 

aran_wealth = {1,2,3}

aran_weapon_set = {1,2,3,4,5,6,7,8,9,10,11}

aran_armor_choice = {1,2,3,4,5}

 

and we can set up some logic chains based on this set of sets.

 

(%aran_wealth% = 1)

(%aran_wealth% = 2)

(%aran_wealth% = 3)

 

And,

 

(%aran_armor_choice% = 1)

(%aran_armor_choice% = 2)

(%aran_armor_choice% = 3)

(%aran_armor_choice% = 4)

(%aran_armor_choice% = 5)

 

And,

 

(%aran_weapon_set% = 1)

(%aran_weapon_set% = 2)

(%aran_weapon_set% = 3)

(%aran_weapon_set% = 4)

(%aran_weapon_set% = 5)

(%aran_weapon_set% = 6)

(%aran_weapon_set% = 7)

(%aran_weapon_set% = 8)

(%aran_weapon_set% = 9)

(%aran_weapon_set% = 10)

(%aran_weapon_set% = 11)

(%aran_weapon_set% = 12)

 

The "wealth" set is just a modifier of the bottom two sets, so you end up with a grid of player choices for each:

 

(%aran_wealth% = 1) and (%aran_armor_choice% = 1)

(%aran_wealth% = 2) and (%aran_armor_choice% = 1)

(%aran_wealth% = 3) and (%aran_armor_choice% = 1)

 

(%aran_wealth% = 1) and (%aran_armor_choice% = 2)

(%aran_wealth% = 2) and (%aran_armor_choice% = 2)

(%aran_wealth% = 3) and (%aran_armor_choice% = 2)

 

(%aran_wealth% = 1) and (%aran_armor_choice% = 3)

(%aran_wealth% = 2) and (%aran_armor_choice% = 3)

(%aran_wealth% = 3) and (%aran_armor_choice% = 3)

 

(%aran_wealth% = 1) and (%aran_armor_choice% = 4)

(%aran_wealth% = 2) and (%aran_armor_choice% = 4)

(%aran_wealth% = 3) and (%aran_armor_choice% = 4)

 

(%aran_wealth% = 1) and (%aran_armor_choice% = 5)

(%aran_wealth% = 2) and (%aran_armor_choice% = 5)

(%aran_wealth% = 3) and (%aran_armor_choice% = 5)

 

...and I am not going to set up the next grid, because it is much longer, and I already did it in the code anyways. But you get the idea - I hope ;)

 

So. let's incorporate.

 

First off, we already started the whole thing by COPY-ing a .cre, so all the list of actions will be done to that specific .cre, and written into a file in ~override~ for the game to use instead of the game looking at the original copy hidden in the game's compressed resources. The code we used said basically

 

"patch this file with a set of instructions named 'aran_cre_setup'."

 

So we go ahead and do all the normal .cre stuff that everyone uses to setup soundsets, names, etc:

 

	SAY NAME1 ~Aran~
SAY NAME2 ~Aran Whitehand~
SAY INITIAL_MEETING ~[c-awsini] Now, there be an idea... joinin' up on an adventure.~ [c-awsini] /* soundref 0 */
SAY MORALE ~[c-aws001] Helm's bones - RETREAT!~ [c-aws001] /* soundref 1 */
<<snip of a ton of stuff>>
/* OK, now let's set his dialog, script name, scripts, default portrait, and hair/skin for the default portraits... */
WRITE_ASCII 0x2cc ~C-ARAN~ #8 /* dialogue */
WRITE_ASCII 0x280 ~C-ARAN~ #32 /* DV */
WRITE_ASCII 0x248 ~C-ARAN~ #8 /*  override script */
WRITE_ASCII 0x0268 ~WTARSGT~ #8 /*  Creature script - Default  */
WRITE_ASCII 0x34  ~c-aranws~ #8  /* assign small portrait */
WRITE_ASCII 0x3c  ~c-aranwm~ #8  /* assign medium portrait */
WRITE_BYTE 0x2F 12 /* skin color (light carnation pink) */
WRITE_BYTE 0x32 3  /* hair color (light gold) */

 

Each one of these is a direct change of the .cre, no questions asked. When we say

 

SAY NAME1 ~Aran~

 

WeiDU says "Sir! Yes Sir! Writing Now!"

 

But now things get a bit more complicated. We have those logic grids above to incorporate.

 

The basic statement is

"Patch IF x=true ELSE END".

We could just ask individually for each thing, and be done with it, but we can get a little more efficient by asking to check within sets of things, of which only one combination matches -

"Patch IF x=true ELSE check the next thing - keep looking until we no longer have an ELSE, or until we have a match".

In this case, the "x" we want to be true has two sub-parts; x = (y + z). Restated, PATCH_IF ( y is true AND z is true ). So if both y and z are true, then x is true, and we do it... or else, we move on and check the next thing. Basically, this ends up being a minor checklist all on its own, like the Halloween candy part of the grocery list. So the main list reads

  • Milk
  • Eggs
  • Bread
  • Candy
  • Crackers

and this little sub-list is the conversation between you and your significant other...

[sigO]: "Did they have Hershey's Bars, and did you put them in the basket?"

[Me]: "No. Had 'em, but I didn't put them in the basket."

[sigO]: "Did they have KitKats, and did you put them in the basket?"

[Me]: "No. Sold out of KitKats."

[sigO]: "Did they have M&M's, and did you put them in the basket?"

[Me]: "Yes."

[sigO]: "Candy, Check. Lets go get some crackers."

[Me]: "I'm wandering over to the bakery section to look at the pies"

 

	/* armor choices installed. Each of these is an END ELSE, because we want the code to choose between the patches to be applied. Only one of the set gets done. */
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 1)) THEN BEGIN /* down-and-out Aran leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat01~ #0 #0 #0 IDENTIFIED ARMOR  // leather
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 1)) THEN BEGIN /* average Aran leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat02~ #0 #0 #0 IDENTIFIED ARMOR  // leather +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 1)) THEN BEGIN /* successful Aran leather */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~leat11~ #0 #0 #0 IDENTIFIED ARMOR  // leather +2
END ELSE
<<snip of code for length >> 
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 5)) THEN BEGIN /* down-and-out Aran plate mail */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~plat01~ #0 #0 #0 IDENTIFIED ARMOR  // plate "mail"
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 5)) THEN BEGIN /* average Aran */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~plat10~ #0 #0 #0 IDENTIFIED ARMOR  // plate "mail" +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 5)) THEN BEGIN /* successful Aran */
	ADD_CRE_ITEM ~helm01~ #0 #0 #0 IDENTIFIED HELMET
	ADD_CRE_ITEM ~plat09~ #0 #0 #0 IDENTIFIED ARMOR  // plate "mail" +2
END // no more "else". We have one of these true, and no more. Move along to the next thing.

 

Each one of these, as Mike1072 pointed out, have the same helmet - using his variation on the code is more efficient if we end up using the same helmet every time. Or, we could even use this to create random helmet assignments, or all sorts of cool things - lots of great examples out there to play with! But since I am likely to vary the helmet in the final implementation, I am leaving them in place for right now. So, what about the choices of equipment? Well, we could do exactly the same thing, but let's play with Nythrun's Level1NPCs "set a variable within a patch and then use it at the end" stuff. That would be fun. Another way to accomplish the same goal we did above is to ask for that set of logic choices, but instead of immediately writing to the .cre, putting it into a variable and using it at the end of the patch - sort of a cosmic inner-reflection of patchiness.

 

First, at the top of the macro, we make sure that no other code anywhere in this particular install have set anything with the same name, "initializing" or blanking the variables that we will use later. In most cases, modders blank them, either by setting to 0 or by setting something like ~placeholder_value~, but we are going to use "nothing" as a specific tactic later on, so bear with me...

 

	SPRINT ~added_shield~ ~nothing~
SPRINT ~added_weapon1~ ~nothing~
SPRINT ~added_weapon2~ ~nothing~
SPRINT ~added_ammo~ ~nothing~
SPRINT ~added_bow~ ~nothing~
SPRINT ~added_item~ ~nothing~

 

We will use this later on, to determine whether a value has been set or not, and if there is a value that differs from this initialized state, then we write the value we find into the .cre.

 

Then we ask the questions about choice in a huge long PATCH_IF a THEN BEGIN aaa END ELSE PATCH_IF b THEN BEGIN aba END ELSE PATCH_IF c THEN BEGIN abc END... or more closely,

 

PATCH IF (a + b) = true

BEGIN

set value 1

set value 2

set value 3

END, but IF (a + b) = false then move on to the next thing and check to see if that is true - so

PATCH IF (a + c) = true

BEGIN

set value 3

set value 4

set value 5

etc., etc., etc. on down the line until something evaluates true.

 

	/* For the weapons combos, set up another way, just to show the idea Nythrun uses in setting up a .cre by setting up SPRINT.  Start the PATCH_IF again, but this way, setting variables to be used later... */
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 1)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_weapon2~ ~dagg01~ // dagger
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 1)) THEN BEGIN /* average Aran */
	/* 2 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_weapon2~ ~dagg02~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 1)) THEN BEGIN /* successful Aran */
	/* 3 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_weapon2~ ~dagg24~
END ELSE

<< snip of huge codeblock until >>

PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 12)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 12 // Long Sword, Shield, Hammer */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld02~ // shield
	SPRINT ~added_weapon2~ ~hamm01~ // hammer
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 12)) THEN BEGIN /* average Aran */
	/* 2 - 12 // Long Sword, Shield, Hammer */
	SPRINT ~added_weapon1~ ~sw1h05~
	SPRINT ~added_shield~ ~shld04~
	SPRINT ~added_weapon2~ ~hamm02~
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 12)) THEN BEGIN /* successful Aran */
	/* 3 - 12 // Long Sword, Shield, Hammer */
	SPRINT ~added_weapon1~ ~sw1h73~
	SPRINT ~added_shield~ ~shld06~
	SPRINT ~added_weapon2~ ~hamm12~
END /* <<<< NO ELSE!! We want to do another patch routine, not lump it into the last check! */

 

This has set a bunch of values. For example, if I chose "down-and-out Aran, using a Long Sword, Shield, and Dagger", I have the following set of information to play with:

 

%added_shield% = shld02 // shield

%added_weapon1% = sw1h04 // long sword

%added_weapon2% = dagg01 // dagger

%added_ammo% = nothing

%added_bow% = nothing

%added_item% = nothing

 

 

We know the BiggDU/WeiDU command for adding stuff to the .cre because we either olooked it up or cribbed it from someone else's code -

 

ADD_CRE_ITEM ~arow12~ #20 #0 #0 IDENTIFIED QUIVER1

 

...and we know that these vary by what is being added. In this case, the resource "arow12.itm" (20 of them, with no charges or anything else as it doesn't apply), already identified, are being added to the QUIVER1 slot on the .cre.

 

We know that by substituting a variable, we can swap in whatever item we want:

 

ADD_CRE_ITEM ~%add_arrows_here%~ #20 #0 #0 IDENTIFIED QUIVER1

 

and we can set them to different values before we patch the .cre, like

 

SPRINT  ~add_arrows_here~ ~arow12~ // mythical game resource "arow12.itm"

or

SPRINT  ~add_arrows_here~ ~c-modarw~ // mythical  custom mod item "c-modarw.itm"

or

SPRINT  ~add_arrows_here~ ~arwdeath~ // mythical custom +12 Firey Area-Of-Effect Arrow of Chunking "arwdeath.itm"

 

OK, let's put this into the .cre. I used STR_CMP because that is what I saw other folks using in some of the code they were using, but Mike1072 is right - it is easier to understand straight STRING_EQUAL.

	PATCH_IF (NOT ~%added_ammo%~ STRING_EQUAL ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_ammo%~ #20 #0 #0 IDENTIFIED QUIVER1
END

 

This code says basically

"Check %added_ammo% versus the value nothing. If %added_ammo% = <<anything except the word nothing>>, then go ahead and do this next patch. If %added_ammo% = nothing, then skip this. "

 

To think of this another way, we set all the values used to ~nothing~ at the top of the macro, so really what we are saying here is "Did anything change? If it didn't, forget this and move on. If it did, then it means you made a choice that is relevant to this line of code, so do this action and write in the value that you set."

 

We can't use this:

	PATCH_IF (~%added_ammo%~ STRING_EQUAL ~arow12~) THEN BEGIN
	ADD_CRE_ITEM ~%added_ammo%~ #20 #0 #0 IDENTIFIED QUIVER1
END

without setting up a PATCH_IF for every possible weapon that we hung on %added_ammo%, and there is no NOT_PATCH_IF operation, so swap your brain around to using "if it is not this, do that" is a quick tip that still takes me by suprise at times. Non-programmers seem to tend to think in simple declarative sentences:

 

"if this, do that."

"I want this sword to be added if x"

 

but sometimes it can be much more efficient to simply reverse the thinking, and say

 

"if it isn't this, then I want to do that."

"If x isn't true, I want this sword to be added."

or

"If I set x to 1 and it was changed to some other value later on, I want this sword added".

Playing backwards and forwards with logic statements, excluding or including different sets of data - it is like a way cool logic puzzle, sort of a huge jigsaw of ideas. As a "completely forgot all my advanced math stuff from high school since it was a very long time ago" person, it is fun playing with the patterns.

 

Playing with Code versus Getting Stuff Done

Aside from the procrastination of writing up the big long post about how stuff works, there comes a point when you have to decide if it is worth recoding to clean things up and make them more efficient. Looking back, it would probably be more efficient in terms of .cre patching to loop both armor and weapon choice into the mix via SPRINT, rather than a long list of PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 5)) THEN BEGIN /* down-and-out Aran plate mail */ statements. In fact, there are probably several ways of making this more efficient, from several perspectives - but rather than play around much more with this right now, I am going to move back to the actual player choices ACTION_READLN, as someone has kindly shown me how to turn those into macros, too. Macros are for more than just show-offiness... they can be easily customized for other folks work with cut-paste-destroy methods, they save typing, and they make it easier to read the .tp2 and see what is going on. Even in stuff that has been written out long-hand, declaring everything, macros can help in testing. Testing this set of code was frustrating as hell, moving things around to manipulate which block of .tp2 code had an error. With a macro, I could select a few lines, and move the equivalent of a huge block of code easily. I could isolate the macro into a mini-testing-mod, and run down places where I was not understanding or making mistakes, and of course once it was troubleshot I didn't have to worry any more about typos in the macro - I could concentrate on the 10,000 of them in the rest of the test install! I could copy and paste 5 or 6 .cre in a half a page, instead of scrolling down. I bet there are a zillion reasons why macros are better from a real programmer's perspective, but for wannabe hacks like me, just the simple pleasure of being able to grab a 5 line block instead of a 45 line block makes me very, very happy. What can I say - I am easily amused!

 

Now, if I really wanted to be fancy, I could ask for the player choice of equipment, and then set the .cre to specialize in those weapons, using

SET_BG2_PROFICIENCY : String value

Removes all effects from the current CRE file that alter the proficiency specified by String (relative to Stats.ids). After that, if value is different from zero, add an effect to set said proficiency to value.

The possibilities for this are endless. But since Level1NPCs exists for the "ultimate player choice" stuff, the solution I have chosen gives some player input while retaining characterization, and gives an option to make it easier by having the first available FORCED_SUBCOMPONENT install a "default" Aran.
Link to comment

OK, one last pass at this for fun -

 

I was having troubles with macro-fying some of the same "ask and ye shall receive" sections of each FORCED_SUBCOMPONENT. Basically, I was having trouble figuring out that DEFINE_PATCH_MACRO and DEFINE_ACTION_MACRO and such were different for a *reason* - a definite laughter moment for anyone who really knows what they are doing, because it is like me saying "Hey, the car won't start. I keep trying to use my work keys, and the darned thing just won't unlock..." ;)

 

The cool part about this is the use of STRING_COMPARE_REGEXP. To clean things up, Guest over there not only kindly pointed me to the correct scope usage, but also set up a single line check for input for the ACTION_IF.

 

new_macro_action.PNG

 

So this simplifies my .tp2 down to the following subcomponent structure:

 

new_subcomponent.PNG

 

(sorry - don't know why .png files are not loading under the image tag... probably an error on my end - trying again... heh. case sensitive. Got it fixed. )

 

very cool. So, on to testing...

Link to comment

So the choices we have included here are about as far as I want to go as install choices are concerned. There already are Friend-talk timers and Love-talk timers to install as choices, and now we get our three questions here:

 

action-macro_test.PNG

 

I think most of the rest of the stuff (besides the choice of that "Aran Aware" component or not) can be safely tucked into in-game choices and scripts, giving the most flexibility to multiple playthrough possibilities. The patching looks good in NI:

 

ni_fighter_one.PNG

 

ni_fighter_two.PNG

 

though this test of the "rich fighter" configuration really shows why borrowing items from Level1NPCs was a silly idea; Nythrun set up experience levels, and I took her ToB choices blindly just to see how it all worked in code/test. So I need to go back and swap out items that are more appropriate than L14 equipment!

Link to comment

OK, in-game, the Bio looks fine, as a test for string patching -

 

aran_ftr_bio.png

 

and the inventory shows the uuberpoweredness of the current items at the top of the scale, but everything works fine:

 

 

aran_ftr_equip.png

 

And on joining, the character screen looks promising...

 

aran_ftr_rich_1.png

aran_ftr_rich_2.png

aran_ftr_rich_3.png

aran_ftr_rich_4.png

 

So it looks like some cleaup here and there, and then it is back to developing the talks and quest. We know we can successfully

1. give players some choices about Aran,

2. use the pre-created .cres and patch them into what we want taking those choices into account, and

3. the .cres work ingame.

 

 

Side note - I had some fun with the clothing colors - fighter base gets blue + gold, thief black + silver, etc. Good for testing, but will be overwritten when folks choose alternate portraits, I think - I will have to go look.

Link to comment

Finalizing this, we need to clean up the actual items put on the .cre, tidy up, and test again.

 

As a side note, I thought of the inevitable question about game balance, and how under this setup Aran can come with crappy threadbare mundane gear all the way up to having a magical bow, magical armor, magical ammunition, and a magical shield. To which I think I say....

 

who cares?

 

Game balance is a non-starter, as that went out the window with mods. And variation by player choice is the foundation of this mod. So, I will just make sure that if folks are wanting to have vanilla BG2 behavior, where NPCs come with garbage gear, just pick "down-and-out" Aran, and you will be fine. Except leather armor. I just can't believe that a fighter who likes leather armor would ever, ever give up +1 leather armor under any circumstances. I mean, why not just go get some skinned animal hides and hang them around you. Really. This is made even less important a choice when you remember that vanilla and modded NPCs often have items to be upgraded through quests and such; no such thing for Aran. He gets what a real adventurer/merc would get - whatever gear the emloyer/friend/leader gives him from found treasure, upgraded items obsoleting stuff and making the old available for his use, or good old cold hard iron tradebars.

 

On to the job at hand... editing code.

OK, for quick editing when you don't have access to BG2 directly for a few hours, nothing beats having a copy of Dan Simpson's walkthroughs - in this case, http://www.gamefaqs.com/pc/258273-baldurs-...f-amn/faqs/9332

his Item List. Rechecking in NI gives us the info as to whether each are "generic" or

 

(We do this because while it helps to clip from Nythrun's code, it doesn't help to use it blindly - c.f. my copying of ToB level equipment into place. Template work does save time and reduce errors, but the contents of the template need rechecking against what you actually want in the mod.)

 

Clipped from that, and reduced to some basic choices of 'generic' classes of items that a mercenary adventurer might get over 7 levels of achievement, and for simplicity of coding they are also all in a SoA install so we don't have to worry about the SoA/ToB spilt (and rearranged for simple copy/paste into our working code):

 

AROW01 - Arrow

AROW02 - Arrow +1

AROW08 - Arrow of Fire

 

BLUN02 - Flail

BLUN03 - Flail +1

 

BLUN04 - Mace

BLUN05 - Mace +1

BLUN21 - Mace +2

 

BOW03 - Long Bow

BOW04 - Long Bow +1

BOW17 - Long Bow +2

 

BOLT02 - +1 bolts

BOLT03 - Bolt of Lightning

BOLT06 - +2 bolts

 

CHAN01 - Chainmail

CHAN02 - Chainmail +1

CHAN03 - Chainmail +2

 

CHAN04 - Splint Mail

CHAN05 - Splint Mail +1

CHAN08 - Chain Mail +2

 

XBOW04 - Light Crossbow

XBOW05 - Light Crossbow +1

XBOW09 - Light Crossbow +2

 

DAGG01 - Dagger

DAGG02 - Dagger +1

DAGG15 - Dagger +2

 

HAMM01 - War Hammer

HAMM02 - War Hammer +1

HAMM08 - War Hammer +2

 

HELM01 - Helmet

HELM08 - Helmet

HELM09 - Helmet

HELM10 - Helmet

HELM11 - Helmet

HELM12 - Helmet

 

LEAT02 - Leather Armor +1

LEAT11 - Leather Armor +2

LEAT12 - Leather Armor +3

 

LEAT04 - Studded Leather Armor

LEAT05 - Studded Leather Armor +1

LEAT07 - Studded Leather Armor +2

 

PLAT01 - Plate Mail Armor

PLAT02 - Plate Mail +1

PLAT04 - Full Plate Mail

 

SHLD05 - Large Shield

SHLD04 - Medium Shield +1

SHLD06 - Large Shield +1

 

STAF01 - Quarterstaff

STAF02 - Quarterstaff +1

STAF08 - Quarterstaff +3

 

SW1H01 - Bastard Sword

SW1H02 - Bastard Sword +1

SW1H42 - Bastard Sword +2

 

SW1H04 - Long Sword

SW1H05 - Long Sword +1

SW1H41 - Long Sword +2

 

SW1H07 - Short Sword

SW1H08 - Short Sword +1

SW1H09 - Short Sword +2

Now some shortcuts for those of us with less-than-stellar tying skills.

 

I used NotePad++'s "lowercase" function to lowercase everything, and find/replace "space-space" with "~space//space" in bulk. So my copy/paste is set up.

 

arow01~ // arrow

arow02~ // arrow +1

arow08~ // arrow of fire

 

blun02~ // flail

blun03~ // flail +1

 

blun04~ // mace

blun05~ // mace +1

blun21~ // mace +2

 

bow03~ // long bow

bow04~ // long bow +1

bow17~ // long bow +2

 

bolt02~ // +1 bolts

bolt03~ // bolt of lightning

bolt06~ // +2 bolts

 

chan01~ // chainmail

chan02~ // chainmail +1

chan03~ // chainmail +2

 

chan04~ // splint mail

chan05~ // splint mail +1

chan08~ // chain mail +2

 

xbow04~ // light crossbow

xbow05~ // light crossbow +1

xbow09~ // light crossbow +2

 

dagg01~ // dagger

dagg02~ // dagger +1

dagg15~ // dagger +2

 

hamm01~ // war hammer

hamm02~ // war hammer +1

hamm08~ // war hammer +2

 

helm01~ // helmet

helm08~ // helmet

helm09~ // helmet

helm10~ // helmet

helm11~ // helmet

helm12~ // helmet

 

leat02~ // leather armor +1

leat11~ // leather armor +2

leat12~ // leather armor +3

 

leat04~ // studded leather armor

leat05~ // studded leather armor +1

leat07~ // studded leather armor +2

 

plat01~ // plate mail armor

plat10~ // plate mail +1

plat04~ // full plate mail

 

shld05~ // large shield

shld04~ // medium shield +1

shld06~ // large shield +1

 

staf01~ // quarterstaff

staf02~ // quarterstaff +1

staf08~ // quarterstaff +3

 

sw1h01~ // bastard sword

sw1h02~ // bastard sword +1

sw1h42~ // bastard sword +2

 

sw1h04~ // long sword

sw1h05~ // long sword +1

sw1h41~ // long sword +2

 

sw1h07~ // short sword

sw1h08~ // short sword +1

sw1h09~ // short sword +2

 

And trimmed the PATCH_IF statements (since I was following code indentation like the bigg has kicked me into doing, it was easy)

 

	PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 1)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~
	SPRINT ~added_shield~ ~
	SPRINT ~added_weapon2~ ~
END ELSE

And since I am doing this, might as well eat my own words a post or two above, and make the patching consistent by wiping out the direct-patch behavior abouve in favor of SPRINT for all values (though I am not bothering to integrate the grids into one massive PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 1) AND (%aran_weapon_set% = 1)) THEN BEGIN (SPRINT ~values~) END ELSE ). There are folks who see leaving code in place that uses different methods of doing the same thing is an itch, like looking at the table and finding that there are 4 different styles of forks instead of a consistent set. Plus, while it might be cool as a "how to do this different ways" implementation, I see Nythrun's usage as a "best and simplest practice, most easily troubleshot and changed" examplar, as all a person has to do to change stuff is find the code and change the SPRINT. Or, to use the thing wholesale, strip everything back to a very simple block:

 

DEFINE_PATCH_MACRO ~mymod_cre_setup~ BEGIN 
SPRINT ~added_helm~ ~nothing~
SPRINT ~added_armor~ ~nothing~
SPRINT ~added_shield~ ~nothing~
SPRINT ~added_weapon1~ ~nothing~
SPRINT ~added_weapon2~ ~nothing~
SPRINT ~added_ammo~ ~nothing~
SPRINT ~added_bow~ ~nothing~
SPRINT ~added_item~ ~nothing~  

<<add my own choices of patching here>> 

PATCH_IF (~%added_helm%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_helm%~ #0 #0 #0 IDENTIFIED HELMET
END
PATCH_IF (~%added_armor%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_armor%~ #0 #0 #0 IDENTIFIED ARMOR
END
PATCH_IF (~%added_shield%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_shield%~  #0  #0 #0 IDENTIFIED SHIELD
END
PATCH_IF (~%added_weapon1%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_weapon1%~ #0  #0 #0 IDENTIFIED WEAPON1 EQUIP
END
PATCH_IF (~%added_weapon2%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_weapon2%~ #0  #0 #0 IDENTIFIED WEAPON3
END
PATCH_IF (~%added_bow%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_bow%~  #0  #0 #0 IDENTIFIED WEAPON2
END
PATCH_IF (~%added_ammo%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_ammo%~ #20 #0 #0 IDENTIFIED QUIVER1
END
PATCH_IF (~%added_item%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_item%~ #5 #0 #0 IDENTIFIED QITEM1
END
END

 

The final tested code, with choices cleaned up and mde more appropriate, and code behavior standardized:

DEFINE_PATCH_MACRO ~aran_cre_setup~ BEGIN 
SPRINT ~added_helm~ ~nothing~
SPRINT ~added_armor~ ~nothing~
SPRINT ~added_shield~ ~nothing~
SPRINT ~added_weapon1~ ~nothing~
SPRINT ~added_weapon2~ ~nothing~
SPRINT ~added_ammo~ ~nothing~
SPRINT ~added_bow~ ~nothing~
SPRINT ~added_item~ ~nothing~  
SAY NAME1 ~Aran~
SAY NAME2 ~Aran Whitehand~
SAY INITIAL_MEETING ~[c-awsini] Now, there be an idea... joinin' up on an adventure.~ [c-awsini] /* soundref 0 */
SAY MORALE ~[c-aws001] Helm's bones - RETREAT!~ [c-aws001] /* soundref 1 */
SAY HAPPY ~[c-aws002] Aye, 'tis a fair group. 'Tis better than a clear day on Trade Way.~ [c-aws002] /* soundref 2 */
SAY UNHAPPY_ANNOYED ~[c-aws003] By Tymorra's bright coin, you make some strange decisions. I don't rightly agree.~ [c-aws003] /* soundref 3 */
SAY UNHAPPY_SERIOUS ~[c-aws004] I gave up some serious opportunities to travel with you. Wasn't expectin' this kind of 'adventure'. Stop this, or I'll dissolve th' contract.~ [c-aws004] /* soundref 4 */
SAY UNHAPPY_BREAKING_POINT ~[c-aws005] I'll see you in the hands o' Kelemvor, but not one second before.~ [c-aws005] /* soundref 5 */
SAY LEADER ~[c-aws006] I'll lead, but 'tisn't my strong point.~ [c-aws006] /* soundref 6 */
SAY TIRED ~[c-aws007] Time to make camp. This gear is startin' to chafe.~ [c-aws007] /* soundref 7 */
SAY BORED ~[c-aws008] By Torm's Blood, are we beggin' to be ambushed? Standin' 'round with our swords up our...~ [c-aws008] /* soundref 8 */
SAY BATTLE_CRY1 ~[c-aws009] Archers to th' rear!~ [c-aws009] /* soundref 9 */
SAY BATTLE_CRY2 ~[c-aws010] Spellcasters die first!~ [c-aws010] /* soundref 10 */
SAY BATTLE_CRY3 ~[c-aws011] By Tymorra's Luck!~ [c-aws011] /* soundref 11 */
SAY BATTLE_CRY4 ~[c-aws012] By Sune's Bottom!~ [c-aws012] /* soundref 12 */
SAY BATTLE_CRY5 ~[c-aws013] Send 'em to Kelemvor's Scythe!~ [c-aws013] /* soundref 13 */
SAY DAMAGE ~[c-aws014]~ [c-aws014] /* soundref 18  ah...  */
SAY DYING ~[c-aws015]~ [c-aws015] /* soundref 19  aarrgh... */
SAY HURT ~[c-aws016] Send the rest o' them to hell for me...~ [c-aws016] /* soundref 20 */
SAY AREA_FOREST ~[c-aws017] Need less trees, more road. Too many places for enemies to hide.~ [c-aws017] /* soundref 21 */
SAY AREA_CITY ~[c-aws018] Trade time! Some trade, then some drinkin', then some sleep... or more drinkin'.~ [c-aws018] /* soundref 22 */
SAY AREA_DUNGEON ~[c-aws019] I gave up comfortable inns an' guardin' simple caravans to poke around this dank musty place. I'm a bloody idiot.~ [c-aws019] /* soundref 23 */
SAY AREA_DAY ~[c-aws020] Lathander's fat arse is up at last. 'Bout time he shed some light around here.~ [c-aws020] /* soundref 24 */
SAY AREA_NIGHT ~[c-aws021] Bloody dark. Good for coverin' enemies an' ambushes. Someone light a torch, eh?~ [c-aws021] /* soundref 25 */
SAY SELECT_COMMON1 ~[c-aws022] Yep?~ [c-aws022] /* soundref 26 */
SAY SELECT_COMMON2 ~[c-aws023] What's to be done?~ [c-aws023] /* soundref 27 */
SAY SELECT_COMMON3 ~[c-aws024] Do I needs lead?~ [c-aws024] /* soundref 28 */
SAY SELECT_COMMON4 ~[c-aws025] Aye?~ [c-aws025] /* soundref 29 */
SAY SELECT_COMMON5 ~[c-aws026] Yes?~ [c-aws026] /* soundref 30 */
SAY SELECT_COMMON6 ~[c-aws027] I'm listenin'.~ [c-aws027] /* soundref 31 */
SAY SELECT_ACTION1 ~[c-aws028] Got it.~ [c-aws028] /* soundref 32 */
SAY SELECT_ACTION2 ~[c-aws029] Sune's sweet cheeks, I heard.~ [c-aws029] /* soundref 33 */
SAY SELECT_ACTION3 ~[c-aws030] On it.~ [c-aws030] /* soundref 34 */
SAY SELECT_ACTION4 ~[c-aws031] Understood.~ [c-aws031] /* soundref 35 */
SAY SELECT_ACTION5 ~[c-aws032] Sune's Bosom, I'm movin', already!.~ [c-aws032] /* soundref 36 */
SAY SELECT_ACTION6 ~[c-aws033] Ilmater's Blood. I said I'd do it.~ [c-aws033] /* soundref 37 */
SAY SELECT_ACTION7 ~[c-aws034] Less talk, more action.~ [c-aws034] /* soundref 38 */
SAY SELECT_RARE1 ~[c-aws035] Watch where you point that thing.~ [c-aws035] /* soundref 63 */
SAY SELECT_RARE2 ~[c-aws036] Aye, I'm here.~ [c-aws036] /* soundref 64 */
SAY CRITICAL_HIT ~[c-aws037] Good.~ [c-aws037] /* soundref 65 */
SAY CRITICAL_MISS ~[c-aws038] Cyric's Black Heart!~ [c-aws038] /* soundref 66 */
SAY TARGET_IMMUNE ~[c-aws039] Bounced off. Damn.~ [c-aws039] /* soundref 67 */
SAY INVENTORY_FULL ~[c-aws040] I'm already carryin' more than my share.~ [c-aws040] /* soundref 68 */
SAY PICKED_POCKET ~[c-aws041] Hey, look what I found.~ [c-aws041] /* soundref 69 */
SAY HIDDEN_IN_SHADOWS ~[c-aws042] Huntin'...~ [c-aws042] /* soundref 70 */
SAY SPELL_DISRUPTED ~[c-aws043] Never did get that one right...~ [c-aws043] /* soundref 71 */
SAY SET_A_TRAP ~[c-aws044] Try that, you bugger.~ [c-aws044] /* soundref 72 */
SAY BIO ~[c-aranbio] When you ask him about his past, ARAN WHITEHAND grasps at a nearby twig to chew on. He explains that he grew up in a small independent family-run Coster plying the Trade Way and Coast Way from Waterdeep both north and south. Working as both Pen and Sword (scribe and fighting guard) made him attractive as an independent, since he could balance accounts, keep inventory, and still operate as a sellsword. A few campaigns with mercenary companies, a few battles, and lots of wandering about has brought him to Amn. He hastens to note that he is not the man to send in to negotiate anything, preferring to wield weapons rather than the spoken word - but if you want a trading contract written up, he's the right man for the job.~ [c-aran44]
/* OK, now let's set his dialog, script name, scripts, default portrait, and hair/skin for the default portraits... */
WRITE_ASCII 0x2cc ~C-ARAN~ #8 /* dialogue */
WRITE_ASCII 0x280 ~C-ARAN~ #32 /* DV */
WRITE_ASCII 0x248 ~C-ARAN~ #8 /*  override script */
WRITE_ASCII 0x0268 ~WTARSGT~ #8 /*  Creature script - Default  */
WRITE_ASCII 0x34  ~c-aranws~ #8  /* assign small portrait */
WRITE_ASCII 0x3c  ~c-aranwm~ #8  /* assign medium portrait */
WRITE_BYTE 0x2F 12 /* skin color (light carnation pink) */
WRITE_BYTE 0x32 3  /* hair color (light gold) */
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 1)) THEN BEGIN /* down-and-out Aran leather */
	SPRINT ~added_helm~ ~helm01~ // helmet
	SPRINT ~added_armor~ ~leat02~ // leather armor +1
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 1)) THEN BEGIN /* average Aran leather */
	SPRINT ~added_helm~ ~helm08~ // helmet
	SPRINT ~added_armor~ ~leat11~ // leather armor +2
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 1)) THEN BEGIN /* successful Aran leather */
	SPRINT ~added_helm~ ~helm09~ // helmet
	SPRINT ~added_armor~ ~leat12~ // leather armor +3	
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 2)) THEN BEGIN /* down-and-out Aran studded leather */
	SPRINT ~added_helm~ ~helm10~ // helmet
	SPRINT ~added_armor~ ~leat04~ // studded leather armor
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 2)) THEN BEGIN /* average Aran studded leather */
	SPRINT ~added_helm~ ~helm11~ // helmet
	SPRINT ~added_armor~ ~leat05~ // studded leather armor +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 2)) THEN BEGIN /* successful Aran studded leather */
	SPRINT ~added_helm~ ~helm12~ // helmet
	SPRINT ~added_armor~ ~leat15~ // studded leather armor +2
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 3)) THEN BEGIN /* down-and-out Aran chainmail */
	SPRINT ~added_helm~ ~helm01~ // helmet
	SPRINT ~added_armor~ ~chan01~ // chainmail
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 3)) THEN BEGIN /* average Aran chainmail */
	SPRINT ~added_helm~ ~helm08~ // helmet
	SPRINT ~added_armor~ ~chan02~ // chainmail +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 3)) THEN BEGIN /* successful Aran chainmail */
	SPRINT ~added_helm~ ~helm09~ // helmet
	SPRINT ~added_armor~ ~chan08~ // chainmail +2
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 4)) THEN BEGIN /* down-and-out Aran splint armor */
	SPRINT ~added_helm~ ~helm10~ // helmet
	SPRINT ~added_armor~ ~chan04~ // splint mail
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 4)) THEN BEGIN /* average Aran splint armor */
	SPRINT ~added_helm~ ~helm11~ // helmet
	SPRINT ~added_armor~ ~chan05~ // splint mail +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 4)) THEN BEGIN /* successful Aran splint armor */
	SPRINT ~added_helm~ ~helm12~ // helmet
	SPRINT ~added_armor~ ~chan08~ // chain mail +2 - Nythrun is right - no generic high end splint. Create custom item?
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_armor_choice% = 5)) THEN BEGIN /* down-and-out Aran plate mail */
	SPRINT ~added_helm~ ~helm01~ // helmet
	SPRINT ~added_armor~ ~plat01~ // plate mail armor AC 3
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_armor_choice% = 5)) THEN BEGIN /* average Aran */
	SPRINT ~added_helm~ ~helm08~ // helmet
	SPRINT ~added_armor~ ~plat10~ // plate mail +1 - looks better than 02, AC 2
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_armor_choice% = 5)) THEN BEGIN /* successful Aran */
	SPRINT ~added_helm~ ~helm09~ // helmet
	SPRINT ~added_armor~ ~plat04~ // full plate mail, AC 1
END // begin a new patch-if statement
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 1)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld05~ // large shield
	SPRINT ~added_weapon2~ ~dagg01~ // dagger
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 1)) THEN BEGIN /* average Aran */
	/* 2 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h05~ // long sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_weapon2~ ~dagg02~ // dagger +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 1)) THEN BEGIN /* successful Aran */
	/* 3 - 1 // Long Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h41~ // long sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_weapon2~ ~dagg15~ // dagger +2
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 2)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 2   Long Sword, Shield, Quarterstaff */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld05~ // large shield
	SPRINT ~added_weapon2~ ~staf01~ // quarterstaff
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 2)) THEN BEGIN /* average Aran */
	/* 2 - 2	Long Sword, Shield, Quarterstaff */
	SPRINT ~added_weapon1~ ~sw1h05~ // long sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_weapon2~ ~staf02~ // quarterstaff +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 2)) THEN BEGIN /* successful Aran */
	/* 3 - 2  Long Sword, Shield, Quarterstaff */
	SPRINT ~added_weapon1~ ~sw1h41~ // long sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_weapon2~ ~staf08~ // quarterstaff +3
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 3)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 3   Long Sword, Shield, Potions of healing */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword 
	SPRINT ~added_shield~ ~shld05~ // large shield
	SPRINT ~added_item~ ~potn52~ 
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 3)) THEN BEGIN /* average Aran */
	/* 2 - 3   Long Sword, Shield, Potions of healing */
	SPRINT ~added_weapon1~ ~sw1h05~ // long sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_item~ ~potn52~ 
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 3)) THEN BEGIN /* successful Aran */
	/* 3 - 3  Long Sword, Shield, Potions of healing */
	SPRINT ~added_weapon1~ ~sw1h41~ // long sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_item~ ~potn52~
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 4)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 4	Long Sword, Shield, Mace */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld05~ // large shield
	SPRINT ~added_weapon2~ ~blun04~ // mace 
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 4)) THEN BEGIN /* average Aran */
	/* 2 - 4   Long Sword, Shield, Mace */
	SPRINT ~added_weapon1~ ~sw1h05~ // long sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_weapon2~ ~blun05~ // mace +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 4)) THEN BEGIN /* successful Aran */
	/* 3 - 4   Long Sword, Shield, Mace */
	SPRINT ~added_weapon1~ ~sw1h41~ // long sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_weapon2~ ~blun21~ // mace +2
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 5)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 5  Long Sword, Shield, Flail */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword 
	SPRINT ~added_shield~ ~shld05~ // large shield 
	SPRINT ~added_weapon2~ ~blun02~ // flail 
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 5)) THEN BEGIN /* average Aran */
	/* 2 - 5  Long Sword, Shield, Flail */
	SPRINT ~added_weapon1~ ~sw1h05~ // long sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_weapon2~ ~blun02~ // flail
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 5)) THEN BEGIN /* successful Aran */
	/* 3 - 5  Long Sword, Shield, Flail */
	SPRINT ~added_weapon1~ ~sw1h41~ // long sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_weapon2~ ~blun03~ // flail +1
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 6)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 6   Long Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword 
	SPRINT ~added_shield~ ~shld05~ // large shield  
	SPRINT ~added_bow~ ~bow03~ // long bow
	SPRINT ~added_ammo~ ~arow01~ // arrow
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 6)) THEN BEGIN /* average Aran */
	/* 2 - 6  Long Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h05~ // long sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_bow~ ~bow04~ // long bow +1
	SPRINT ~added_ammo~ ~arow08~ // arrow of fire
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 6)) THEN BEGIN /* successful Aran */
	/* 3 - 6	Long Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h41~ // long sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_bow~ ~bow17~ // long bow +2
	SPRINT ~added_ammo~ ~arow02~ // arrow +1
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 7)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 7   Bastard Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h01~ // bastard sword  
	SPRINT ~added_shield~ ~shld05~ // large shield  
	SPRINT ~added_weapon2~ ~dagg01~ // dagger
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 7)) THEN BEGIN /* average Aran */
	/* 2 - 7	Bastard Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h02~ // bastard sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_weapon2~ ~dagg02~ // dagger +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 7)) THEN BEGIN /* successful Aran */
	/* 3 - 7   Bastard Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h42~ // bastard sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_weapon2~ ~dagg15~ // dagger +2
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 8)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 8   Bastard Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h01~ // bastard sword  
	SPRINT ~added_shield~ ~shld05~ // large shield  
	SPRINT ~added_bow~ ~bow03~ // long bow  
	SPRINT ~added_ammo~ ~arow01~ // arrow 
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 8)) THEN BEGIN /* average Aran */
	/* 2 - 8	Bastard Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h02~ // bastard sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_bow~ ~bow04~ // long bow +1
	SPRINT ~added_ammo~ ~arow08~ // arrow of fire
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 8)) THEN BEGIN /* successful Aran */
	/* 3 - 8   Bastard Sword, Shield, Long Bow  */
	SPRINT ~added_weapon1~ ~sw1h42~ // bastard sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_bow~ ~bow17~ // long bow +2
	SPRINT ~added_ammo~ ~arow02~ // arrow +1
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 9)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 9   Long Sword, Shield, Crossbow  */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld05~ // large shield
	SPRINT ~added_bow~ ~xbow04~ // light crossbow
	SPRINT ~added_ammo~ ~bolt02~ // +1 bolts
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 9)) THEN BEGIN /* average Aran */
	/* 2 - 9  Long Sword, Shield, Crossbow  */
	SPRINT ~added_weapon1~ ~sw1h05~ // long sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_bow~ ~xbow05~ // light crossbow +1
	SPRINT ~added_ammo~ ~bolt03~ // bolt of lightning
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 9)) THEN BEGIN /* successful Aran */
	/* 3 - 9  Long Sword, Shield, Crossbow  */
	SPRINT ~added_weapon1~ ~sw1h41~ // long sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_bow~ ~xbow09~ // light crossbow +2
	SPRINT ~added_ammo~ ~bolt06~ // +2 bolts
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 10)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 10   Short Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h07~ // short sword
	SPRINT ~added_shield~ ~shld05~ // large shield
	SPRINT ~added_weapon2~ ~dagg01~ // dagger
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 10)) THEN BEGIN /* average Aran */
	/* 2 - 10   Short Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h08~ // short sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_weapon2~ ~dagg02~ // dagger +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 10)) THEN BEGIN /* successful Aran */
	/* 3 - 10  Short Sword, Shield, Dagger */
	SPRINT ~added_weapon1~ ~sw1h09~ // short sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_weapon2~ ~dagg15~ // dagger +2
END ELSE
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 11)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 11   Short Sword, Shield, Crossbow */
	SPRINT ~added_weapon1~ ~sw1h07~ // short sword
	SPRINT ~added_shield~ ~shld05~ // large shield
	SPRINT ~added_bow~ ~xbow04~ // light crossbow
	SPRINT ~added_ammo~ ~bolt02~ // +1 bolts
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 11)) THEN BEGIN /* average Aran */
	/* 2 - 11  Short Sword, Shield, Crossbow */
	SPRINT ~added_weapon1~ ~sw1h08~ // short sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_bow~ ~xbow05~ // light crossbow +1
	SPRINT ~added_ammo~ ~bolt03~ // bolt of lightning
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 11)) THEN BEGIN /* successful Aran */
	/* 3 - 11  Short Sword, Shield, Crossbow */
	SPRINT ~added_weapon1~ ~sw1h09~ // short sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_bow~ ~xbow09~ // light crossbow +2
	SPRINT ~added_ammo~ ~bolt06~ // +2 bolts
END
PATCH_IF ((%aran_wealth% = 1) AND (%aran_weapon_set% = 12)) THEN BEGIN /* down-and-out Aran */
	/* 1 - 12   Long Sword, Shield, Hammer */
	SPRINT ~added_weapon1~ ~sw1h04~ // long sword
	SPRINT ~added_shield~ ~shld05~ // large shield
	SPRINT ~added_weapon2~ ~hamm01~ // war hammer
END ELSE
PATCH_IF ((%aran_wealth% = 2) AND (%aran_weapon_set% = 12)) THEN BEGIN /* average Aran */
	/* 2 - 12  Long Sword, Shield, Hammer */
	SPRINT ~added_weapon1~ ~sw1h05~ // long sword +1
	SPRINT ~added_shield~ ~shld04~ // medium shield +1
	SPRINT ~added_weapon2~ ~hamm02~ // war hammer +1
END ELSE
PATCH_IF ((%aran_wealth% = 3) AND (%aran_weapon_set% = 12)) THEN BEGIN /* successful Aran */
	/* 3 - 12 Long Sword, Shield, Hammer */
	SPRINT ~added_weapon1~ ~sw1h41~ // long sword +2
	SPRINT ~added_shield~ ~shld06~ // large shield +1
	SPRINT ~added_weapon2~ ~hamm08~ // war hammer +2
END // begin writing to the .cre file now
PATCH_IF (~%added_helm%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_helm%~ #0 #0 #0 IDENTIFIED HELMET
END
PATCH_IF (~%added_armor%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_armor%~ #0 #0 #0 IDENTIFIED ARMOR
END
PATCH_IF (~%added_shield%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_shield%~  #0  #0 #0 IDENTIFIED SHIELD
END
PATCH_IF (~%added_weapon1%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_weapon1%~ #0  #0 #0 IDENTIFIED WEAPON1 EQUIP
END
PATCH_IF (~%added_weapon2%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_weapon2%~ #0  #0 #0 IDENTIFIED WEAPON3
END
PATCH_IF (~%added_bow%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_bow%~  #0  #0 #0 IDENTIFIED WEAPON2
END
PATCH_IF (~%added_ammo%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_ammo%~ #20 #0 #0 IDENTIFIED QUIVER1
END
PATCH_IF (~%added_item%~ STR_CMP ~nothing~) THEN BEGIN
	ADD_CRE_ITEM ~%added_item%~ #5 #0 #0 IDENTIFIED QITEM1
END
END

So, there is only one more decision to make before we can check this off as completely done, forget about it, and move on. Do we recheck that "dagger and hammer even without proficiency" thing for the straight fighter build, in favor of something else, swapping in something more useful in actual in-game terms? On the one hand, the dagger fits the merc profile - 1 reach weapon, 1 CQB (Close Quatrers Combat) weapon. On the other hand, while a Dual-Class-thinking Aran might carry one, a dedicated "now and forever" fighter specializing in melee weapons might stick to another skillset - like developing a blunt weapon like a hammer for crushing those pesky skeletons. In both cases, the choice to include those was more role-playing than efficiency, as the folks who really want to specialize are probably going to SK or Level1 NPC him into what they need.

 

I have changed his default "No Choices" configuration to a better Army configuration -

 

BEGIN  ~Aran Whitehand, "No Choices Wanted" (Fighter)~
 FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~  
 REQUIRE_COMPONENT ~setup-testarea.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~
/* Set up the variables for a default .cre so BWP folks don't have to deal with READLN */
OUTER_SET ~aran_wealth~ = 2 // experienced mercenary  with some resources	
OUTER_SET ~aran_weapon_set~ = 6 // Long Sword, Shield, Long Bow
OUTER_SET ~aran_armor_choice~ = 4 // splint 	
/* Patch the .cre */
COPY ~testarea/c-arnftr.cre~ ~override/c-aran7.cre~
	  PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN
		LAUNCH_PATCH_MACRO ~aran_cre_setup~
	  END

... but for the install choice for Soldier, I will have to think about it. Extending the code from this state and making a few quick swap-ins are really simple. The only thing to avoid now is giving too many confusing choices for players who really want to just get rolling.

Link to comment
The only thing to avoid now is giving too many confusing choices for players who really want to just get rolling.
Heh, I think you passed that point already ;). But you could offer an "author's choice" option that expedites matters - see how BG2 Tweaks handles "Cam's House Rules" for example.
Link to comment
action-macro_test.PNG

 

Unfortunately this highlights the main downfall in users (or WeiDU) - only small percentage people will read that; most will just give up ;)

 

The process as a whole is fine though; I've always been keen on maximum user input! Next steps to consider, perhaps:

+) Randomize the item layout (rather than down-and-out always giving the same equipment, let it vary slightly - then let the user determine the percentage of each variance!)

+) Randomize (within reason) the starting area

+) Randomize the portrait

+) Randomize the character name ;)

+) And if you really want to get funky, have a couple of different personality aspects (i.e. randomize some of the dialog to emphasize different traits)

 

However, you then run into problems with dialog and back-story, and your character can look schizophrenic, and ultimately it's all for naught in terms of RP, hence:

 

Aran's not eaten for 4 days rather than sell his sword...

Aran: What's that <CHARNAME> you'd like to use it... well, ok

Aran: Now you want to sell it? Well... I guess so

Aran: Oh - thanks for buying it back! You must have seen how upset I was, having my prized sword given away and having to use my fists (when you even let me fight - usually you just leave me half a league away on the other side of the area)

Aran: Wait - no! Now you're just dropping it on the floor out here in the middle of no-where? Man, you're just heartless, that's downright cruel!

Link to comment

I agree about equipment with Igi, 99,9% of players probably don't need so many choices and they will blindly press Y/Y/Y and saying "Damn, I'm installing NPC not a Total Conversion". Especially when you need to re-install everything few times, that's going to be a pain in the ass. Still, randomising some equipment can be a nice thing.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...