Jump to content

A Little Help


SnowKing

Recommended Posts

I could use help for a couple of things.

 

First: A person with some coding abilities to help me code LT's and Flirts (and possibly a quest or two if they can manage).

Second: Could somebody please direct me to (or show me) the set up for coding a simple dialogue (LT) so that I can try it. (And could they possibly also check it once I've done one to make sure it is right. Thanks.

 

SK

Link to comment

I can help you with the second bit: There are a lot of tutorials around the various communities that can help you construct your dialogue, including some stuff in the WeiDU documentation. I've also found it instructive to rip open some of the simpler mods and look at their .tp2 and .d files.

 

If you post up your finished code, I'm sure that someone will comment on how complete it is. Just not me, cause I'm still fiddling with things myself. :undecided:

Link to comment
Guest Guest

Please Excuse the double posting. A few questsions.

 

*For a romance LT, what would be the variable in the first line?

*How do you make it so a response is there for certain races only?

*Is there a code to cancel a romance at a certain response: what is the code to set a variable to something.

 

I think that's all, hope they make sense. Thanks.

 

SK

Link to comment

Well traditionally for a romance with Foo, we have Global called FooRomanceActive that is set to 1 at the start, 2 after commitment when all the other romances have been killed and 3 if you've killed the romance. So to kill a romance, just do SetGlobal("FooRomanceActive","GLOBAL",3).

 

The lovetalks are generally a Local on the character called Lovetalk, which is set to odd numbers inbetween the talks, and an even number during the talk. So at first it'll be set to Global("Lovetalk","LOCALS",1), which is what Foo's script will trigger off, it'll then play the romance theme, IncrementGlobal("Lovetalk","LOCALS",1), then Interact(Player1). Then either by script or at the end of the talk you IncrementGlobal("Lovetalk","LOCALS",1) again, so it's set to 3 for the gap between talks.

 

For various races you just use Race(Player1,ELF), for example. I believe it's called Races.ids or something like that, which tells you all the values it can take. Then if you just want multiple dialogue responses, that refer to various races you can do it as follows:

 

++ ~This is a generic response.~ GOTO Something
+ ~Race(Player1,ELF)~ + ~Forsooth, I am a pansy elf so I must speaketh using words of most ridiculousness and then prance away to frolic in some field.~ GOTO SomethingElse

 

In thise example, the first option will always been shown whereas the second will only be shown if the protagonist is an Elf.

Link to comment

Romance coding is no different from other dialogue coding - I think this is something that confuses some people. :thumbsup: Rather people just use the same style that BioWare did (and JC pioneered for the flirts) though you could track variables and whatever however you wanted.

Link to comment
IF ~~ LoveTalk (1)

("MazzyRomanceActive","LOCALS",1)

SAY ~<CHARNAME>, I wish to thank you.~

IF ~~ THENREPLY ~Thank me for what?~ GOTO M#TY1

IF ~~ THENREPLY ~I'm not sure what you're talking about Mazzy.~ GOTO M#TY1

IF ~~ THENREPLY ~Shut up. I do this for me and me alone.~ GOTO M#TY3

IF ~~ THENREPLY ~Shut up Halfling, I don't want your thanks. I do this for myself!~ GOTO M#TY3 [HERE2]

 

IF ~~ THEN BEGIN M#TY1

SAY ~I wish to thank you for many things. Freeing me from the Shade Lord's prison and helping me to exact my revenge. You have done so much for me, yet I have done nothing of value for you. You've asked nothing from me and although it is not much I offer you my friendship.~

IF ~~ THENREPLY ~I accept your offer of friendship.~ GOTO M#TY7

IF ~~ THENREPLY ~You do owe me. What of value can you give me?~ GOTO M#TY2

IF ~~ THENREPLY ~Silence yourself Mazzy, I do not need nor want your friendship.~ GOTO M#TY3

IF ~~ THENREPLY ~Hold your tongue Halfling, I care not for your snivelling acts.~ GOTO M#TY3

 

IF ~~ THEN BEGIN M#TY2

SAY ~It seems I am not such a judge of character. I had thought you were different to so many others. I have nothing other to offer you other than my sword arm and warrior's instincts.~

IF ~~ THENREPLY ~I spoke in haste. Your friendship is enough for me.~ GOTO M#TY4

IF ~~ THENREPLY ~Forgive my careless words. I'd love to have you as a friend.~ GOTO M#TY4

IF ~~ THENREPLY ~Please excuse my words, your fighting skills make you useful.~ GOTO M#TY5

IF ~~ THENREPLY ~What I want is gold, gems and even magic. Everyone has something and I demand that you give me what is rightfully mine!~ GOTO M#TY6

 

IF ~~ THEN BEGIN M#TY3

SAY ~You need not have spoken in such a harsh tone. I have thanked you and you have shown me how clearly undeserving you are. I will not bother you again.~ ("MazzyRomanceActive","GLOBAL",3)

END

 

IF ~~ THEN BEGIN M#TY4

SAY ~Your flattery is unrequired. I am willing to forgive you this once <CHARNAME> but I most certainly do not suggest you try me again. Now let us be on our way and with luck I shall be that good company you say I am.~ ("MazzyPatience","LOCALS",1) ("MazzyRomanceActive","LOCALS",1)

END

 

IF ~~ THEN BEGIN M#TY5

SAY ~My fighting skills are all I'm worth. I had hoped to become friends with you but I know now where I stand and I shall not bother you with my words again.~

IF ~~ THENREPLY ~That is not all that I appreciate. Please forgive my rude words.~ GOTO M#TY8

IF ~~ THENREPLY ~I see no other way to put it.~ GOTO M#TY9

 

IF ~~ THEN BEGIN M#TY6

SAY ~As I have already said I have nothing else to give other than my honour and oath. To ask for me of me makes you no better than the rats of the city sewers. I am sorry that this partnership did not work out. I shall leave at once and I shall not return. I ask that you do not follow me as I have made up my mind.~ ("MazzyRomanceActive","GLOBAL",3) [HERE1]

END

 

IF ~~ THEN BEGIN M#TY7

SAY ~Then thank you my friend. I owe you my life and my honour and I shall lend you my sword arm and friendship for as long as you require it.~ ("MazzyRomanceActive","LOCALS",1)

END

 

IF ~~ THEN BEGIN M#TY8

SAY ~I am glad that is not all that you appreciate. I do not like the implication but your apology is accepted. I will forgive you but I must ask that you do not try my patience.~ ("MazzyPatience","LOCALS",1) ("MazzyRomanceActive","LOCALS",1)

END

 

IF ~~ THEN BEGIN M#TY9

SAY ~You have made your feelings very clear to me <CHARNAME>, I shall not bother you

again.~ ("MazzyRomanceActive","GLOBAL",3)

END

 

Does this coding look right? Also, I need to know how to add the code for removing someone from the party [HERE1] and how to make [HERE2] available to everyone except halfings. What would the coding be to play the music and do I just place it before the ("MazzyRomanceActive","LOCALS",1)? Also, what is the coding for a stat requirement? Thanks.

 

SK

Link to comment

I'm certainly not an expert on this but spotting mistakes serves as a good exercise. I tend not to use the shorthand, so I suppose it's possible that I tell you to add thing that are not necessary (certainly they don't do any harm, though).

 

IF ~~ LoveTalk (1)

("MazzyRomanceActive","LOCALS",1)

SAY ~<CHARNAME>, I wish to thank you.~

IF ~~ THENREPLY ~Thank me for what?~ GOTO M#TY1

IF ~~ THENREPLY ~I'm not sure what you're talking about Mazzy.~ GOTO M#TY1

IF ~~ THENREPLY ~Shut up. I do this for me and me alone.~ GOTO M#TY3

IF ~~ THENREPLY ~Shut up Halfling, I don't want your thanks. I do this for myself!~ GOTO M#TY3 [HERE2]

 

LoveTalk should be a global or local variable like MazzyRomanceActive and they both should be inside the tildes (~~), that are now right before them. THENREPLY should be THEN REPLY. END marks the end of the block, EXIT terminates the dialog. Also the first block should have THEN BEGIN.

 

To make the reply option available under certain circumstances you simply add the condition to IF ~~. In this case you want to use the trigger 'race' and assuming that only the protagonist can have this conversation with Mazzy, you want player1's race. For further information check here: http://iesdp.gibberlings3.net/

 

Like this:

 

IF ~Global("LoveTalk",LOCALS,1)
   Global("MazzyRomanceActive","LOCALS",1)~ THEN BEGIN M#TY1Begin
SAY ~<CHARNAME>, I wish to thank you.~
IF ~~ THEN REPLY ~Thank me for what?~ GOTO M#TY1
IF ~~ THEN REPLY ~I'm not sure what you're talking about Mazzy.~ GOTO M#TY1
IF ~~ THEN REPLY ~Shut up. I do this for me and me alone.~ GOTO M#TY3
IF ~Race(Player1,HALFLING)~ THEN REPLY ~Shut up Halfling, I don't want your thanks. I do this for myself!~ GOTO M#TY3 
END

 

You should also consider getting a prefix that is not conflicting with mine (M#) :thumbsup:http://forums.blackwyrmlair.net/index.php?showtopic=113 . I'm not sure it there is anywhere info on where you should use the prefix, though. But at least you should use on your global/local variables. Personally, I stick my prefix on almost everything in my mod. :)

 

Also you have to consider if you want the LoveTalk and MazzyRomanceActive to be a global or local variable. If only Mazzy's script is using it, then it's okay to keep it local. But if (for example) you want to Viconia to initiate a romance conflict banter when MazzyRomanceActive is 1 and LoveTalk is 28, then it's handier to have the variables to be global. Because a character can only check his/her own local variables, but global variables are accessible to everyone.

 

 

IF ~~ THEN BEGIN M#TY3

SAY ~You need not have spoken in such a harsh tone. I have thanked you and you have shown me how clearly undeserving you are. I will not bother you again.~ ("MazzyRomanceActive","GLOBAL",3)

END

 

After SAY you should have IF ~~ THEN and after that a DO, REPLY, GOTO or EXIT. In this case when you want the dialog to terminate and you want to set the MazzyRomanceActive to 3. Also, since you used the variable as a local variable before you want to do that now too. All instances of MazzyRomanceActive should be either LOCALS or GLOBAL.

 

Like this:

 

IF ~~ THEN BEGIN M#TY3
SAY ~You need not have spoken in such a harsh tone. I have thanked you and you have shown me how clearly undeserving you are. I will not bother you again.~
IF ~~ THEN DO ~SetGlobal("MazzyRomanceActive","LOCALS",3)~ EXIT
END

 

IF ~~ THEN BEGIN M#TY4

SAY ~Your flattery is unrequired. I am willing to forgive you this once <CHARNAME> but I most certainly do not suggest you try me again. Now let us be on our way and with luck I shall be that good company you say I am.~ ("MazzyPatience","LOCALS",1) ("MazzyRomanceActive","LOCALS",1)

END

 

Similar case than before, but you also want to consider moving the LoveTalk variable in order to prevent this talk from triggering again. You need not to change the Mazzy RomanceActive here because it's already 1.

 

Like this:

IF ~~ THEN BEGIN M#TY4
SAY ~Your flattery is unrequired. I am willing to forgive you this once <CHARNAME> but I most certainly do not suggest you try me again. Now let us be on our way and with luck I shall be that good company you say I am.~ 
IF ~~ THEN DO ~SetGlobal("MazzyPatience","LOCALS",1) 
                  SetGlobal("LoveTalk","LOCALS",2)~ EXIT
END

Link to comment

Ok, that certainly makes it more challenge. I am thoroughly confused but all this information is very useful so thank you Meira. I think I get most of it and so I will tidy up what I can then get specific help with what I still can't do.

 

EDIT: So what variables would make sense as local and which global?

At the start of the dialog between the ~~ where I have MazyRomanceActive I need LoveTalk set as 1 aswell?

Do I just set the LT variable as one when the conversation ends, does this set it as 1 or add 1 to it?

What is the coding for starting LT music?

What is the coding to have someone leave the party?

When a LT is finished do you set LoveTalk to 2 or 3?

Thanks.

 

SK

Link to comment

1) Basically the only one you want as LOCALS is Lovetalk

2) You'll want to check that the lovetalk number is 2 for the first talk, 4 for the second, etc

3) In your script you'll have it increment by 1

