David Brasher Posted April 6, 2012 Share Posted April 6, 2012 (edited) The scripts never compile no matter how I write them and no matter what properties I set for them. I want to figure out how to change the value of a variable. How do you say this line in Papyrus? Set Var to 1 The wiki says something like: Var = 1 That doesn't compile though. Edited April 6, 2012 by David Brasher Link to comment Share on other sites More sharing options...
fg109 Posted April 6, 2012 Share Posted April 6, 2012 Could you post your whole script and/or the error(s) the compiler throws out? Link to comment Share on other sites More sharing options...
Outlandstalker Posted April 6, 2012 Share Posted April 6, 2012 (edited) Before you can set the value of a variable, you have to define it at the top at your script. ScriptName <insert name here> Extends <whatever> Int VarA = 1 ;<-- This line defines "VarA" as integer and initialized it with 1VarA = 1 ;<-- This doesn't work, because it's outside a sub or function Event OnLoad() VarA = 1 ;<-- This works, because "VarA" is defined and inside the sub of the "OnLoad" event VarB = 1 ;<-- This doesn't work, because "VarB" isn't definedEndEvent Hope it helps. Edited April 6, 2012 by Outlandstalker Link to comment Share on other sites More sharing options...
Recommended Posts