Jump to content


Romance Specific coding questions


  • Please log in to reply
116 replies to this topic

#61 -Ashara-

-Ashara-
  • Guest

Posted 17 February 2004 - 06:23 AM

Sillara, did you look through the Road to Banter tutorial? It is really good for all the banter conditions, and what's even best, gives the "correct" syntaxis, so you do not have to try to guess if the * after argument means that you take quotes or not at the IESDP.

For specific area, if you want it to be initiated say, when you just enter the area, you need to write a script, which will fire it imediately.

Also, when you are looking up the, say, TimeofDay, AreaType arguments, look into the IDS folder with NI.

#62 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 17 February 2004 - 07:31 AM

Thank you! I have checked out the Road to Banter, but I was not thinking of Lovetalks when I read it. We (meaning my dear coding husband) have been using it already for banters. I had not realized that it also had time of day indications! I have checked out the link Kismet gave, and what with that, NI, and the Road to Banter, I think I am on my way again! ;)

Sillara
Check out my RPG forum!

#63 -Ashara-

-Ashara-
  • Guest

Posted 19 February 2004 - 06:44 PM

I am glad that you are doing well :D

I have a question though reguarding using RandomNum(): can it be used in CHAIN? Ie is this construction valid?:

== ~_BSKIE~ IF~ RandomNum(2,1)~ THEN ~Oh! Excuse me, my dear <CHARNAME>.~
== ~_BSKIE~ IF ~RandomNum(2,2)~ THEN ~Oh, the bloody Nine Hells...~

:blink:

#64 Grim Squeaker

Grim Squeaker

    Fallen

  • Member
  • 1018 posts

Posted 20 February 2004 - 12:17 AM

I'd imagine it would work but don't quote me on it...
"You alone can make my song take flight..."

#65 kirkjobsluder

kirkjobsluder
  • Member
  • 222 posts

Posted 20 February 2004 - 01:02 PM

Ok, read the recent great tutorial but have a stupid question that every bit of documentation thinks we should know but which I don't have a clue on.

What is the unit of time used for the real timers?

How and where do you set XXXMatch?

#66 -Ashara-

-Ashara-
  • Guest

Posted 20 February 2004 - 01:20 PM

Dorotea's post from

Posted: Feb 10 2004, 07:49 PM

in this thread details where to set the Match.

#67 kirkjobsluder

kirkjobsluder
  • Member
  • 222 posts

Posted 20 February 2004 - 01:55 PM

Dorotea's post from

Posted: Feb 10 2004, 07:49 PM

in this thread details where to set the Match.

Read that but it does not really answer my question. How do I set it up so that NPC will only romance PC if PC meets certain requirements: (In my case, male and good)

#68 -Domi_S-

-Domi_S-
  • Guest

Posted 20 February 2004 - 02:04 PM

That will be detailed in Dorotea's post

from: Feb 13 2004, 09:39 AM

:lol:

#69 kirkjobsluder

kirkjobsluder
  • Member
  • 222 posts

Posted 20 February 2004 - 02:17 PM

That will be detailed in Dorotea's post

from: Feb 13 2004, 09:39 AM

:lol:

Ahh, more annotation would help.

I assme that in:
SetGlobal("CheckGabberMatch","GLOBAL",1)
SetGlobal("GabberMatch","GLOBAL",1)

That "Gabber" is the name of the NPC?

#70 -Ashara-

-Ashara-
  • Guest

Posted 20 February 2004 - 02:28 PM

Yes, I think so :D My hypothesis is that it comes from the verb "gab", meaning chatter...but I am not sure. As for annotations, I simply copied and pasted all the things I need while reading the thread. Perhaps Rastor can update the turorial when he sees what questions are not answered in his text with enough details.

#71 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 20 February 2004 - 03:08 PM

What is the unit of time used for the real timers?

That would be seconds.

#72 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 20 February 2004 - 03:13 PM

Ahh, more annotation would help.

I assme that in:
SetGlobal("CheckGabberMatch","GLOBAL",1)
SetGlobal("GabberMatch","GLOBAL",1)

