Jump to content

Search the Community

Showing results for tags 'ACTION_READLN'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General Discussion
    • G3 News and Announcements
    • Infinity Engine Modding News
    • General Mod Discussion
    • Fan Fiction
    • Noobermeet
  • Tools & Resources
    • DLTCEP
    • GemRB
    • The Gibberlings Three Debugging Suite for BG2
    • IESDP Updates and Info
    • Modding How-Tos and Tutorials
    • Modding Q&A
    • Multi-Install Tool
    • Widescreen Mod
  • Released Projects
    • Miscellaneous Released Mods
    • Ajantis
    • Alternatives
    • Amber
    • Angelo
    • Ascension
    • Auren Aseph
    • BG1 NPC Project
    • Baldur's Gate Mini Quests and Encounters
    • The Beaurin Legacy
    • BG2 Fixpack - General Discussion
    • Calin
    • The Calling
    • Cirerrek's AI Scripts
    • Coran's Friendship Mod
    • Crossmod Banter Pack
    • Divine Remix
    • Enhanced Edition Trilogy
    • Evandra
    • Full Plate & Packing Steel
    • Garrick's Infatuation
    • Gavin
    • The Gibberlings Three Anniversary Mod
    • Glam's NPC Pack
    • Icewind Dale Mod Roundup
    • Icewind Dale in Baldur's Gate II
    • Imoen 4 Ever
    • Item Randomiser
    • Item Revisions
    • IWD2 NPC Project
    • IWDification
    • Keeping Yoshimo
    • Kivan and Deheriana Companions for BG2
    • Level One NPCs
    • Mur'Neth
    • NPC Kitpack
    • NPC Strongholds
    • NPC Tweak for BG2
    • Oversight
    • Romantic Encounters (BG)
    • Romantic Encounters (BG2)
    • Sarah
    • Song and Silence
    • Spell Revisions
    • Sword and Fist
    • Sword Coast Stratagems
    • Tweaks Anthology Forum
    • Tyris Flare
    • Wheels of Prophecy
    • Yoshimo's Remorse
  • Unreleased Projects
    • Aklon
    • Baldur's Gate: Shadow Hand TC
    • Aran Whitehand
    • Delainy
    • IWD Tutu
    • Kit Revisions
    • Inactive Projects
  • NWN2 Modding
  • Mod Workrooms

Categories

  • NPCs
  • Quests and Others
  • Tweaks & Fixes
  • Items/Kits/Spells
  • Portrait Packs
  • Mini Mods
  • Tools
  • In Progress

Categories

  • Fixes
  • Items
  • Kits
  • NPCs
  • Quests
  • Spells
  • Tweaks
  • Other
  • Tools

Product Groups

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Discord


Website URL


Skype


AIM


MSN


ICQ


Yahoo


Jabber


Location


Interests


Mods Worked On

