Romance Specific coding questions
#1 -Ashara-
Posted 09 February 2004 - 07:08 PM
1) Are all the romantic talks added to character?s B file?
2) Where do I set the RomanceMatch variable? Is it GLOBAL or LOCALS?
3) Where do I set the RomanceActive Variable? Is it GLOBAL or LOCALS?
4) Weight system. Say I want the talks in sequence, and a few talks occurring under certain circumstances only. How can I manage that so the ?not necessary? talks will not stop the ?sequential? talks?
5) Will you be able to provide an example of using DO functions RestParty() and PartyRested() and BAF file which is appended to the Dream script to make the dialogues happen
a) at initiating rest
B) at waking up
6) How to do the Morning After talks (ie immediate follow up after the at rest talk and rest?)
7) How many files and which type are needed to create a PC initiated talk, ie flirt? Do I need anything in the character script changed to enable him/her to be flirtable?
What Dialogue file do flirts go to?
9) Will you be able to provide an example of a flirt?
10) How to set up the random options of the reply?
#3
Posted 10 February 2004 - 05:07 AM
< jcompton > Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"
#4
Posted 10 February 2004 - 05:14 AM
Sillara
#5
Posted 10 February 2004 - 05:27 AM
Well, since there is no romance making tutorials, I was wondering if we can create one? So here are my questions. If anyone knows an answer to at least one of them and post it, I will be extremely greatful!
1) Are all the romantic talks added to character?s B file?
By BioWare convention they are, but they don't *have* to be.
GLOBAL2) Where do I set the RomanceMatch variable? Is it GLOBAL or LOCALS?
GLOBAL3) Where do I set the RomanceActive Variable? Is it GLOBAL or LOCALS?
4) Weight system. Say I want the talks in sequence, and a few talks occurring under certain circumstances only. How can I manage that so the ?not necessary? talks will not stop the ?sequential? talks?
In the non-essential talks do not include whatever variable you're using for your sequential talks. And don't set any variables in the non-essential talks that will be checked in the sequential talks.
5) Will you be able to provide an example of using DO functions RestParty() and PartyRested() and BAF file which is appended to the Dream script to make the dialogues happen
a) at initiating rest
B) at waking up
I know Kelsey's romance and Anomen + flirt packs romance both do this. Check their files.
6) How to do the Morning After talks (ie immediate follow up after the at rest talk and rest?)
See above
No, but if you want the NPC to initiate flirts you would have to add a timer so that he'd flirt every so often. Again, check the flirt packs and or Kelsey.7) How many files and which type are needed to create a PC initiated talk, ie flirt? Do I need anything in the character script changed to enable him/her to be flirtable?
By convention they use the J dialog file.What Dialogue file do flirts go to?
9) Will you be able to provide an example of a flirt?
10) How to set up the random options of the reply?
They use RandomNum(x.y) in the reply trigger. Check the flirt pack for examples.
#6 -Domi_S-
Posted 10 February 2004 - 06:46 AM
a) Shorthand - and all I know is that ++ is used for IF~~THEN REPLY. Is there a tutorial on shorthand?
B) blocks being non-sequencial - ie you do not see the full dialogue, only bits and pieces of it. alternate with other dialogues etc.
What I would like to see is an example of a flirt in the same form as the banter example in the "Road to Banter" tutorial. Ie the full text of the flirt and how it was coded in?
I know it takes time and willingness to do that, but that probably will make life much easier to both those who just start out and those who do not have to be bugged by many different people with the same question. I mean, how many times people complained that WeiDU "does not start" before Dos for Dummies was out?
Yes, it is an unelegant way to teach, but at least it provides easy access.
For morning after, again it would be nice if someone done the same thing Ghrey had done in his NPC tutorial: showed the dialogue and the associated BSC block in the dream script.
#7
Posted 10 February 2004 - 08:49 AM
The Cailean init flirts would look like:
C: I'm going to start a flirt now.
(random)
C: (Cailean gives you a kiss on the cheek.)
The PC init flirt menu would look like:
C: (Cailean notices you approach.)
PC1: Hold Cailean's hand.
PC2: Kiss Cailean
PC3: Cailean, I like you very much, but please don't flirt with me anymore.
PC4: (Say nothing.)
If you choose Kiss Cailean, you'd randomly get one of the kisses.
This gets appended to the J dialog file.
APPEND FWCailej //Cailean init flirts IF ~Global("FWCaiDisableFlirts","GLOBAL",0) See(Player1) !StateCheck(Player1,STATE_SLEEPING) CombatCounter(0) Global("FWCaileanRomanceActive","GLOBAL",1) Global("FWCaileanStartFlirt","GLOBAL",1)~ THEN BEGIN CaileanInitFlirts SAY ~I'm going to start a flirt now.~ IF ~~ THEN DO ~IncrementGlobal("FWCaileanRandFlirt","LOCALS",1)~ GOTO CaileanInitHand IF ~RandomNum(2,1)~ THEN DO ~IncrementGlobal("FWCaileanRandFlirt","LOCALS",1)~ GOTO CaileanInitKiss IF ~RandomNum(2,2)~ THEN DO ~IncrementGlobal("FWCaileanRandFlirt","LOCALS",1)~ GOTO CaileanInitTickle END IF ~~ THEN BEGIN CaileanInitHand SAY ~(Cailean takes a hold of your hand.)~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN CaileanInitKiss SAY ~(Cailean gives you a kiss on the cheek.)~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN CaileanInitTickle SAY ~(Cailean tickles your ribs.)~ IF ~~ THEN EXIT END //PC init flirts -- early IF ~IsGabber(Player1) CombatCounter(0) GlobalGT("FWCaiInitLoveTalk","GLOBAL",6) Global("FWCaileanQuestCompleted","GLOBAL",1) Global("FWCaileanRomanceActive","GLOBAL",1)~ THEN BEGIN CaiFlirtBaseEarly SAY ~(Cailean notices your approach.)~ + ~RandomNum(4,1)~ + ~(Hold Cailean's hand.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + HandHold1 + ~RandomNum(4,2)~ + ~(Hold Cailean's hand.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + HandHold2 + ~RandomNum(4,3)~ + ~(Hold Cailean's hand.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + HandHold3 + ~RandomNum(4,4)~ + ~(Hold Cailean's hand.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + HandHold1 + ~RandomNum(4,1)~ + ~(Kiss Cailean.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + Kiss1 + ~RandomNum(4,2)~ + ~(Kiss Cailean.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + Kiss2 + ~RandomNum(4,3)~ + ~(Kiss Cailean.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + Kiss3 + ~RandomNum(4,4)~ + ~(Kiss Cailean.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + Kiss4 ++ ~Cailean, I like you very much, but please don't flirt with me anymore.~ DO ~SetGlobal("FWCaiDisableFlirts","GLOBAL",1)~ EXIT ++ ~(Say nothing.)~ EXIT END IF ~~ THEN BEGIN HandHold1 SAY ~Cailean holds your hand 1.~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN HandHold2 SAY ~Cailean holds your hand 2.~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN HandHold3 SAY ~Cailean holds your hand 3.~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN Kiss1 SAY ~Cailean kisses you 1.~ = ~It's a really long kiss.~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN Kiss2 SAY ~Cailean kisses you 2.~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN Kiss3 SAY ~Cailean asks about the kiss~ ++ ~Kiss answer 1.~ + Kiss3_1 ++ ~Kiss answer 2.~ + Kiss3_2 ++ ~Kiss answer 3.~ + Kiss3_3 END IF ~~ THEN BEGIN Kiss3_1 SAY ~Cailean kisses you 3_1~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN Kiss3_2 SAY ~Cailean kisses you 3_2~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN Kiss3_3 SAY ~Cailean kisses you 3_3.~ IF ~~ THEN EXIT END IF ~~ THEN BEGIN Kiss4 SAY ~(Cailean kisses you 4.)~ IF ~~ THEN EXIT END END
These script blocks get added to Cailean's script and are for triggering the Cailean init flirts.
//Resets Cailean's flirt timer if in combat IF RealGlobalTimerExpired("FWCaileanFlirtTimer","LOCALS") !CombatCounter(0) THEN RESPONSE #100 SetGlobal("FWCaileanStartFlirt","GLOBAL",0) RealSetGlobalTimer("FWCaileanFlirtTimer","LOCALS",100) END //Cailean flirts with PC IF RealGlobalTimerExpired("FWCaileanFlirtTimer","LOCALS") Global("FWCaileanStartFlirt","GLOBAL",0) Global("FWCaiDisableFlirts","GLOBAL",0) InParty(Myself) !StateCheck(Player1,STATE_SLEEPING) Global("FWCaileanRomanceActive","GLOBAL",1) See(Player1) CombatCounter(0) !See([ENEMY]) !Range([NEUTRAL],10) THEN RESPONSE #100 SetGlobal("FWCaileanStartFlirt","GLOBAL",1) StartDialogueNoSet(Player1) Wait(1) END //Reset flirt timer after flirting IF RealGlobalTimerExpired("FWCaileanFlirtTimer","LOCALS") Global("FWCaileanStartFlirt","GLOBAL",1) THEN RESPONSE #100 SetGlobal("FWCaileanStartFlirt","GLOBAL",0) RealSetGlobalTimer("FWCaileanFlirtTimer","LOCALS",1500) END //Start flirt timer for first time IF Global("FWCaileanFlirtsStarted","LOCALS",0) GlobalGT("FWCaiInitLoveTalk","GLOBAL",4) OR(2) Global("FWCaileanRomanceActive","GLOBAL",1) Global("FWCaileanRomanceActive","GLOBAL",2) THEN RESPONSE #100 SetGlobal("FWCaileanFlirtsStarted","LOCALS",1) RealSetGlobalTimer("FWCaileanFlirtTimer","LOCALS",600) END
#8 -Ashara-
Posted 10 February 2004 - 09:19 AM
#9
Posted 10 February 2004 - 09:49 AM
Yes - most of them. But I also use J file , especially for the weighted non-sequential talks.
2) Where do I set the RomanceMatch variable? Is it GLOBAL or LOCALS?
In the character override .bcs as in GABBER.bcs if it is SoA GABBER25.bcs if in ToB
but the naming is not essential - you set it in the cre file to be the override script.
it is GLOBAL
3) Where do I set the RomanceActive Variable? Is it GLOBAL or LOCALS?
GLOBAL - set it in the same file, ie your character override bcs script (or if you use baf's which I dislike - in the baf but it will be compiled into bcs as you can imagine)
4) Weight system. Say I want the talks in sequence, and a few talks occurring under certain circumstances only. How can I manage that so the “not necessary” talks will not stop the “sequential” talks?
All the weighted dialogs go into the character Gabberj.dlg file. Use weidu xxx.dlg to convert in-game dlg files into d files and look at them for examples. The smaller the weight the higher id the talk priority. Negative numbers is fine for weidu. So if you are modifying existing dialogs you can do -100 -99 etc and these will run 'before' the regular stuff. Be careful! These talks have to be triggered from inside the creature override bcs as in: IF (such and such condition) StartDialog(Player1) -> the game checks the weighted states in the j file after that and runs the one that is satisfying (ie its GLOBALS state match the triggers) It will scan all entries from top to bottom with the << numbers being checked first.
5) Will you be able to provide an example of using DO functions RestParty() and PartyRested() and BAF file which is appended to the Dream script to make the dialogues happen
a) at initiating rest
at waking up
The wake up dialogs have to be scripted using the GABBERD.bcs - check Anomens for example, I cannot give my own examples as they are 'proprietory' of the Edwin mod.
But Anomen is much similar. -> open his AnomenD.bcs and have a looksie. Have no clue as to how they do it in other mods though...
Again I dislike BAFs but they are just uncompiled bcs's
DO ~RestParty()~ works in the Dialog like a charm... what is the problem again?
to start the morning after talk you have to use GabberD.bcs again...
6) How to do the Morning After talks (ie immediate follow up after the at rest talk and rest?)
See above
7) How many files and which type are needed to create a PC initiated talk, ie flirt? Do I need anything in the character script changed to enable him/her to be flirtable?
No clue - never did flirts. Kismet gave you a very good answer though.
What Dialogue file do flirts go to?
see above
9) Will you be able to provide an example of a flirt?
10) How to set up the random options of the reply?
I am no expert on flirts. The difficulty of coding the romance cometh mostly from setting Timers IHMO - but since you did not ask for it yet I shall stay mum.
Happy coding!
Freedom cannot be equated with goodness, virtue, or perfection. Freedom has its own unique self-contained nature; freedom is freedom ? not universal goodness. Any confusion or deliberate equalization of freedom with goodness and excellence is in itself negation of freedom, and acceptance of the path of restraint and enforcement.
Nikolai Berdyaev - Christian Existentialist, Philosopher of Freedom.
The Longer Road mod
Redemption mod
Bitter Grey Ashes
#10
Posted 10 February 2004 - 11:26 AM
1) Are all the romantic talks added to character?s B file?
The ones that are fired when resting are not. They go into the BXXXD.dlg file. Technically, the romance talks can go into the J file, but usually the B is used.
2) Where do I set the RomanceMatch variable? Is it GLOBAL or LOCALS?
LOCALS would probably work, but all of the Bioware ones are GLOBAL, so that's the better way to go.
3) Where do I set the RomanceActive Variable? Is it GLOBAL or LOCALS?
If you want anything except for that particular character to be able to see the state of your romance, make it a GLOBAL. Technically, the talks will fire either way, though.
6) How to do the Morning After talks (ie immediate follow up after the at rest talk and rest?)
Use the PartyRested() Trigger coupled with the Lovetalks in your NPC's scripts.
7) How many files and which type are needed to create a PC initiated talk, ie flirt? Do I need anything in the character script changed to enable him/her to be flirtable?
In the NPC's J file, do IF ~IsGabber(Player1)~ THEN BEGIN Flirts.
Kitanya expands on this a great deal, so if you want more than just that, check her files (as soon as I get the mod released).
What Dialogue file do flirts go to?
Put them in whichever one you did not put the LoveTalks into.
#11
Posted 10 February 2004 - 11:40 AM
Actually in the Bioware ones they are just in the B####.dlg file. The triggering script for them however is the #####D.bcs.1) Are all the romantic talks added to character?s B file?
The ones that are fired when resting are not. They go into the BXXXD.dlg file. Technically, the romance talks can go into the J file, but usually the B is used.
#12 -Ashara-
Posted 10 February 2004 - 05:41 PM
Now, I still have a couple of questions for the dream script.
Here is the ANOMEND.BSC
IF
!Global("AnomenRomanceActive","GLOBAL",0)
!Global("AnomenRomanceActive","GLOBAL",3)
Global("AnomenMatch","GLOBAL",1)
See(Player1)
CombatCounter(0)
OR(2)
Global("LoveTalk","LOCALS",31)
Global("LoveTalk","LOCALS",35)
THEN
RESPONSE #100
IncrementGlobal("LoveTalk","LOCALS",1)
RealSetGlobalTimer("AnomenRomance","GLOBAL",1)
PlaySong(35)
Interact(Player1)
END
It looks like the Dream Script below should trigger the LT's 32 and 36 (both from BANOMEN.DLG:
LT32 is this (looks like it has standard conditions, I cannot see anything specific related to dreaming:
IF WEIGHT #22 ~Global("AnomenMatch","GLOBAL",1)
Global("LoveTalk","LOCALS",32)
Global("AnomenIsKnight","GLOBAL",1)~ THEN BEGIN 425 // from:
SAY #35831 /* ~Might I be able to draw you away from the others for a while as they prepare to sleep? I have something to speak to you of, and 'tis for your ears only.~ [ANOMEN89] */
IF ~~ THEN REPLY #35833 /* ~Very well, I shall go with you.~ */ GOTO 426
IF ~~ THEN REPLY #35834 /* ~I'll go with you, Anomen...so long as there's no funny business.~ */ GOTO 430
IF ~~ THEN REPLY #35835 /* ~Forget it, Anomen...I just want to sleep.~ */ GOTO 431
END
The questions are:
1) What does this line do?
IncrementGlobal("LoveTalk","LOCALS",1)
2) What does this timer do?
RealSetGlobalTimer("AnomenRomance","GLOBAL",1)
#13
Posted 10 February 2004 - 06:00 PM
IncrementGlobal("LoveTalk","LOCALS",1)
That increases the value of LoveTalk by 1. LoveTalks only fire on the (even or odd, different sources give different answers), so incrementing it by one ensures that a LoveTalk won't fire before time is up.
#14
Posted 10 February 2004 - 06:00 PM
The timer is Anomen's lovetalk timer. This talk happens the next time you rest regardless of whether or not the lovetalk timer has expired. Setting the timer to 1 expires the timer so that the script can reset it for the next lovetalk.
#15
Posted 10 February 2004 - 06:56 PM
#16 -Ashara-
Posted 10 February 2004 - 07:19 PM
@Gabrielle - yeah, I figured that I might not be the only one puzzling over it
OK, we are still not in the clear on the Morning Afters. I'll see if I can ask one of the gurus to allow to have their LT dissected and analysed
#17
Posted 11 February 2004 - 06:20 AM
Freedom cannot be equated with goodness, virtue, or perfection. Freedom has its own unique self-contained nature; freedom is freedom ? not universal goodness. Any confusion or deliberate equalization of freedom with goodness and excellence is in itself negation of freedom, and acceptance of the path of restraint and enforcement.
Nikolai Berdyaev - Christian Existentialist, Philosopher of Freedom.
The Longer Road mod
Redemption mod
Bitter Grey Ashes
#18 -Ashara-
Posted 11 February 2004 - 06:48 AM
#20
Posted 11 February 2004 - 09:24 PM
I corrected your file and send it to you today.
By the way - as I suspected there is no need to start your file names with
J#, JK# or any other prefixes.
Quoting Ghreyfain:
I'll name mine
J#Vondo.d. The first line of code we should right is "BEGIN J#Vondo", which means
that at the time of compilation, it will create a file called *J#Vondo.dlg.
* Note that you don't need to use the prefix "J#", this is just a naming convention
I use for all my files to keep them from overwriting other people's custom files.
Freedom cannot be equated with goodness, virtue, or perfection. Freedom has its own unique self-contained nature; freedom is freedom ? not universal goodness. Any confusion or deliberate equalization of freedom with goodness and excellence is in itself negation of freedom, and acceptance of the path of restraint and enforcement.
Nikolai Berdyaev - Christian Existentialist, Philosopher of Freedom.
The Longer Road mod
Redemption mod
Bitter Grey Ashes