Jump to content


Romance Specific coding questions


  • Please log in to reply
116 replies to this topic

#101 -Ashara-

-Ashara-
  • Guest

Posted 19 March 2004 - 08:52 AM

Erm, SoT, I am also a novice, so take my advice with a grain of salt...make it a shaker, lol

- END "doubles" when you switch from file to file, ie if you were first appending to J-file and then went to B file by forming CHAIN. So if you keep working in the J file double end will appear only in the very end.

Your single D file does not have to correspond exactly to B or J DLG file, basically you can work within the same file, APPEND-ing and CHAIN-ing to different DLG's - you will do it often if you, say, have other NPCs intruding into your conversations.

-Yes, you can set the variable and use it in the flirt condition, just do not forget to reset it in the dialogue after which you want the flirts to re-appear

-This line -

+ ~RandomNum(4,1)~ + ~(1. Touch Tsujatha?s cheek.)~ DO ~ + EarlyTSJCheek1


No, you are not DO-ing anything, you are "sending" to the specific text block. It should be GOTO, and in the shorthand, GOTO is replaced by "+", so your syntaxis should be:

+ ~RandomNum(4,1)~ + ~(1. Touch Tsujatha?s cheek.)~ + EarlyTSJCheek1

It should be:

IF ~~ THEN DO ~RestParty ()~
EXIT
END

if you are in APPEND mode.

If you are in CHAIN it will be:
DO ~RestParty ()~
EXIT

#102 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 19 March 2004 - 05:37 PM

