Understated Ur-Drakon Callie Posted March 24, 2008 Share Posted March 24, 2008 I haven't had any need for variables so far, as the scripts work fine without them. However, after looking at some of JV's scripts, can variables be set as say... Code: variables;i == get_flag(4,1);j == char_has_trait(get_memory_cell(4),12);k == get_spell_level(get_memory_cell(4),0,7); Thanks Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Nioca Posted March 24, 2008 Share Posted March 24, 2008 Close. Only one equals sign is used when assigning variables, and each line of integer variables requires a short before initialization. So it'd look more like this: Code: variables;short i = get_flag(4,1);short j = char_has_trait(get_memory_cell(4),12);short k = get_spell_level(get_memory_cell(4),0,7); Quote Link to comment Share on other sites More sharing options...
Magnificent Ornk Ephesos Posted March 24, 2008 Share Posted March 24, 2008 Yes, they definitely can be set to things like that. However, there's a few things that need to be fixed... Code: variables;short i = get_flag(4,1);short j = char_has_trait(get_memory_cell(4),12);short k = get_spell_level(get_memory_cell(4),0,7); Each numeric variable needs to have 'short' before it. Also, when defining a variable, you just use one '='. The symbol '==' tells the game to check if, say, variable i is equal to the value of flag (4,1). EDIT: Curse you, Nioca! Quote Link to comment Share on other sites More sharing options...
Ineffable Wingbolt aka Ravenwing Posted March 24, 2008 Share Posted March 24, 2008 Alright, I have a question now, regarding the variable's data type. You both mentioned short, but I've seen short and int used interchangeably (I think). Is there a difference between the uses of the two? Quote Link to comment Share on other sites More sharing options...
Unflappable Drayk Lazarus. Posted March 24, 2008 Share Posted March 24, 2008 Nope. Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Callie Posted March 25, 2008 Author Share Posted March 25, 2008 Thank you, thought I recently discovered using Jeff's variables makes dialog boxes much easier to script. Quote Link to comment Share on other sites More sharing options...
Kyshakk Koan La paix Posted March 25, 2008 Share Posted March 25, 2008 In Avernumscript, does 'short' basically mean 'short int'? And is it signed? Quote Link to comment Share on other sites More sharing options...
Understated Ur-Drakon Celtic Minstrel Posted March 26, 2008 Share Posted March 26, 2008 Yes, and probably. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.