Understated Ur-Drakon Callie Posted March 24, 2008 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
Understated Ur-Drakon Nioca Posted March 24, 2008 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
Magnificent Ornk Ephesos Posted March 24, 2008 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
Ineffable Wingbolt aka Ravenwing Posted March 24, 2008 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
Understated Ur-Drakon Callie Posted March 25, 2008 Author Posted March 25, 2008 Thank you, thought I recently discovered using Jeff's variables makes dialog boxes much easier to script. Quote
Kyshakk Koan La paix Posted March 25, 2008 Posted March 25, 2008 In Avernumscript, does 'short' basically mean 'short int'? And is it signed? Quote
Understated Ur-Drakon Celtic Minstrel Posted March 26, 2008 Posted March 26, 2008 Yes, and probably. Quote
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.