Thank you, domi! That helped a lot. :D I had been copying from a file that actually set a Global counter each time you chose a flirt. I forgot and left the DO in, even though I axed the counter set. I think I have the flirt packs pretty much down--except for one last thing. :rolleyes: (Isn't there always "one last thing"?)

My late flirts have two different possible branches. Depending on choices made earlier in the romance, you will have different flirt options. I have already made Global variables to track those choices, and I have them set in the dialogues. My question is this: Do I have to make two different flirt sets and have them triggered by different Globals, looking something like the following:

IF ~IsGabber(Player1)
CombatCounter(0)
Global("TsujathaBranchOne","GLOBAL",1)
Global("TsujathaRomanceActive","GLOBAL",2)~ THEN BEGIN TsuFlirtBaseLateA
SAY ~(Blah blah blah)~
+ ~RandomNum(4,1)~ + ~(1. Touch Tsujatha?s cheek.)~ DO ~ + EarlyTSJCheek1
+ ~RandomNum(4,2)~ + ~(1. Touch Tsujatha?s cheek.)~ DO ~ + EarlyTSJCheek2
+ ~RandomNum(4,3)~ + ~(1. Touch Tsujatha?s cheek.)~ DO ~ + EarlyTSJCheek3
+ ~RandomNum(4,4)~ + ~(1. Touch Tsujatha?s cheek.)~ DO ~ + EarlyTSJCheek4

Etc.


IF ~IsGabber(Player1)
CombatCounter(0)
Global("TsujathaBranchTwo","GLOBAL",1)
Global("TsujathaRomanceActive","GLOBAL",2)~ THEN BEGIN TsuFlirtBaseLateB
SAY ~(Blah blah blah)~
+ ~RandomNum(4,1)~ + ~(1. Touch Tsujatha?s cheek.)~ DO ~ + EarlyTSJCheek1
+ ~RandomNum(4,2)~ + ~(1. Touch Tsujatha?s cheek.)~ DO ~ + EarlyTSJCheek2
+ ~RandomNum(4,3)~ + ~(1. Touch Tsujatha?s cheek.)~ DO ~ + EarlyTSJCheek3
+ ~RandomNum(4,4)~ + ~(1. Touch Tsujatha?s cheek.)~ DO ~ + EarlyTSJCheek4

Etc.


Then I just put the different choices in each group, and the game would pull up the appropriate set depending on the variable, right?

Or do I combine the two late sets into one, and have a variable checked at each line? That seems like more trouble, but is it the way that works?

Thanks for the quick response!
Sillara
Check out my RPG forum!

#103 -Ashara-

-Ashara-
  • Guest

Posted 19 March 2004 - 05:47 PM

Both will work, I think. Myself, I am going for a single pack with variables checking in the lines themselves, but then, I am not planning for more than 20 repetitive flirts.

#104 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 19 March 2004 - 05:49 PM

How did you know I had 20? :D

But thank you. I will be using the two different packs way. Whew. Now I have nearly done with flirt pack coding!!! All I have left are interjections. Sigh. I HATE looking for triggers. Is there any place that has the triggers listed? I have not been able to find one.

Sillara
Check out my RPG forum!

#105 kirkjobsluder

kirkjobsluder
  • Member
  • 222 posts

Posted 23 March 2004 - 06:24 PM

Yuck, I need some help setting this up.

Here is my override script:
IF
Global("ForrestMatch","GLOBAL",0)
Global("CheckForrestMatch","GLOBAL",0)
Gender(Player1,MALE)
!Global("AnotherMaleRomanceActive","GLOBAL",2)
!Global("ForrestRomanceActive","GLOBAL",3)
OR(2)
Alignment(Player1,MASK_GENEUTRAL)
Alignment(Player1,MASK_GOOD)
OR(6)
Race(Player1,HUMAN)
Race(Player1,HALF_ELF)
Race(Player1,ELF)
Race(Player1,HALFLING)
Race(Player1,GNOME)
Race(Player1,HALFORC)

THEN
RESPONSE #100
SetGlobal("ForrestRomanceActive","GLOBAL",1)
SetGlobal("CheckForrestMatch","GLOBAL",1)
SetGlobal("ForrestMatch","GLOBAL",1)
RealSetGlobalTimer("ForrestRomanceTimer","Global",6)
SetGlobal("ForrestLovetalk","GLOBAL",1)
END


IF
 Global("ForrestMatch","GLOBAL",1)
 Global("ForrestRomanceActive","GLOBAL",1)
 Global("ForrestLovetalk","GLOBAL",1)
 GlobalTimerExpired("ForrestRomanceTimer","GLOBAL")
 !AreaType(DUNGEON)  // None of the Bioware NPCs will banter in dungeons, and I suggest that modders keep this tradition.
 !StateCheck(Player1,STATE_SLEEPING)  // How's the PC going to talk if he can't do anything?
 InParty(Myself)  // Jaheira will actually fire lovetalks if she's not in the party.  You don't want your NPC to do that, do you?
 See(Player1)
THEN
 RESPONSE #100
  IncrementGlobal("ForrestLovetalk","GLOBAL",1)
[color=red]StartDialog("K#Forre",Player1)[/color]
END

This works as long as I structure my dialog files as follows:

BEGIN K#Forre (the join dialog and currently all banter dialogs)
...
BEGIN K#ForreP (the kickout/rejoin dialog.)
...

Using the traditional format of putting the lovetalks in BK#FORRE does not seem to be working, I have this in the install file.

APPEND ~interdia.2da~
~FORREST	BK#FORRE	BK#FORRE~

Can anyone explain this one? What am I missing?

#106 kirkjobsluder

kirkjobsluder
  • Member
  • 222 posts

Posted 23 March 2004 - 07:28 PM

Well that's interesting:
StartDialog("#BK#FORRE",Player1) works,
but Interact("Player1") does not.

#107 -jcompton-

-jcompton-
  • Guest

Posted 23 March 2004 - 08:46 PM

Don't put Player1 in quotes.

#108 kirkjobsluder

kirkjobsluder
  • Member
  • 222 posts

Posted 24 March 2004 - 08:17 AM

Don't put Player1 in quotes.

It's not in the code, I don't know why I put it in quotes here.

Another interesting feature is that the interact is triggering (NPC turns to face Player1) but with no dialog.

#109 -jcompton-

-jcompton-
  • Guest

Posted 24 March 2004 - 09:50 AM

Well, your INTERDIA.2DA entry looks correct but I'd suggest going through and triple-checking that you have the correct DV and dialogue names, and that the 2DA's actually being patched properly.

#110 -Ashara-

-Ashara-
  • Guest

Posted 24 May 2004 - 07:07 PM

*bump* This thread is too useful to loose it. :)

