Jump to content

My first mod, Rose joinable NPC


kthxbye

Recommended Posts

Hi @ all! :)

This time I'm here with a question about the INTERJECT_COPY_TRANS command. I know about the importance of being careful on who talks last to prevent DO commands be assigned to the wrong person, but this time I need to add my own DO command to the dialog.

Since I cannot beta-test the whole mod each time (I lack time, sigh!) and don't want to release a bugged version I figured I could ask here.

Basically what I want is to do Rose say something and then leave, according to some variables. The .d code I've written is like this:

//Pissed off, she leaves!
INTERJECT_COPY_TRANS PLAYER1 33 rose-tol4
== PLAYER1 IF ~InParty("k-rose") InMyArea("k-rose") !Global("k-rose-romance","GLOBAL",2) !GlobalGT("k-rose-friendship","GLOBAL",-2)~ THEN
~Rose: the free spirited girl who wants to enjoy her life. During your travels you two never bonded, and she was often openly disappointed by your choices or ideas.~
END
++ ~This is my fight, Rose. You don't need to come with me now.~ EXTERN k-roseJ rose-tol4-1
++ ~Irenicus is a powerful mage, and you yourself saw what he's capable of, Rose. You don't need to face him now.~ EXTERN k-roseJ rose-tol4-2
++ ~I need you now, Rose. This fight is most important, and everyone will have to pull their weight.~ EXTERN k-roseJ rose-tol4-3

APPEND k-roseJ
IF ~~ THEN BEGIN rose-tol4-1
SAY ~Heh, yer right. Actually, I don't feel like risking my life for someone like ye, so.. Farewell, and good luck!~
DO ~LeaveParty() EscapeAreaDestroy(90)~
END

 

It's part of her Tree of Life talk, she leaves if she's pissed off. Will it work well, with the DO command and the other characters' dialogs? Also, I'm more used to CHAINs instead of APPENDs. Since CHAIN already append the dialog to the given dialog file, can I use it in this situation too?

 

Thank @ all in advance! :grin:

Link to comment

It seems I misread the NPC creation guide in a horrible, horrible way - that's what one gets when trying to code while being too sleepy. Anyway I've fixed it now, but I still need to know how to add actions assigned to Rose in that kind of dialog..

The correct structure is:

INTERJECT PLAYER1 33 rose-tol4
== PLAYER1 IF ~InParty("k-rose") InMyArea("k-rose") !Global("k-rose-romance","GLOBAL",2) !GlobalGT("k-rose-friendship","GLOBAL",-2)~ THEN
~Rose: the free spirited girl who wants to enjoy her life. During your travels you two never bonded, and she was often openly disappointed by your choices or ideas.~
END
++ ~This is my fight, Rose. You don't need to come with me now.~ EXTERN k-roseJ rose-tol4-1
++ ~Irenicus is a powerful mage, and you yourself saw what he's capable of, Rose. You don't need to face him now.~ EXTERN k-roseJ rose-tol4-2
++ ~I need you now, Rose. This fight is most important, and everyone will have to pull their weight.~ EXTERN k-roseJ rose-tol4-3

APPEND k-roseJ
IF ~~ THEN BEGIN rose-tol4-1
SAY ~Heh, yer right. Actually, I don't feel like risking my life for someone like ye, so.. Farewell, and good luck!~ COPY_TRANS PLAYER1 33
END

IF ~~ THEN BEGIN rose-tol4-2
SAY ~This time I feel like to agree with ye, <CHARNAME>. Good luck for yer fight, but I'm outta here.~ COPY_TRANS PLAYER1 33
END

IF ~~ THEN BEGIN rose-tol4-3
SAY ~Not a chance! Why should I gamble with my life now? Irenicus doesn't scare me, but I don't care what happens to ye. I'll just go back!~ COPY_TRANS PLAYER1 33
END

END

 

I tried with the usual DO ~Stuff()~ but it gives error while compiling..

Link to comment

I added 4 Tree of Life interjections, this is the last and worst one, for when Rose really isn't enjoying her staying with the party (or CHARNAME in particular) so I'd like her to leave.

Within a CHAIN structure, a DO ~LeaveParty() EscapeAreaDestroy(90)~ works, but I don't know how to add it here in the APPEND structure. I tried adding the DO action before the COPY_TRANS PLAYER1 33 command, but it doesn't compile. This is my first time with the APPEND structure, so I'm a bit clueless here (I usually use CHAIN to append too since that's what CHAIN does, and I find it very easy to use).

Also, I'm not sure if the action could actually be taken from an erroneous actor, since I know that with interjections it could happen without a fallback dialog line. If that happens I could easily just set a variable and make her leave by script after the dialogue anyway, and it probably is the easiest solution (since I still have to add a variable check and a set variable commands in the INTERJECT part of the dialog to avoid it cycling endlessly) but I'd still like to learn how to properly use APPENDs. :)

Thanks for your time! :grin:

Link to comment

Archived

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

×
×
  • Create New...