jrc24 Posted June 25, 2004 Share Posted June 25, 2004 hi how can I do that ? I have a placeable (computer) when I use it I get a dialog with many option (exemple : to diffuse toxic gas), or exit, or other... I would do that : when I use the option (exemple : to diffuse toxic gas), I don t want that it can be possible to use it again, I want that the used option be disabled. I m sure I must do that with a script but what is the command for this kind of things ? I don t know must I do a script wich delete my placeaple and put an other placeable (at the same place) wich call an other dialog (I don t think) or must I do a script wich edit the dialog, or other thing... if somebody know, thanks Link to comment Share on other sites More sharing options...
tk102 Posted June 25, 2004 Share Posted June 25, 2004 jrc24, in your other thread you asked about how to fire a script only once -- well that same idea applies here. The secret to opening/closing forks in the dialog is in a certain field of the StartingList, EntriesList, and RepliesList. In GFF editor this field is called 'Active'. In DLGEdit, I simply called it 'Script'. But unlike normal scripts that begin 'void main()' the scripts that you reference in this field begin 'int StartingConditional()' and return either TRUE or FALSE at the end of the script. Then, the dialog knows whether or not to provide that fork. So in this way, we can use the SetLocalBoolean/GetLocalBoolean functions again to provide a way for latching/unlatching certain dialog forks. Here's an example: EntryList -> 0 -> -> Text: What do you want to do? -> -> RepliesList: -> -> -> 0 -> -> -> -> Active: chk_vent -> -> -> -> Index: 0 -> -> -> 1 -> -> -> -> Active: -> -> -> -> Index: 1 ReplyList -> 0 -> -> Text: Turn off vent -> -> Script: turn_off_vent -> 1 -> -> Text: Nothing. I should go now. chk_vent.nss has this code: int StartingConditional() { return (!GetLocalBoolean(GetObjectByTag("vent",1))); } and turn_off_vent.nss has this code: void main() { // do the main part of the code // and at the end do this: SetLocalBoolean(GetObjectByTag("vent"),1,TRUE); } When the PC first arrives at the vent, the LocalBoolean in the 1st slot is FALSE. When the dialog begins, chk_vent is run and returns the opposite of FALSE, TRUE. This allows ReplyList 0 to be available to the player. If the player chooses to turn off the vent, turn_off_vent script fires and sets the LocalBoolean, slot 1 of the vent to TRUE. Thus the next time dialog is initiated chk_vent will return FALSE and the PC will not get to do it again. Link to comment Share on other sites More sharing options...
jrc24 Posted June 25, 2004 Author Share Posted June 25, 2004 I understand very well how it functions now, thank you but I have a problem when I try to compile the first script code: ---------------------------------------------------------------------------- int StartingConditional() { return (!GetLocalBoolean(GetObjectByTag("my_object_tag",1))); } -------------------------------------------------------------------------------- nwnnsscomp say to me : error : required argument missing in call to "GetLocalBoolean" error : not all paths return a value if you know what is the problem, thank you Link to comment Share on other sites More sharing options...
Darth333 Posted June 25, 2004 Share Posted June 25, 2004 Try the following syntax: ---------------------------------------------------------------------------- int StartingConditional() { return (!GetLocalBoolean(GetObjectByTag("my_object_tag"),1 )); } -------------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
tk102 Posted June 25, 2004 Share Posted June 25, 2004 Yes - what she said. Thanks Darth333. Link to comment Share on other sites More sharing options...
Darth333 Posted June 25, 2004 Share Posted June 25, 2004 Originally posted by tk102 Yes - what she said. Thanks Darth333. I had a good teacher Link to comment Share on other sites More sharing options...
jrc24 Posted June 25, 2004 Author Share Posted June 25, 2004 yeeeeeeeeeeeeeeeessssss !!!!! now it works ! thank you very much tk102 and darth333 :D :D :D :D :D Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.