#111 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 16 October 2004 - 01:04 AM

I am resurrecting an old thread to ask an odd question. I have some code that OUGHT to work. It is copied directly from my other romance mod (where it DOES work) with the appropriate changes made for alignment and what-not. The only problem is that it is NOT working. I am not getting anything to fire at all. I realize that the timer is only 10 seconds, and I know that this is only an RA=1 section. I am just testing. But NOTHING works. I have been checking via the CLUA console, and my MyNPCTalk LOCALS are reaching 1, but they are never going any higher--so nothing ever happens. :bash: :bash: :help: :wall: :bash:

Anyway, here is the code from the .baf, and here is the code to begin the first LT. Can someone tell me what I am doing wrong?

:help: :help: :bash: :bash: :wall: :bash: :bash:

The following section apparently works. I cannot tell what the timer is, but it apparently exists. I saw it in SK. And the LOCALS are set to 1.



IF
Global("YasraenaMatch","GLOBAL",0)
Global("CheckYasraenaMatch","GLOBAL",0)
Gender(Player1,MALE)
!Global("AerieRomanceActive","GLOBAL",2)
!Global("JaheiraRomanceActive","GLOBAL",2)
!Global("TashiaRomanceActive","GLOBAL",2)
!Global("imoenromanceactive","GLOBAL",2)
!Global("E3FadeRomanceActive","GLOBAL",2)
!Global("YasraenaRA","GLOBAL",3)
!Global("ViconiaRomanceActive","GLOBAL",2)
THEN
RESPONSE #100
SetGlobal("CheckYasraenaMatch","GLOBAL",1)
SetGlobal("YasraenaMatch","GLOBAL",1)
SetGlobal("YasraenaRA","GLOBAL",1)
RealSetGlobalTimer("YasraenaTalkTime","GLOBAL",10)
SetGlobal("YasraenaTalk","LOCALS",1)
END




This part ought to fire the LTs, but it is not working.


IF
InParty(Myself)
RealGlobalTimerExpired("YasraenaTalkTime","GLOBAL")
Global("YasraenaRA","GLOBAL",1)
Global("YasraenaMatch","GLOBAL",1)
!AreaType(DUNGEON)
See(Player1)
CombatCounter(0)
OR(13)
Global("YasraenaTalk","LOCALS",1)
Global("YasraenaTalk","LOCALS",3)
Global("YasraenaTalk","LOCALS",5)
Global("YasraenaTalk","LOCALS",7)
Global("YasraenaTalk","LOCALS",9)
Global("YasraenaTalk","LOCALS",11)
Global("YasraenaTalk","LOCALS",13)
Global("YasraenaTalk","LOCALS",17)
Global("YasraenaTalk","LOCALS",19)
Global("YasraenaTalk","LOCALS",21)
Global("YasraenaTalk","LOCALS",25)
Global("YasraenaTalk","LOCALS",27)
Global("YasraenaTalk","LOCALS",29)
THEN
RESPONSE #100
IncrementGlobal("YasraenaTalk","LOCALS",1)
Interact(Player1)
END


And this helps out, too.


IF
InParty(Myself)
RealGlobalTimerExpired("YasraenaTalkTime","GLOBAL")
Global("YasraenaRA","GLOBAL",1)
Global("YasraenaMatch","GLOBAL",1)
!AreaType(DUNGEON)
See(Player1)
CombatCounter(0)
!See([ENEMY])
!Range([NEUTRAL],10)
OR(15)
Global("YasraenaTalk","LOCALS",2)
Global("YasraenaTalk","LOCALS",4)
Global("YasraenaTalk","LOCALS",6)
Global("YasraenaTalk","LOCALS",8)
Global("YasraenaTalk","LOCALS",10)
Global("YasraenaTalk","LOCALS",12)
Global("YasraenaTalk","LOCALS",14)
Global("YasraenaTalk","LOCALS",16)
Global("YasraenaTalk","LOCALS",18)
Global("YasraenaTalk","LOCALS",20)
Global("YasraenaTalk","LOCALS",22)
Global("YasraenaTalk","LOCALS",24)
Global("YasraenaTalk","LOCALS",26)
Global("YasraenaTalk","LOCALS",28)
Global("YasraenaTalk","LOCALS",30)
THEN
RESPONSE #100
RealSetGlobalTimer("YasraenaTalkTime","GLOBAL",10)
IncrementGlobal("YasraenaTalk","LOCALS",1)
END



