Jump to content

Question about variables


Callie

Recommended Posts

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
Link to comment
Share on other sites

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);
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...