Found 3 results

  1. No time to type much; will fill in more details later. Short course: Timers are set for FTs, LTs, NPC-Initiated flirts. Staggering content so they don't bunch up is relatively simple... until you give players choices on how long the timers work. Unsolvable problem in the long run, as starting/stopping flirts, starting/stopping romances, and talks that require specific conditions to fire will all throw them off, and the engine itelf seems to like to randomly wait much longer than the actual established timer (observation only, not proven). But, a partial solution, coded and installed in Aran's latest pre-Beta stuff: set everything up using OUTER_SET depending on the player choice. in c-aran.baf CODE /* ROMANCE TALKS */ /* * Romance Match and Initiation (He is not picky...) * One new thing here - Aran is ok if a friend switches genders - * but not so much on the romance side. So, we add a blocking variable * to make sure nothing progresses while that silly Girdle is in place. * He can have some special lines to play during the FT sequence on that. */ IF Global("c-aranmatch","GLOBAL",0) // Not evaluated Gender(Player1,FEMALE) // Player1 is female InParty(Myself) // Aran is here !StateCheck(Myself,CD_STATE_NOTVALID) // Aran is ok !StateCheck(Player1,CD_STATE_NOTVALID) // Player1 is ok !HasItemEquiped("belt05",Player1) // Girdle of sex change not on Player1 THEN RESPONSE #100 // 100% of the time SetGlobal("c-aranmatch","GLOBAL",1) // Matched SetGlobal("c-aranrom","GLOBAL",1) // Aran is interested END /* Berelinde: Please consider staggering your flirts and your dialogues. Flirts are nice when they break up long stretches between LTs. * cmorgan: OK, great idea - let's make it really complicated, and base the first timer on the player's choice of overall speed of progress... */ IF Global("c-aranmatch","GLOBAL",1) // Matched Global("c-aransetupromtimers","GLOBAL",0) // Not evaluated GlobalGT("c-aranfriendbg2","GLOBAL",5) // FT 3 has played Gender(Player1,FEMALE) // Player1 is female InParty(Myself) // Aran is here !StateCheck(Myself,CD_STATE_NOTVALID) // Aran is ok !StateCheck(Player1,CD_STATE_NOTVALID) // Player1 is ok !HasItemEquiped("belt05",Player1) // Girdle of sex change not on Player1 THEN RESPONSE #100 SetGlobal("c-aransetupromtimers","GLOBAL",1) RealSetGlobalTimer("c-aranromtimer","GLOBAL",%choseninitialrom%) // Minimum Real Time until first LT RealSetGlobalTimer("c-aranflirttimer","GLOBAL",%choseninitialflirt%) // Tee up flirt timer END in setup-aranw.tp2 CODE OUTER_FOR( aran_timer_choice = 0; ~%aran_timer_choice%~ STRING_COMPARE_REGEXP ~^[12]$~; )BEGIN PRINT ~Set Talk and Flirt Timers [1] Install Default Timers [2] Customize Timers Please type 1 or 2 and press enter.~ ACTION_READLN aran_timer_choice END // of O_F ACTION_IF ("aran_timer_choice" = 1) THEN BEGIN /* .ids patching with player choice: set talk timers */ APPEND ~gtimes.ids~ ~3600 ARAN_FTT~ APPEND ~gtimes.ids~ ~3600 ARAN_LTT~ APPEND ~gtimes.ids~ ~3600 ARAN_FLIRT~ PRINT ~Speed: minimum 1 hour real time between dialogues (Default, recommended)~ OUTER_SET choseninitialrom = 2400 PRINT ~Initial Lovetalk offset by 40 minutes~ OUTER_SET choseninitialflirt = 1200 PRINT ~Initial NPC-Initiated Flirt offset by 20 minutes~ PRINT ~So if you are in a romance with him and never stop the romance, after the lovetalks start (after friendship talk 3), the timer sequence will start hourly FT, NPC Flirt 20 minutes later, and RT 20 minutes after that, then 20 minutes later the next FT fires. Please note that the timers are not exact, and variations within the game may mean bursts of activity followed by long waits.~ END ACTION_IF ("aran_timer_choice" = 2) THEN BEGIN PRINT ~Select Aran's Talk timers:~ PRINT ~Please choose one of the following: [1] approximately 1 hour real time minimum between friendship dialogues (recommended, default) [2] approximately 15 minutes real time minimum between friendship dialogues [3] approximately 30 minutes real time minimum between friendship dialogues [4] approximately 45 minutes real time minimum between friendship dialogues [5] approximately 1 hour 30 minutes real time minimum friendship between dialogues [6] approximately 2 hours real time minimum between friendshipdialogues~ OUTER_SPRINT ~friendshiptimer~ ~placeholder_value~ OUTER_WHILE (!(IS_AN_INT ~friendshiptimer~) OR (~friendshiptimer~ > 0x6) OR (~friendshiptimer~ < 0x1)) BEGIN PRINT ~Please type 1, 2, 3, 4, 5 or 6 and press enter.~ ACTION_READLN ~friendshiptimer~ END ACTION_IF ("friendshiptimer" = 1) THEN BEGIN APPEND ~gtimes.ids~ ~3600 ARAN_FTT~ APPEND ~gtimes.ids~ ~3600 ARAN_LTT~ APPEND ~gtimes.ids~ ~3600 ARAN_FLIRT~ PRINT ~Speed: minimum 1 hour real time between dialogues (Default, recommended)~ OUTER_SET choseninitialrom = 2400 PRINT ~Initial Lovetalk offset by 40 minutes~ OUTER_SET choseninitialflirt = 1200 PRINT ~Initial NPC-Initiated Flirt offset by 20 minutes~ PRINT ~So if you are in a romance with him and never stop the romance, after the lovetalks start (after friendship talk 3), the timer sequence will start hourly FT, NPC Flirt 20 minutes later, and RT 20 minutes after that, then 20 minutes later the next FT fires. Please note that the timers are not exact, and variations within the game may mean bursts of activity followed by long waits.~ END ACTION_IF ("friendshiptimer" = 2) THEN BEGIN APPEND ~gtimes.ids~ ~900 ARAN_FTT~ APPEND ~gtimes.ids~ ~900 ARAN_LTT~ APPEND ~gtimes.ids~ ~900 ARAN_FLIRT~ PRINT ~Speed: minimum 15 minutes real time between dialogues~ OUTER_SET choseninitialrom = 600 PRINT ~Initial Lovetalk offset by 10 minutes~ OUTER_SET choseninitialflirt = 300 PRINT ~Initial NPC-Initiated Flirt offset by 5 minutes~ PRINT ~So if you are in a romance with him and never stop the romance, after the lovetalks start (after friendship talk 3), the timer sequence will start 15 minute FT, NPC-initiated Flirt 5 minutes later, and RT 5 minutes after that, then 5 minutes later the next FT. Please note that the timers are not exact, and variations within the game may mean bursts of activity followed by long waits... especially when you run out of timered content!~ END ACTION_IF ("friendshiptimer" = 3) THEN BEGIN APPEND ~gtimes.ids~ ~1800 ARAN_FTT~ APPEND ~gtimes.ids~ ~1800 ARAN_LTT~ APPEND ~gtimes.ids~ ~1800 ARAN_FLIRT~ PRINT ~Speed: minimum 30 minutes real time between dialogues~ OUTER_SET choseninitialrom = 1200 PRINT ~Initial Lovetalk offset by 20 minutes~ OUTER_SET choseninitialflirt = 600 PRINT ~Initial NPC-Initiated Flirt offset by 10 minutes~ PRINT ~So if you are in a romance with him and never stop the romance, after the lovetalks start (after friendship talk 3), the timer sequence will start 30 minute FT, NPC-initiated Flirt 10 minutes later, and RT 10 minutes after that, then 10 minutes later the next FT. Please note that the timers are not exact, and variations within the game may mean bursts of activity followed by long waits... especially when you run out of timered content!~ END ACTION_IF ("friendshiptimer" = 4) THEN BEGIN APPEND ~gtimes.ids~ ~2700 ARAN_FTT~ APPEND ~gtimes.ids~ ~2700 ARAN_LTT~ APPEND ~gtimes.ids~ ~2700 ARAN_FLIRT~ PRINT ~Speed: minimum 45 minutes real time between dialogues~ OUTER_SET choseninitialrom = 1800 PRINT ~Initial Lovetalk offset by 30 minutes~ OUTER_SET choseninitialflirt = 900 PRINT ~Initial NPC-Initiated Flirt offset by 15 minutes~ PRINT ~So if you are in a romance with him and never stop the romance, after the lovetalks start (after friendship talk 3), the timer sequence will start 45 minute FT, NPC-initiated Flirt 15 minutes later, and RT 15 minutes after that, then 15 minutes later the next FT. Please note that the timers are not exact, and variations within the game may mean bursts of activity followed by long waits... especially when you run out of timered content!~ END ACTION_IF ("friendshiptimer" = 5) THEN BEGIN APPEND ~gtimes.ids~ ~5400 ARAN_FTT~ APPEND ~gtimes.ids~ ~5400 ARAN_LTT~ APPEND ~gtimes.ids~ ~5400 ARAN_FLIRT~ PRINT ~Speed: minimum 1 hour 30 minutes real time between dialogues~ OUTER_SET choseninitialrom = 3600 PRINT ~Initial Lovetalk offset by 60 minutes~ OUTER_SET choseninitialflirt = 1800 PRINT ~Initial NPC-Initiated Flirt offset by 30 minutes~ PRINT ~So if you are in a romance with him and never stop the romance, after the lovetalks start (after friendship talk 3), the timer sequence will start 90 minute FT, NPC-initiated Flirt 30 minutes later, and RT 30 minutes after that, then 30 minutes later the next FT. Please note that the timers are not exact, and variations within the game may mean bursts of activity followed by long waits... especially when you run out of timered content!~ END ACTION_IF ("friendshiptimer" = 6) THEN BEGIN APPEND ~gtimes.ids~ ~7200 ARAN_FTT~ APPEND ~gtimes.ids~ ~7200 ARAN_LTT~ APPEND ~gtimes.ids~ ~7200 ARAN_FLIRT~ PRINT ~Speed: minimum 2 hours real time between dialogues~ OUTER_SET choseninitialrom = 4800 PRINT ~Initial Lovetalk offset by 80 minutes~ OUTER_SET choseninitialflirt = 2400 PRINT ~Initial NPC-Initiated Flirt offset by 40 minutes~ PRINT ~So if you are in a romance with him and never stop the romance, after the lovetalks start (after friendship talk 3), the timer sequence will start 120 minute FT, NPC-initiated Flirt 40 minutes later, and RT 40 minutes after that, then 40 minutes later the next FT. Please note that the timers are not exact, and variations within the game may mean bursts of activity followed by long waits... especially when you run out of timered content!~ END END and when compiling the two scripts that have blocks like this in the .tp2, farther down, use CODE COMPILE EVALUATE_BUFFER ~aranw/baf/c-aran.baf~ // override script ACTION_IF FILE_EXISTS_IN_GAME ~ar6111.are~ THEN BEGIN // ToB dialog file PRINT ~Installing ToB scripts...~ COMPILE EVALUATE_BUFFER ~aranw/baf/c-arn25.baf~ // joined ToB script The result of timer choices are hidden in the PRINT stuff, detailed out for anyone who looks at the .DEBUG file.
  2. In <<this thread>> we were tracing ways of adding in install choices for players. in the meantime, the bigg has come up with some new WeiDU possibilities that allow some interesting ways of "swinging" code into separate branches based on setting/reading variables and matching against their values. Basically, the same kind of thinking that PATCH_IF statements use, but on a larger scale. Never one to do something and let it just sit, let's recast the player choices on install using this new method. He has a bunch of these new commands that might be interesting to heavy coders, but for gadabouts like me, ACTION_MATCH is the simplest to understand and shows basically what he is allowing in various forms by supporting this kind of code behavior. note: Doing this is fun for me, but in this particular case it is hitting a fly with an ICBM. I suspect other code which relies on massive internal checking and patching based on a whole series of variables could be cleaned up using this kind of construction, done better - the code below is very clunky and linear, and does not take advantage of the heaviest potential gains, where separate 'building blocks" could be swapped in based on multiple matches or "guarding conditions" or whatever the big Boyz and Girlz use for terminology. Basically, stuff like IF (A) AND (NOT B) AND © AND (D) AND (NOT E) IF (NOT A) AND (NOT B) AND © AND (D) AND (NOT E) IF (NOT A) AND (B) AND © AND (NOT D) AND (NOT E) etc. etc. can be set up with a series of individual matched blocks of code, and put into play that way rather than creating a whole series of individual 'cases'. The end Result of This As Applied To Aran CODE BEGIN ~Aran Whitehand, "No Choices Wanted" (Fighter)~ FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~ REQUIRE_COMPONENT ~setup-aranw.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~ OUTER_SET class_choice = 5 LAUNCH_ACTION_MACRO customized_cre_choice ACTION_IF FILE_EXISTS_IN_GAME ~ar6111.are~ THEN BEGIN // ToB .cre file COPY_EXISTING ~c-aran7.cre~ ~override/c-aran13.cre~ WRITE_LONG 0x18 2500000 // current XP 2500000, ToB start WRITE_ASCII 0x2cc ~C-ARN25A~ #8 /* dialogue */ WRITE_ASCII 0x280 ~C-ARAN~ #32 /* DV */ WRITE_ASCII 0x248 ~C-ARN25~ #8 /* override script */ END BEGIN ~Aran Whitehand, Mage Dual-Class stats configuration (Tinker)~ FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~ REQUIRE_COMPONENT ~setup-aranw.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~ OUTER_SET class_choice = 1 LAUNCH_ACTION_MACRO customized_cre_choice ACTION_IF FILE_EXISTS_IN_GAME ~ar6111.are~ THEN BEGIN // ToB .cre file COPY_EXISTING ~c-aran7.cre~ ~override/c-aran13.cre~ WRITE_LONG 0x18 2500000 // current XP 2500000, ToB start WRITE_ASCII 0x2cc ~C-ARN25A~ #8 /* dialogue */ WRITE_ASCII 0x280 ~C-ARAN~ #32 /* DV */ WRITE_ASCII 0x248 ~C-ARN25~ #8 /* override script */ END BEGIN ~Aran Whitehand, Cleric Dual-Class stats configuration (Tailor)~ FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~ REQUIRE_COMPONENT ~setup-aranw.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~ OUTER_SET class_choice = 2 LAUNCH_ACTION_MACRO customized_cre_choice ACTION_IF FILE_EXISTS_IN_GAME ~ar6111.are~ THEN BEGIN // ToB .cre file COPY_EXISTING ~c-aran7.cre~ ~override/c-aran13.cre~ WRITE_LONG 0x18 2500000 // current XP 2500000, ToB start WRITE_ASCII 0x2cc ~C-ARN25A~ #8 /* dialogue */ WRITE_ASCII 0x280 ~C-ARAN~ #32 /* DV */ WRITE_ASCII 0x248 ~C-ARN25~ #8 /* override script */ END BEGIN ~Aran Whitehand, Fighter stats configuration (Soldier)~ FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~ REQUIRE_COMPONENT ~setup-aranw.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~ OUTER_SET class_choice = 3 LAUNCH_ACTION_MACRO customized_cre_choice ACTION_IF FILE_EXISTS_IN_GAME ~ar6111.are~ THEN BEGIN // ToB .cre file COPY_EXISTING ~c-aran7.cre~ ~override/c-aran13.cre~ WRITE_LONG 0x18 2500000 // current XP 2500000, ToB start WRITE_ASCII 0x2cc ~C-ARN25A~ #8 /* dialogue */ WRITE_ASCII 0x280 ~C-ARAN~ #32 /* DV */ WRITE_ASCII 0x248 ~C-ARN25~ #8 /* override script */ END BEGIN ~Aran Whitehand, Thief Dual-Class stats configuration (Spy)~ FORCED_SUBCOMPONENT ~Choose Which Aran Configuration to install...~ REQUIRE_COMPONENT ~setup-aranw.tp2~ ~0~ ~Aran Whitehand must be installed for this to work.~ OUTER_SET class_choice = 4 LAUNCH_ACTION_MACRO customized_cre_choice ACTION_IF FILE_EXISTS_IN_GAME ~ar6111.are~ THEN BEGIN // ToB .cre file COPY_EXISTING ~c-aran7.cre~ ~override/c-aran13.cre~ WRITE_LONG 0x18 2500000 // current XP 2500000, ToB start WRITE_ASCII 0x2cc ~C-ARN25A~ #8 /* dialogue */ WRITE_ASCII 0x280 ~C-ARAN~ #32 /* DV */ WRITE_ASCII 0x248 ~C-ARN25~ #8 /* override script */ END For an "allow me to choose" subcomponent, or we let players just skip all the crap: ACTION_READLN and Other Macros as Building Blocks Instead of the code in the previous thread, first we pull everything we can out into discreet blocks and turn them into "get information from the user" macros and "work on the .cre" macros. That allows us to individualize the class choice ones, change the order, and most of all get everything set up, then copy the .cre once and apply all the changes in one swoop. CODE DEFINE_ACTION_MACRO aran_wealth_selection BEGIN OUTER_FOR( aran_wealth = 0; ~%aran_wealth%~ STRING_COMPARE_REGEXP ~^[123]$~; )BEGIN 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. Please select 1, 2, or 3 and press enter.~ ACTION_READLN aran_wealth END END DEFINE_ACTION_MACRO aran_armor_choice BEGIN OUTER_FOR( aran_armor_choice = 0; ~%aran_armor_choice%~ STRING_COMPARE_REGEXP ~^[12345]$~; )BEGIN PRINT ~Please choose from the following starting armor choices for Aran: [1] Leather [2] Studded Leather [3] Chain [4] Splint [5] Plate Please select 1, 2, 3, 4, or 5 and press enter.~ ACTION_READLN aran_armor_choice END END DEFINE_ACTION_MACRO aran_mage_choice BEGIN OUTER_FOR( weapon_choices = 0; ~%weapon_choices%~ STRING_COMPARE_REGEXP ~^[123]$~; )BEGIN // one way of setting up for READLN 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 and press enter: [1] Long Sword, Shield, Dagger [2] Long Sword, Shield, Quarterstaff [3] Long Sword, Shield, Potions of healing~ ACTION_READLN ~weapon_choices~ END END DEFINE_ACTION_MACRO aran_cleric_choice BEGIN OUTER_FOR( weapon_choices = 0; ~%weapon_choices%~ STRING_COMPARE_REGEXP ~^[1234]$~; )BEGIN // one way of setting up for READLN 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~ ACTION_READLN ~weapon_choices~ END END DEFINE_ACTION_MACRO aran_fighter_choice BEGIN OUTER_FOR( weapon_choices = 0; ~%weapon_choices%~ STRING_COMPARE_REGEXP ~^[123456]$~; )BEGIN // one way of setting up for READLN 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~ ACTION_READLN ~weapon_choices~ END END DEFINE_ACTION_MACRO aran_thief_choice BEGIN OUTER_FOR( weapon_choices = 0; ~%weapon_choices%~ STRING_COMPARE_REGEXP ~^[12345]$~; )BEGIN // one way of setting up for READLN 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~ ACTION_READLN ~weapon_choices~ END END Now, we have user choices defined, and we can apply them in a new macro, customized_cre_choice. Here, we are looking to "swing" the code into different branches based on the class, chosen, because we are working with two unique building blocks. While wealth and armor are the same for each, we need to bring a different base .cre into play, and the proficiency set (and weapons choices) vary by the base .cre chosen. So we need to a. look at what the player chose, b. swing a block of code temporarily down an alternate track based on that c. remind the player what they chose (and list it in the .DEBUG for troubleshooting) d. then bring everything back to order. So, CODE ACTION_MATCH ~var~ WITH 1 BEGIN <<do case 1 >> END 2 BEGIN <<or else do case 2 >> END DEFAULT <<or if neither 11 nor 2, then do case 3/default actions >> END In Aran's implementation (tested and works; horribly clumsy though), instead of talking I commented stuff: CODE /* Installing one of the 5 forced subcomponents does OUTER_SET class_choice = 1 or 2 or 3 or 4 or 5 (5 = no player choices wanted). */ DEFINE_ACTION_MACRO customized_cre_choice BEGIN // define the instruction set to be called in other places ACTION_MATCH ~%class_choice%~ // the thing we are checking to allow the code to "swing" to variants, the "case" WITH 1 // the first check. If %class_choice% = 1, the next stuff will work, else check the next BEGIN /* mage dual-class build */ LAUNCH_ACTION_MACRO aran_wealth_selection LAUNCH_ACTION_MACRO aran_mage_choice LAUNCH_ACTION_MACRO aran_armor_choice ACTION_MATCH ~%aran_wealth%~ // the thing we are checking to allow the code to "swing" to variants, the "case" WITH 3 BEGIN PRINT ~Aran is successful~ END 2 BEGIN PRINT ~Aran is of average wealth~ END DEFAULT PRINT ~Aran is down-and-out poor~ END ACTION_MATCH ~%aran_armor_choice%~ // the thing we are checking to allow the code to "swing" to variants, the "case" WITH 1 BEGIN PRINT ~Leather Armor~ END 2 BEGIN PRINT ~Studded Leather Armor~ END 3 BEGIN PRINT ~Chain Mail~ END 4 BEGIN PRINT ~Splint Mail~ END DEFAULT PRINT ~Plate Armor~ END /* we are using READLN values to set a variable - the mod range of possible combos is 1 to 15 inclusive, so we can't just read it directly */ ACTION_MATCH ~%weapon_choices%~ // check this value WITH // against the following 3 cases, so 1 BEGIN OUTER_SET ~aran_weapon_set~ = 1 // Long Sword, Shield, Dagger PRINT ~Long Sword, Shield, Dagger~ PRINT ~~ END 2 BEGIN OUTER_SET ~aran_weapon_set~ = 2 // Long Sword, Shield, Quarterstaff PRINT ~Long Sword, Shield, Quarterstaff~ PRINT ~~ END 3 BEGIN OUTER_SET ~aran_weapon_set~ = 3 // Long Sword, Shield, Potions of healing PRINT ~Long Sword, Shield, Potions of Healing~ PRINT ~~ END DEFAULT // this should never run, but as an emergency fallback OUTER_SET ~aran_weapon_set~ = 6 // Long Sword, Shield, Long Bow PRINT ~Long Sword, Shield, Long Bow~ PRINT ~~ END COPY ~aranw/cre/c-arnmge.cre~ ~override/c-aran7.cre~ // copy the base .cre into the game, and LAUNCH_PATCH_MACRO ~aran_cre_setup~ // patch in player choices using this pre-defined code END // of dual-to-mage swing 2 // the second check. If %class_choice% = 2, the next stuff will work, else check the next BEGIN /* cleric dual-class build */ LAUNCH_ACTION_MACRO aran_wealth_selection LAUNCH_ACTION_MACRO aran_cleric_choice LAUNCH_ACTION_MACRO aran_armor_choice ACTION_MATCH ~%aran_wealth%~ // the thing we are checking to allow the code to "swing" to variants, the "case" WITH 3 BEGIN PRINT ~Aran is successful~ END 2 BEGIN PRINT ~Aran is of average wealth~ END DEFAULT PRINT ~Aran is down-and-out poor~ END ACTION_MATCH ~%aran_armor_choice%~ // the thing we are checking to allow the code to "swing" to variants, the "case" WITH 1 BEGIN PRINT ~Leather Armor~ END 2 BEGIN PRINT ~Studded Leather Armor~ END 3 BEGIN PRINT ~Chain Mail~ END 4 BEGIN PRINT ~Splint Mail~ END DEFAULT PRINT ~Plate Armor~ END ACTION_MATCH ~%weapon_choices%~ // check this value WITH // against the following 3 cases, with 4 or anything else defaulting to a '"standard choice" 1 BEGIN OUTER_SET ~aran_weapon_set~ = 4 // Long Sword, Shield, Mace PRINT ~Long Sword, Shield, Mace~ PRINT ~~ END 2 BEGIN OUTER_SET ~aran_weapon_set~ = 2 // Long Sword, Shield, Quarterstaff PRINT ~Long Sword, Shield, Mace~ PRINT ~~ END 3 BEGIN OUTER_SET ~aran_weapon_set~ = 12 // Long Sword, Shield, Hammer PRINT ~Long Sword, Shield, Mace~ PRINT ~~ END DEFAULT // this will run on 4, or as an emergency fallback OUTER_SET ~aran_weapon_set~ = 5 // Long Sword, Shield, Flail PRINT ~Long Sword, Shield, Flail~ PRINT ~~ END COPY ~aranw/media/c-arnclr.cre~ ~override/c-aran7.cre~ // the cleric stat L7 .cre LAUNCH_PATCH_MACRO ~aran_cre_setup~ // patch in player choices using this pre-defined code END // of dual-to-cleric swing 3 // the third check. If %class_choice% = 3, the next stuff will work, else check the next BEGIN /* fighter single-class build */ LAUNCH_ACTION_MACRO aran_wealth_selection LAUNCH_ACTION_MACRO aran_fighter_choice LAUNCH_ACTION_MACRO aran_armor_choice ACTION_MATCH ~%aran_wealth%~ // the thing we are checking to allow the code to "swing" to variants, the "case" WITH 3 BEGIN PRINT ~Aran is successful~ END 2 BEGIN PRINT ~Aran is of average wealth~ END DEFAULT PRINT ~Aran is down-and-out poor~ END ACTION_MATCH ~%aran_armor_choice%~ // the thing we are checking to allow the code to "swing" to variants, the "case" WITH 1 BEGIN PRINT ~Leather Armor~ END 2 BEGIN PRINT ~Studded Leather Armor~ END 3 BEGIN PRINT ~Chain Mail~ END 4 BEGIN PRINT ~Splint Mail~ END DEFAULT PRINT ~Plate Armor~ END ACTION_MATCH ~%weapon_choices%~ // check this value WITH // against the following 3 cases, with 4 or anything else defaulting to a '"standard choice" 1 BEGIN OUTER_SET ~aran_weapon_set~ = 1 // Long Sword, Shield, Dagger PRINT ~Long Sword, Shield, Dagger~ PRINT ~~ END 2 BEGIN OUTER_SET ~aran_weapon_set~ = 6 // Long Sword, Shield, Long Bow PRINT ~Long Sword, Shield, Long Bow~ PRINT ~~ END 3 BEGIN OUTER_SET ~aran_weapon_set~ = 3 // Long Sword, Shield, Potions of healing PRINT ~Long Sword, Shield, Potions of healing~ PRINT ~~ END 4 BEGIN OUTER_SET ~aran_weapon_set~ = 7 // Bastard Sword, Shield, Dagger PRINT ~Bastard Sword, Shield, Dagger~ PRINT ~~ END 5 BEGIN OUTER_SET ~aran_weapon_set~ = 8 // Bastard Sword, Shield, Long Bow PRINT ~Bastard Sword, Shield, Long Bow~ PRINT ~~ END DEFAULT // this will run on 6, or as an emergency fallback OUTER_SET ~aran_weapon_set~ = 12 // Long Sword, Shield, Hammer PRINT ~Long Sword, Shield, Hammer~ PRINT ~~ END COPY ~aranw/cre/c-arnftr.cre~ ~override/c-aran7.cre~ // the fighter stat L7 .cre LAUNCH_PATCH_MACRO ~aran_cre_setup~ // patch in player choices using this pre-defined code END // of just-a-fighter swing 4 // the second check. If %class_choice% = 4, the next stuff will work, else check the next BEGIN /* thief dual-class build */ LAUNCH_ACTION_MACRO aran_wealth_selection LAUNCH_ACTION_MACRO aran_thief_choice LAUNCH_ACTION_MACRO aran_armor_choice ACTION_MATCH ~%aran_wealth%~ // the thing we are checking to allow the code to "swing" to variants, the "case" WITH 3 BEGIN PRINT ~Aran is successful~ END 2 BEGIN PRINT ~Aran is of average wealth~ END DEFAULT PRINT ~Aran is down-and-out poor~ END ACTION_MATCH ~%aran_armor_choice%~ // the thing we are checking to allow the code to "swing" to variants, the "case" WITH 1 BEGIN PRINT ~Leather Armor~ END 2 BEGIN PRINT ~Studded Leather Armor~ END 3 BEGIN PRINT ~Chain Mail~ END 4 BEGIN PRINT ~Splint Mail~ END DEFAULT PRINT ~Plate Armor~ END ACTION_MATCH ~%weapon_choices%~ // check this value WITH // against the following 3 cases, with 4 or anything else defaulting to a '"standard choice" 1 BEGIN OUTER_SET ~aran_weapon_set~ = 1 // Long Sword, Shield, Dagger PRINT ~Long Sword, Shield, Dagger~ PRINT ~~ END 2 BEGIN OUTER_SET ~aran_weapon_set~ = 9 // Long Sword, Shield, Crossbow PRINT ~Long Sword, Shield, Crossbow~ PRINT ~~ END 3 BEGIN OUTER_SET ~aran_weapon_set~ = 3 // Long Sword, Shield, Potions of healing PRINT ~Long Sword, Shield, Potions of healing~ PRINT ~~ END 4 BEGIN OUTER_SET ~aran_weapon_set~ = 10 // Short Sword, Shield, Dagger PRINT ~Short Sword, Shield, Dagger~ PRINT ~~ END DEFAULT // this will run on 5, or as an emergency fallback OUTER_SET ~aran_weapon_set~ = 11 // Short Sword, Shield, Crossbow PRINT ~Short Sword, Shield, Crossbow~ PRINT ~~ END COPY ~aranw/cre/c-arnthf.cre~ ~override/c-aran7.cre~ // the thief stat L7 .cre LAUNCH_PATCH_MACRO ~aran_cre_setup~ // patch in player choices using this pre-defined code END // of dual-to-thief swing DEFAULT // the fall-through check. If %class_choice% was not 1, 2, 3, or 4, the default code will run PRINT ~No class choice was chosen... installing Aran's Default (Fighter, moderate wealth, long sword and bow)~ /* 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 COPY ~aranw/cre/c-arnftr.cre~ ~override/c-aran7.cre~ // the fighter stat L7 .cre LAUNCH_PATCH_MACRO ~aran_cre_setup~ // patch in player choices using this pre-defined code END // of default swing END // of define action macro This usage is interesting to me in that it shows how you can nest both macros and ACTION_MATCH WITH . It is a criminal waste of space to use this for just PRINT materials the way I have; the better usage would be to fully convert the various PATCH_IF statements and that whole pyramid of materials found in aran_cre_setup into a better/tighter logic chain, so that i could do away with SUBCOMPONENT entirely. Using this idea, the whole thing could be built into one component, and we could ask "Default, or choice?" and then if a person chose choice, they could run everything through a single run of code that asked and adjusted for responses. To do this, instead of using LAUNCH_PATCH_MACRO ~aran_cre_setup~ the currently unchanged contents of aran_cre_setup's PATCH_IF statements would be integrated into the above.
  3. 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.
×
×
  • Create New...