That "Gabber" is the name of the NPC?

Global variables can be any unique string up to, I believe, 32 characters. It is good practice, however, to have the variable reflect what you're tracking so that anybody looking at your code (yourself included) will have some idea of what you're trying to do.

#73 -jcompton-

-jcompton-
  • Guest

Posted 20 February 2004 - 03:44 PM

I am glad that you are doing well :D

I have a question though reguarding using RandomNum(): can it be used in CHAIN? Ie is this construction valid?:

== ~_BSKIE~ IF~ RandomNum(2,1)~ THEN ~Oh! Excuse me, my dear <CHARNAME>.~
== ~_BSKIE~ IF ~RandomNum(2,2)~ THEN ~Oh, the bloody Nine Hells...~

Not really in the way you'd think, which you'd discover if you compiled that and browsed it with InfExp. Unless I miss my guess, 25% of the time you would see BOTH of those lines.

If you need random reactions, I suggest doing them "the long way."

You could defend against the problem, but by time you added the extra code required, you'd have been better off just doing it the long way.

#74 dorotea

dorotea

    witch extraordinaire

  • Modder
  • 1927 posts

Posted 20 February 2004 - 04:54 PM

Arrrgh, I forgot to post the second half of the match routine - for particularly devious romance coders who dislike the tricks with 'Girdle of femininity/masculinity' and "Helm of alignment switch'. And also do not wish the romance to activate after PC dumped one romance interest and is going for another.

IF
Global("GabberMatch","GLOBAL",0)
Global("CheckGabberMatch","GLOBAL",0)
OR(4)
!Gender(Player1,FEMALE)
Global("AnotherMaleRomanceActive","GLOBAL",2)
Global("GabberRomanceActive","GLOBAL",3)
!Alignment(Player1,MASK_GOOD)

THEN
RESPONSE #100
SetGlobal("CheckGabberMatch","GLOBAL",1)
END


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


#75 -Ashara-

-Ashara-
  • Guest

Posted 20 February 2004 - 05:43 PM

Oh...that is interesting, Dorotea. Lol, code-protection against tricks :lol:


You could defend against the problem, but by time you added the extra code required, you'd have been better off just doing it the long way.

Is the long way referenced anywhere publically accessible? Pretty please? Or, and how do you actually pre-set 75% that reply show, and 25% another one show? :D

#76 Sillara

Sillara

    He made me love him without looking at me.

  • Member
  • 537 posts

Posted 20 February 2004 - 08:23 PM

I second domi's request! Please post how to do the random responses! (You didn't think I had abandoned this thread, did you? :rolleyes: )

Also, am I correct in assuming that the list given in dorotea's post would give the romance to a male, non-good PC? Or did I misinterpret the ! marks? I want to make sure I am setting it correctly in mine. (I want female, good, elf, half-elf, human ONLY.)

Thanks!

Sillara
Check out my RPG forum!

#77 dorotea

dorotea

    witch extraordinaire

  • Modder
  • 1927 posts

Posted 20 February 2004 - 10:18 PM

My last post adds a snippet that makes romance unavailable for this PC. If you look carefully, when

SetGlobal("CheckGabberMatch","GLOBAL",1)

is set to one the previous snippet will never run

and even is PC will suddenly satisfy the conditons of part I (by say dumping his previous lover or changing gender/alignment) the romance Check is already set and thus

Global("GabberMatch","GLOBAL",0)

will stay 0.

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


#78 -jcompton-

-jcompton-
  • Guest

Posted 21 February 2004 - 07:31 AM

Is the long way referenced anywhere publically accessible?  Pretty please? Or, and how do you actually pre-set 75% that reply show, and 25% another one show?

***

IF ~~ retchline
SAY ~My diva, you are the only one for me. (Perhaps she is fooled by now... yes.)~
IF ~~ GOTO moreretch
IF ~IsValidForPartyDialogue("Imoen2") RandomNum(2,1)~ EXTERN IMOEN2J retch1
IF ~IsValidForPartyDialogue("Imoen2") RandomNum(2,2)~ EXTERN IMOEN2J retch2
END

