The romance is coded like the BioWare ones (odd lovetalk number during timer wait, even lovetalk number for triggering the talks). The only difference is that the talks are put into the Jxxx.dlg in my case, and not into the Bxxx.dlg ones like for the BioWare romances.
Dream script triggers a rest talk as a normal lovetalk, e.g. "LoveTalk = 38" is a night talk that should happen before the party rests. So in the dream script there is the code
CODE
IF //nighttalk 2
InParty(Myself)
RealGlobalTimerExpired("X#AjantisRomance","GLOBAL")
Global("X#AjantisRomanceActive","GLOBAL",2)
Global("X#AjantisRomanceMatch","GLOBAL",1)
!Detect([ENEMY])
See(Player1)
CombatCounter(0)
Global("X#AjantisLoveTalk","GLOBAL",37)
THEN
RESPONSE #100
IncrementGlobal("X#AjantisLoveTalk","GLOBAL",1)
Dialog(Player1)
END
InParty(Myself)
RealGlobalTimerExpired("X#AjantisRomance","GLOBAL")
Global("X#AjantisRomanceActive","GLOBAL",2)
Global("X#AjantisRomanceMatch","GLOBAL",1)
!Detect([ENEMY])
See(Player1)
CombatCounter(0)
Global("X#AjantisLoveTalk","GLOBAL",37)
THEN
RESPONSE #100
IncrementGlobal("X#AjantisLoveTalk","GLOBAL",1)
Dialog(Player1)
END
In the normal NPC-script there is the incrementing of the LoveTalk variable, which should happen after the dialogue fired:
CODE
IF
InParty(Myself)
RealGlobalTimerExpired("X#AjantisRomance","GLOBAL")
Global("X#AjantisRomanceActive","GLOBAL",2)
Global("X#AjantisRomanceMatch","GLOBAL",1)
...
Global("X#AjantisLoveTalk","GLOBAL",38)
...
THEN
RESPONSE #100
IncrementGlobal("X#AjantisLoveTalk","GLOBAL",1)
RealSetGlobalTimer("X#AjantisRomance","GLOBAL",2000) //
END
InParty(Myself)
RealGlobalTimerExpired("X#AjantisRomance","GLOBAL")
Global("X#AjantisRomanceActive","GLOBAL",2)
Global("X#AjantisRomanceMatch","GLOBAL",1)
...
Global("X#AjantisLoveTalk","GLOBAL",38)
...
THEN
RESPONSE #100
IncrementGlobal("X#AjantisLoveTalk","GLOBAL",1)
RealSetGlobalTimer("X#AjantisRomance","GLOBAL",2000) //
END
But what I see in game is the following: If the NPC is a bit further away from Player1, he moves only a few steps - and then stops. The talk is not triggered. Checking the variables shows, that the "LoveTalk" variable was already increased, as if the talk had fired (i.e. is alread at "39")! The reason seems to be that the NPC-script is executed while the NPC is walking to Player1 to initiate the dialogue if it is called by "Dialog(Player1)".
If the NPC and PC are standing beside each other, the dialogue fires OK.
I never saw this in the original BioWare romances happening, and it's because for the "banter talks" the NPC initates dialogue directly independent on where the two are standing (without walking towards the banter partner like it is done for the talks that are triggered via Dialog()).
I tried to "solve" the problem by integrating a "MoveToObject(Player1)" before the setting of the LoveTalk variable that triggers the dialogue to ensure the two lovers are standing side by side, but this was no real solution as there remained a risk of the dialogues being skipped (e.g. if the player gives the NPC an action order in that moment the talk is skipped, too.)
So I recommend using "StartDialogueNoSet(Player1)" for this case of the lovetalk triggering to prevent skipping dialogues to happen.
Edited post to change my solution suggestion.