Help - Search - Members - Calendar
Full Version: More State Checks...
The Black Wyrm's Lair - Forums > Mod development resources & discussion > Modder's Workshop
Sir_Carnifex
Two questions here...

I know I saw somewhere (but can't remember where) that someone mentioned using this because it includes a lot of states... The problem is WeiDu gives me this message when I use it:

[StateCheck] argument [CD_STATE_NOTVALID] not found in [State.IDS]

The mod still installs, but with warnings. Is this usual when using that state check, or am I using/typing it wrong? This is how I have it:

!StateCheck("character",CD_STATE_NOTVALID)



And the second question. What is the check to determine if it is raining or not? I did find the weather identifiers, but not what check to put in place. Or is there such a thing?
Edit: Found the answer to the weather question.
Bearwere
APPEND ~STATE.IDS~ // adds custom IsValidForPartyDialogue state
~0x80101FEF CD_STATE_NOTVALID~
UNLESS ~CD_STATE_NOTVALID~
Sir_Carnifex
I assume you mean adding that bit to the TP2, right?

Edit:

Nevermind, I found the answer to this question. So now I added that to the TP2 and it still gives me the message. However, the install no longer says "Installed with warnings". Now I get "Successfully Installed". So does this mean I can ignore the parse error it gives me regarding the use of the new state check?
jastey
What parse error do you get? Is it still there after you add the custom state to the ids via the tp2-patching? (Sorry for not pointing that out earlier, btw. I mentioned the custom state but didn't tell you how to implement it. It's from CamDawg, btw., just for the credits.)

To weather: No check, unfortunately, only action. So, if you want a banter only fire if it's raining (or not), you have to set the whether, run a timer of say 5 sec and then trigger the banter. I did that for one of Ajantis's love talks in BG1NPC project (script block slighty adapted to the example):

/* Weather change (no weather) */
IF
InParty(Myself)
(...)
!Detect([ENEMY])
See(Player1)
!StateCheck(Player1,CD_STATE_NOTVALID)
CombatCounter(0)
Global("C#WeatherTalk","GLOBAL",0)
OR(3)
AreaType(OUTDOOR)
AreaType(WEATHER)
AreaType(FOREST)
THEN
RESPONSE #100
SetGlobal("C#WeatherTalk","GLOBAL",1)
Weather(NOWEATHER)
RealSetGlobalTimer("C#WeatherTalkTimer1","GLOBAL",5)
MoveToObject(Player1)
END

Have a look in the IESDP which weather can be set: http://iesdp.gibberlings3.net/files/ids/bg2/weather.htm
Sir_Carnifex
QUOTE
What parse error do you get? Is it still there after you add the custom state to the ids via the tp2-patching? (Sorry for not pointing that out earlier, btw. I mentioned the custom state but didn't tell you how to implement it. It's from CamDawg, btw., just for the credits.)
CODE
[CXHalbo/CXHalbo.baf] PARSE ERROR at line 5 column 39-39
Near Text: )
    [StateCheck] argument [CD_STATE_NOTVALID] not found in [State.IDS]

That's the parse error I get AFTER appending the State.ids in the TP2. More towards the bottom, it says this:
CODE
[*.IDS] forgotten
Appending to files ...
Appending [0x80101FEF CD_STATE_NOTVALID...] to [STATE.IDS] because it does NOT contain [CD_STATE_NOTVALID]
Appended text to [STATE.IDS]

And it does say "Successfully Installed".

QUOTE
To weather: No check, unfortunately, only action. So, if you want a banter only fire if it's raining (or not), you have to set the whether, run a timer of say 5 sec and then trigger the banter. I did that for one of Ajantis's love talks in BG1NPC project (script block slighty adapted to the example):

I already got the weather talk done. I set the weather to clear, then a wait...then the talk triggers. It took a few tries of tinkering around, but I got it. Mine is a bit more complicated as it involves four triggers/talks. I was a bit surprised I got it done as fast as I did. Thanks anyway. smile.gif
plainab
I don't know if you were ever given the solution to resolve the error you were receiving regarding the use of CD_STATE_NOTVALID.
I will go ahead and answer here so that others who may look here for a solution to your problem as a help to their problem will understand what is going on.

1) If you wish to check for a certain state, you need to make sure that that state is present in the state.ids file.
2) if not, you need to add it somewhere within your tp2 prior to the script or dialog file where you wish to use the associated state.
Example from this topic:
CODE
APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~
         UNLESS ~CD_STATE_NOTVALID~

3) however, weidu will not recognize the new entry until it's memory has been flushed and base game files reread.
Example to do this:
CODE
APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~
         UNLESS ~CD_STATE_NOTVALID~
CLEAR_IDS_MAP


The addition of CLEAR_IDS_MAP tells weidu to clear it's memory of script dependent files and reread them. Once it does this, you will be able to use the new addition in any script or dialog file as you deem necessary. You only need to have the CLEAR_IDS_MAP one time before you compile any files using the additions. Therefore, you can append multiple states, spells, triggers, actions, shouts, etc. and have a single CLEAR_IDS_MAP on the line above your first file taking advantage of the new additions.

I hope this is helpful and clear to you and anyone else who has a similar question.

The Bigg
QUOTE(plainab @ Sep 1 2008, 04:52 PM) *
The addition of CLEAR_IDS_MAP tells weidu to clear it's memory of script dependent files and reread them. Once it does this, you will be able to use the new addition in any script or dialog file as you deem necessary. You only need to have the CLEAR_IDS_MAP one time before you compile any files using the additions. Therefore, you can append multiple states, spells, triggers, actions, shouts, etc. and have a single CLEAR_IDS_MAP on the line above your first file taking advantage of the new additions.

Recent WeiDU versions don't need CLEAR_IDS_MAP anymore (can't find the exact version in the change log, but I'm sure it's post 204 and all mods should use W204 or later anyway).

Carnifex: the APPEND must be done before the COMPILE/EXTEND. Are you sure you aren't APPENDING to the IDS after COMPILEing? (hopefully I'm not insulting you by asking stupid questions smile.gif )
Sir_Carnifex
QUOTE(The Bigg @ Sep 1 2008, 11:58 AM) *
Carnifex: the APPEND must be done before the COMPILE/EXTEND. Are you sure you aren't APPENDING to the IDS after COMPILEing? (hopefully I'm not insulting you by asking stupid questions smile.gif )

That would be the problem. I read somewhere just to add the lines to the Tp2, but I don't remember seeing where to put them, so I just put it down at the bottom. So, no, it's not a stupid question ... it's a very helpful question. smile.gif

Thanks to both of you!
The Bigg
QUOTE(Sir_Carnifex @ Sep 1 2008, 10:22 PM) *
So, no, it's not a stupid question ... it's a very helpful question. smile.gif

Glad to have helped. I ended up twice on the bad end of the "Is it plugged in?" anedoct - so perhaps there are no stupid questions after all tongue.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.