Jump to content

Question about StateCheck("",CD_STATE_NOTVALID)


Xenala

Recommended Posts

Posted

I another question : When we write dialogue or somethings else we have to check if the person can talk first. But it began quickly long with check if is dead, asleep...

So while I was reading some of yours files of some of your mod I fond that : !StateCheck("cre",CD_STATE_NOTVALID), I was quite happy so I put it in my file, but it still doesn't work.

Then I saw that I have to put :

APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~
UNLESS ~CD_STATE_NOTVALID~

in my TP2 file.

 

But it still doesn't work and my french friend who mod too didn't know of this comand. ( I hope until here you understand I don't often speak English :cry: )

 

So my question is : how can I use this ?

 

While weidu is working is telling me :

[trigger list near line 7, column 146 of Trriviahn\d\T#TrriB.d] PARSE WARNING at line 7 column 42-42
Near Text: )
[StateCheck] argument [CD_STATE_NOTVALID] not found in [State.IDS]

Did I forgot or mess up something ?

 

Thanks for reading !

Posted

In using this :

APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~
UNLESS ~CD_STATE_NOTVALID~

 

Yes I did.

Posted

But is the append right at the beginning of the install, or below the dialogue/script you're trying to compile? If it's below, then you would get the error you're describing, and it should be fixed by moving the append to the top of the install. :cry:

 

If it's above, you might need to post the part of the dialogue/script in question which uses CD_STATE_NOTVALID, as well as your .tp2 file.

Posted

And a quick side note - it is not "cre", it is DV:

 

The following is invalid usage:

 

!StateCheck("X#Nelson",CD_STATE_NOTVALID)

 

The following is valid usage:

 

 

!StateCheck("Nelson",CD_STATE_NOTVALID)

 

 

where the creature file is X#NELSON.cre and the script name is Nelson!

Posted

Er yes for the cre part I know but I put this cause I didn't know what else I can put there ;) .

It seems that it actually works but I did some stupid thinks again and that must be the cause of problem. I delete the part which doesnt works and just like below theu were [...]("",CD_STATE_NOTVALID) and that it works it must be my clumsiness who cause de problem :cry:

 

Just a thing : is it possible usin interject_copy_trans to set a global when someone talk for example when firkarg talk about the PC lineage (Bhall) Set a global in order that my NPC know that the PC is a child of Bhall ?

 

It's in trying doing this that it seems I mess someting.

Posted

Yes, the global is already set when you do an interject_Copy_trans(I_C_T). For example:

 

I_C_T AEWERE2 1 MyVariableSets

== MARYJ IF ~InParty("Mary") InMyArea("Mary") !StateCheck("Mary",CD_STATE_NOTVALID)~ THEN ~Aaaa! Werewolves! And a Child of Bhaal!~

END

 

- after this interjection, MyVariableSets will automatically be set to 1. The "name" of the interjection is the variable, and it is set to 1 afterwards every time.

Posted

It is possible to use INTERJECT_COPY_TRANS to set a global, and indeed, it's the best way to track whether one NPC has met another.

 

This is from Gavin. I use the variable I set to make sure he doesn't comment on finding the letter unless he was actually in the room when the quest was handed out.

 

Pay no attention to the ugly dialogue file names. That's because it's set up for cross-platform variables.

 

///* Beregost - Mirianne */
I_C_T ~%tutu_var%MIRIAN~ 0 BGavinMirianne1
== ~%tutu_var%MIRIAN~ IF ~InParty("B!GAVIN") InMyArea("B!GAVIN") !StateCheck("B!GAVIN",CD_STATE_NOTVALID) %BGT_VAR%~ THEN ~Gavin, I know it has been a while since you were our neighbor, but you'll help an old friend, won't you?~ DO ~SetGlobal("B!HelpMirianne","GLOBAL",1)~
== ~B!GAVINJ~ IF ~InParty("B!GAVIN") InMyArea("B!GAVIN") !StateCheck("B!GAVIN",CD_STATE_NOTVALID) %BGT_VAR%~ THEN ~Of course, Mirianne. We'll keep our eyes open and send word if we hear anything.~
== ~%tutu_var%MIRIAN~ IF ~InParty("B!GAVIN") InMyArea("B!GAVIN") !StateCheck("B!GAVIN",CD_STATE_NOTVALID) %BGT_VAR%~ THEN ~Thank you! I know Roe can take care of himself, but I would rest so much easier if I just knew that he is safe.~
END

Posted

Ok but what if I whant to set a variable here in order that my NPC know about Bhall there will be a lot of different interjection so I can't give them the same variable set ?

If yes so I just have to change the name of the differente bloc in order that they all set the same varible but at the same my NPC won't actually talk, just watch is it possible ?

Posted

If you want to set a variable without your NPC actually talking, I'd advise this:

 

EXTEND_BOTTOM FIRKRA02 7

IF ~InParty("NPC") Global"NPCKnowsAboutBhaal","GLOBAL",0)~ DO ~SetGlobal"NPCKnowsAboutBhaal","GLOBAL",1)~

