Jump to content


Photo

Player Choice of Timers and Staging Content

weidu tp2 coding timers friend talks love talks aran whitehand npc mod development flirts ACTION_READLN

No replies to this topic

#1 cmorgan

cmorgan

    journeyman investigator

  • Gibberlings
  • 6913 posts
  • Gender:Male
  • Location:Glencoe, IL, USA

Posted 22 October 2011 - 02:06 PM

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.

Edited by cmorgan, 18 November 2011 - 07:12 PM.

I love deadlines. I love the whooshing noise they make as they go by. - Douglas Adams



Reply to this topic



  



Also tagged with one or more of these keywords: weidu tp2 coding, timers, friend talks, love talks, aran whitehand, npc, mod development, flirts, ACTION_READLN

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users