And the following is in her B file.




IF
~Global("YasraenaRA","GLOBAL",1)
Global("YasraenaTalk","LOCALS",2)
Global("YasraenaMatch","GLOBAL",1)
GlobalTimerExpired("YasraenaTalkTime","GLOBAL")~
THEN BEGIN YasraenaTalk1
SAY ~Blah.~ [YASRA046]



As I said, it ought to work. But it does NOT.

Does anyone have ANY idea why? I am growing desperate! :bash: :bash: :bash: :bash: :bash:

Sillara
Check out my RPG forum!

#112 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 16 October 2004 - 05:36 AM

Check your interdia.2da file and make sure that the Bdialog file is being properly assigned and that the death variable there matches up to the death variable in the .cre.

This has nothing to do with your problem, but when you reset the timer why are you making these checks:

!AreaType(DUNGEON)
See(Player1)
CombatCounter(0)
!See([ENEMY])
!Range([NEUTRAL],10)

Shouldn't the timer be reset regardless?

#113 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 16 October 2004 - 06:14 AM

You were right about the timer setting. :turnip: I have no idea why I put that in there! I've since cut it out. But I still have that problem. I know that the B file is properly assigned because I can, using ctrl+I, get her NPC/NPC banters and her PC class-specific talks. Her J file is properly assigned because I can force-talk her. But SOMETHING is not right because she never initiates her LTs. (I guess she just doesn't like Arkadi. Hmm.)

Anyway, I used the CLUA console to check her LOCALS, and it said that they were set to 1. I used the SetGlobal("YasraenaTalk","LOCALS",2) command to try to force the talks, just to see what would happen. Nothing happened. But then I tested the LOCALS again using the GetGlobal("YasraenaTalk,"LOCALS") command, and it said that it was set to 1! Again!

Now to me this sounds like a repeating error in the .baf. Would that be right? It sounds to me like the .baf keeps setting the LOCALS to 1. (There is no stutter bug, though.) Does that sound right? Am I missing something here? This is starting to drive me nuts!!!! :bash: :bash: :bash:

Please, help! :help: :help: :help:

Sillara
Check out my RPG forum!

#114 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 16 October 2004 - 06:31 AM

Do all your match checks return true? Since that seems like the only code block where your RA variable gets set to 1, I'd check all those variables to make sure they're being set properly.

#115 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 16 October 2004 - 06:37 AM

Well, I checked with SK, and all the GLOBAL variables were there. YasraenaMatch and CheckYasraenaMatch and YasraenaRA were all set to 1. The YasraenaTalkTime had a value of 30973. That is what I do not understand. (I have never understood SK's reading of timers.) Anyway, do you think it could cause a problem that my NPC joined just at the exit of Chateau Irenicus, and then we went to the ugly cutscene outside? I am certain I waited 10 seconds before leaving (I know the LT won't fire in a dungeon; I just wanted to give the timer a chance to go off). Anyway, what, if anything, would that do?

I realize I am grasping at straws, but there really seems to be no reason for this NOT to work.

Sigh.

Sillara, the depressed
Check out my RPG forum!

#116 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 16 October 2004 - 08:01 AM

Here's a pretty good explanation of timers: http://gibberlings3....ting/timers.htm

You could try manually expiring the timer.. CLUAConsole:SetGlobal("YasraenaTalkTime","GLOBAL",1)

Also, and this I'm sure is a stupid question, but your PC *is* male yes?

#117 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 16 October 2004 - 03:38 PM

He IS male. Sigh. I'm off to experiment with timers. If this doesn't work, I don't know what will!

Sillara :bash: :bash: :bash:
Check out my RPG forum!