4) Nowadays we add a blank music file, and then run a wav (take a look at Keto's coding for adding a blank music file), and then in the script we have PlaySong(0) followed by PlaySound("nameofwav")

5) LeaveParty(), though you may also want as well, EscapeArea()

 

To generally help you with this romance coding I'll give you some of my fairly standard romance code, which is just adapted from Bioware:

 

IF
       InParty(Myself)
       RealGlobalTimerExpired("G#J.JelinaRomance","GLOBAL")
       OR(2)
               Global("G#J.JelinaRomanceActive","GLOBAL",1)
               Global("G#J.JelinaRomanceActive","GLOBAL",2)
       Global("G#J.JelinaMatch","GLOBAL",1)
       !AreaType(DUNGEON)
       !AreaCheck("AR1300")
       See(Player1)
       !StateCheck(Player1,STATE_SLEEPING)
       !See([ENEMY])
       !Range([NEUTRAL],10)
       CombatCounter(0)
       OR(9)
               Global("G#J.Lovetalk","LOCALS",1)
               Global("G#J.Lovetalk","LOCALS",3)
               Global("G#J.Lovetalk","LOCALS",5)
               Global("G#J.Lovetalk","LOCALS",9) 
               Global("G#J.Lovetalk","LOCALS",11)
               Global("G#J.Lovetalk","LOCALS",13)
               Global("G#J.Lovetalk","LOCALS",15)
               Global("G#J.Lovetalk","LOCALS",17)
               Global("G#J.Lovetalk","LOCALS",19)

