aqssxlzc Posted November 20, 2012 Share Posted November 20, 2012 I write a script for an NPC recently. SCN NPC1Scriptint var1 And I find if i try to access NPC variable in dialogue, like ' set refNPC.var1 to 1 ' . I got error. Is there anyway to access Object script in dialogue? or there is any manual on variable scopes? is only the variable define in Quest script can be read in dialogue script? and the variable in Object script only can be read by itself?by the way, there is noway to add variable to Dialogue text. like "This gun is for $var caps." Right? Link to comment Share on other sites More sharing options...
viennacalling Posted November 21, 2012 Share Posted November 21, 2012 And I find if i try to access NPC variable in dialogue, like ' set refNPC.var1 to 1 ' . I got error. Is there anyway to access Object script in dialogue? Yes, look at followers like Jericho or Clover for examples. They have scripts attached to them, and the dialogue sets their variable. by the way, there is noway to add variable to Dialogue text. like "This gun is for $var caps." Right? Unfortunately not as far as I know. Only messages can do something like that, and it is very limited. Link to comment Share on other sites More sharing options...
vforvic Posted November 22, 2012 Share Posted November 22, 2012 You cannot use Variables in the Dialogue itself, but you can use Variables to determine which Dialogue is shown and thus get the same effect. For example. In a Quest Script you can have 3 Variables for 3 amounts of money. Var1 would be for 100 Caps, Var2 for 200 Caps and Var3 for 300 Caps. Then in the Info Section of the Dialogue you would have 3 items, each with 1 of the 3 Variables set to if == 1. Var1 would only show if Var1 was 1 or Var2 if it was 1 or Var3 if it was set to 1. Only the Dialogue would show with the correct amount and the other 2 would be hidden. You could use Scripts, Triggers, other Dialogue or whatever to set those Variables. Link to comment Share on other sites More sharing options...
aqssxlzc Posted November 22, 2012 Author Share Posted November 22, 2012 And I find if i try to access NPC variable in dialogue, like ' set refNPC.var1 to 1 ' . I got error. Is there anyway to access Object script in dialogue? Yes, look at followers like Jericho or Clover for examples. They have scripts attached to them, and the dialogue sets their variable. by the way, there is noway to add variable to Dialogue text. like "This gun is for $var caps." Right? Unfortunately not as far as I know. Only messages can do something like that, and it is very limited.I got it. must use Editor ID in script. Link to comment Share on other sites More sharing options...
Recommended Posts