COPY_TRANS FIRKRA02 7

END

 

See if it works.

Posted

Then you'll have to enter a dialogue line - an actual interjection, as I posted above. No other way, I'm afraid. :cry:

 

Or you could EXTEND_BOTTOM Firkraag's last dialogue state, and then put EXIT instead of EXTERN - but it can get messy, because other mods append to this state, too. I'd go with a simple interjection.

Posted
Just a thing : is it possible usin interject_copy_trans to set a global when someone talk for example when firkarg talk about the PC lineage (Bhall) Set a global in order that my NPC know that the PC is a child of Bhall ?

 

If you want a varable to be set in an in-game dialogue I'd recomment ADD_TRANS_ACTION:

 

For example, I want the variable "Global("C#Q09_TalkedToOogiew","GLOBAL",1)" to be set after Oolgie Wisham talks about the injured Bjornin (Beregost, BG1).

 

Oogie talks about feeling watched by the paladin downstairs, and I want to check whether the PC already had this conversation when talking to Bjornin. The original Oogie-dialogue block goes (sorry for the German version):

 

IF ~NumTimesTalkedTo(0)
~ THEN BEGIN 0 // from:
 SAY #11431 /* ~Er ... er ist immer noch da unten?~ */
 IF ~~ THEN REPLY #11432 /* ~Geht mir aus den Augen, Bauer!~ */ GOTO 1
 IF ~~ THEN REPLY #11434 /* ~Wen meint Ihr?~ */ GOTO 2
END

 

the Code for adding the setting the variable would be

 

ADD_TRANS_ACTION OOGIEW BEGIN 0 END BEGIN 0 1 END ~SetGlobal("C#Q09_TalkedToOogiew","GLOBAL",1)~

The first BEGIN END includes the state, the second BEGIN END includes the respond numbers, starting from "0" for the first above respond option. So, it is possible to ADD_TRANS_ACTION to a specific reply option only (which makes a lot of sense).

 

In my case, it is added to both reply options:

 

Now, after compilation and decompilation the dialogue block reads as:

IF ~NumTimesTalkedTo(0)

~ THEN BEGIN 0 // from:

SAY #11431 /* ~Er ... er ist immer noch da unten?~ */

IF ~~ THEN REPLY #11432 /* ~Geht mir aus den Augen, Bauer!~ */ DO ~SetGlobal("C#Q09_TalkedToOogiew","GLOBAL",1)~ GOTO 1

IF ~~ THEN REPLY #11434 /* ~Wen meint Ihr?~ */ DO ~SetGlobal("C#Q09_TalkedToOogiew","GLOBAL",1)~ GOTO 2

END

 

See also the WeiDU readme for explanation.

Posted

Thank you ! It's actually working ! Great ! :cry:

Yea I'm really excited cause I spend quite a lot of time trying to fixe the matter :D

Poor ("",CD_STATE_NOTVALID) it wasn't even is fault :D

Well another thank and I hope that I won't have to bother you much more in the future ;)

Posted

Jastey rocks. :cry:

 

But, remember, unlike it is with I_C_T, this method has one disadvantage:

 

- if, after your mod, you install another mod which adds more replies to Firkraag dialogue(some quest mod, for example; Romantic Encounters do that, too, though not exactly in this place), and the player chooses this new reply, your variable will not get set.

 

With I_C_T, your guy/girl says a line, and the variable sets every time, regardless of any and all other mods you have installed.

Archived

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

×
×
  • Create New...