THEN
       RESPONSE #100
               PlaySong(0)
               PlaySound("G#JNASNG")
               IncrementGlobal("G#J.Lovetalk","LOCALS",1)
               Interact(Player1)
END

 

And then for the lovetalk itself (don't worry this lovetalk will never appear in any mod I write :thumbsup:):

 

IF ~Global("G#J.JelinaRomanceActive","GLOBAL",1)
Global("G#J.Lovetalk","LOCALS",2)~ THEN BEGIN FirstLovetalk
SAY ~So, do you think I'm HAWT or not?~
++ ~Yeah, you're DAMN HAWT!~ GOTO Yay
++ ~Nah, you're pretty fugly really...~ GOTO ScrewYouHippy

IF ~~ THEN BEGIN Yay
SAY ~I love you, <CHARNAME>!~
IF ~~ THEN DO ~IncrementGlobal("G#J.Lovetalk","LOCALS",1)
RealSetGlobalTimer("G#J.JelinaRomance","GLOBAL",1800)~ EXIT

IF ~~ THEN BEGIN ScrewYouHippy
SAY ~Well, just fuck off then!~
IF ~~ THEN DO ~SetGlobal("G#J.JelinaRomanceActive","GLOBAL",3)
GivePartyAllEquipment()
LeaveParty()
EscapeArea()~ EXIT

 

Hope that helps! And remember, the IESDP (http://iesdp.gibberlings3.net/) is your friend!

Link to comment

Ok, so this is what I have so far. Am I missing anything or does anything need altering at the moment? How do you set a reply for all races except one, do you just list them all seperately ignoring that specific one?

 

IF

In Party (Myself)

RealGlobalTimerExpired ("SK#MazzyRomance","GLOBAL")

Global ("SK#MazzyMatch","GLOBAL",1)

!AreaType (DUNGEON)

!AreaCheck ("AR1300")

See (Player1)

!StateCheck (Player1, STATE_SLEEPING)

!See ( [ENEMY] )

!Range ( [NEUTRAL], 10)

CombatCounter (0)

 

THEN

RESPONSE #100

Play Song (0)

Play Sound ("SK#MazzyRom")

IncrementGlobal ("LoveTalk","LOCALS",1)

Intereact (Player 1)

END

 

 

IF ~Global ("SK#MazzyRomanceActive","GLOBAL",1) ("LoveTalk","LOCALS",2)~ THEN BEGIN LT1

SAY ~<CHARNAME>, I wish to thank you.~

IF ~~ THEN REPLY ~Thank me for what?~ GOTO M#TY1

IF ~~ THEN REPLY ~I'm not sure what you're talking about Mazzy.~ GOTO THANK1

IF ~~ THEN REPLY ~Shut up. I do this for me and me alone.~ GOTO THANK3

IF ~~ THEN REPLY ~Shut up Halfling, I don't want your thanks. I do this for myself!~ GOTO THANK3

[HERE]

 

IF ~~ THEN BEGIN THANK1

SAY ~I wish to thank you for many things. Freeing me from the Shade Lord's prison and helping me to exact my revenge. You have done so much for me, yet I have done nothing of value for you. You've asked nothing from me and although it is not much I offer you my friendship.~

IF ~~ THEN REPLY ~I accept your offer of friendship.~ GOTO THANK7

IF ~~ THEN REPLY ~You do owe me. What of value can you give me?~ GOTO THANK2

IF ~~ THEN REPLY ~Silence yourself Mazzy, I do not need nor want your friendship.~ GOTO THANK3

IF ~~ THEN REPLY ~Hold your tongue Halfling, I care not for your snivelling acts.~ GOTO THANK3

 

IF ~~ THEN BEGIN THANK2

SAY ~It seems I am not such a judge of character. I had thought you were different to so many others. I have nothing other to offer you other than my sword arm and warrior's instincts.~

IF ~~ THEN REPLY ~I spoke in haste. Your friendship is enough for me.~ GOTO THANK4

IF ~~ THEN REPLY ~Forgive my careless words. I'd love to have you as a friend.~ GOTO THANK4

IF ~~ THEN REPLY ~Please excuse my words, your fighting skills make you useful.~ GOTO THANK5

IF ~~ THEN REPLY ~What I want is gold, gems and even magic. Everyone has something and I demand that you give me what is rightfully mine!~ GOTO THANK6

 

IF ~~ THEN BEGIN THANK3

SAY ~You need not have spoken in such a harsh tone. I have thanked you and you have shown me how clearly undeserving you are. I will not bother you again.~

IF ~~ THEN DO ~SetGlobal ("SK#MazzyRomanceActive","GLOBAL",3)~

EXIT

END

 

IF ~~ THEN BEGIN THANK4

SAY ~Your flattery is unrequired. I am willing to forgive you this once <CHARNAME> but I most certainly do not suggest you try me again. Now let us be on our way and with luck I shall be that good company you say I am.~

IF ~~ THEN DO ~IncrementGlobal ("SK#MazzyPatience","LOCALS",1) ("LoveTalk","LOCALS",1)~ EXIT

END

 

IF ~~ THEN BEGIN THANK5

SAY ~My fighting skills are all I'm worth. I had hoped to become friends with you but I know now where I stand and I shall not bother you with my words again.~

IF ~~ THEN REPLY ~That is not all that I appreciate. Please forgive my rude words.~ GOTO THANK8

IF ~~ THEN REPLY ~I see no other way to put it.~ GOTO THANK9

 

IF ~~ THEN BEGIN THANK6

SAY ~As I have already said I have nothing else to give other than my honour and oath. To ask for me of me makes you no better than the rats of the city sewers. I am sorry that this partnership did not work out. I shall leave at once and I shall not return. I ask that you do not follow me as I have made up my mind.~

IF ~~ THEN DO ~SetGlobal ("SK#MazzyRomanceActive","GLOBAL",3)~

GivePartyAllEquipment ( )

LeaveParty ( )

EscapeArea ( )~ EXIT

END

 

IF ~~ THEN BEGIN THANK7

SAY ~Then thank you my friend. I owe you my life and my honour and I shall lend you my sword arm and friendship for as long as you require it.~

IF ~~ THEN DO ~IncrementGlobal ("LoveTalk","LOCALS",1)~ EXIT

END

 

IF ~~ THEN BEGIN MTHANK8

SAY ~I am glad that is not all that you appreciate. I do not like the implication but your apology is accepted. I will forgive you but I must ask that you do not try my patience.~

IF~~ THEN DO ~IncrementGlobal ("SK#MazzyPatience","LOCALS",1) ("LoveTalk","LOCALS",1)~

EXIT

END

 

IF ~~ THEN BEGIN THANK9

SAY ~You have made your feelings very clear to me <CHARNAME>, I shall not bother you again.~ IF ~~ THEN DO ~SetGlobal ("SK#MazzyRomanceActive","GLOBAL",3)~ EXIT

END

 

Thanks for all the help guys, it is invaluable.

 

SK

Link to comment

Just a couple of tweaks.

 

1) Watch all those spaces. The trigger is 'InParty()' not 'In Party ()'

 

2) PlaySound("SK#MazzyRom") won't work as the filename is too long. It's gotta be 8 chars or less.

 

3) The first three blocks of dialogue are all missing ENDs at the end of em.

 

4) You still have that [HERE] in the first block.

 

5) DO ~IncrementGlobal ("SK#MazzyPatience","LOCALS",1) ("LoveTalk","LOCALS",1)~ should be DO ~IncrementGlobal("SK#MazzyPatience","LOCALS",1) IncrementGlobal("LoveTalk","LOCALS",1)~

 

6) Intereact (Player 1) should be Interact(Player1). You mispelt Interact and there shouldn't be a space in 'Player1'.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...