IF ~~ moreretch
SAY ~It is a good thing I do not have such lovey-dovey dialogue. Especially no sickly sweet nicknames for you, my diva. (Or so they think.)~
IF ~~ EXIT
END

.
.
.
.

APPEND IMOEN2J

IF ~~ retch1
SAY ~Ugh. <CHARNAME>, how do you keep anything down?~
IF ~~ EXTERN BEDWIN moreretch
END

IF ~~ retch2
SAY ~Well. That spoiled lunch.~
IF ~~ EXTERN BEDWIN moreretch
END

END

***

(note, introductory students, that the
IF ~~ GOTO moreretch
line is what happens if none of the below conditions are true. The engine evaluates transitions bottom-up, so it will first try the Imoen possibilities, then move on to the always-true GOTO if she's not around.)

I tried to think through the conditional CHAIN process but it has a number of limitations because of the way the game handles actions and transitions in the same step, and by time I thought of ways to work around it, you could have written all these responses up long-form already. :)

Remember that you can do long-form transition blocks coming OUT of a chain, though.

CHAIN BEDWIN blahblahblah
~Blah blah blah.~
= ~and more.~
.
.
.
= ~My diva, you are the only one for me. (Perhaps she is fooled by now... yes.)~
END
IF ~~ GOTO moreretch
IF ~IsValidForPartyDialogue("Imoen2") RandomNum(2,1)~ EXTERN IMOEN2J retch1
IF ~IsValidForPartyDialogue("Imoen2") RandomNum(2,2)~ EXTERN IMOEN2J retch2

#79 -Ashara-

-Ashara-
  • Guest

Posted 21 February 2004 - 08:08 AM

JC, just to double-check (I switch the hero to a man of my dreams :lol: ), the dialogue before coding looks like:

First line is always the same:

Valygar: The light of the shiny-most star in this godless plane, you are the only one for me!

Then, you randomize Imoen's reply. I am assuming that it is 50/50% chance, right? Or just absolutely random chance?

Random version of dialogue 1:

Imoen: Ugh. <CHARNAME>, how do you keep anything down?
Valygar: It is a good thing I do not have such lovey-dovey dialogue. Especially no sickly sweet nicknames for you, my star. I am the strong silent type, after all. Or so everyone seem to think.

Random version of dialogue 2:

Imoen: Well. That spoiled lunch.
Valygar: It is a good thing I do not have such lovey-dovey dialogue. Especially no sickly sweet nicknames for you, my star. I am the strong silent type, after all. Or so everyone seem to think.

Random version of dialogue 3:

Imoen: *not text for Imoen*
Valygar: It is a good thing I do not have such lovey-dovey dialogue. Especially no sickly sweet nicknames for you, my star. I am the strong silent type, after all. Or so everyone seem to think.

Or the random version of dialogue 3 never happens (ie there is always Imoen's reply?) ?

#80 -jcompton-

-jcompton-
  • Guest

Posted 21 February 2004 - 10:03 AM

Then, you randomize Imoen's reply. I am assuming that it is 50/50% chance, right? Or just absolutely random chance?

The way we did the RandomNum check here it's a 50/50 chance.

In other words:

IF Imoen is in the party,
half the time she'll say one thing
half the time she'll say the other.

If you wanted a 25/25/25/25 chance you'd use RandomNum(4,1) through (4,4). If you, for whatever reason, wanted there to exist a chance that she WOULDN'T comment you could leave out some of the y options in the (x,y) spread.

Random version of dialogue 3:

Imoen: *not text for Imoen*
Valygar: It is a good thing I do not have such lovey-dovey dialogue. Especially no sickly sweet nicknames for you, my star. I am the strong silent type, after all. Or so everyone seem to think.

Or the random version of dialogue 3 never happens (ie there is always Imoen's reply?)


As I wrote the code, the way you wrote out the dialogues is how it would appear. If Imoen is around, we get either version 1 or 2. If she's not, we get version 3.