Page 1 of 1

execsetgamevar broken?

Posted: Sat Jun 21, 2014 6:12 pm
by bwheatley
Vic,

is there a bug with execsetgamevar?

I tried tempstring, realstring, tempvar, and real number and all errored when i tried to run the event.

Image

RE: execsetgamevar broken?

Posted: Sat Jun 21, 2014 7:59 pm
by Veni
Just off-the-cuff: does Gameslot_Testing2(#4) require a numerical value, e.g. '0'? Is line two necessary if you reset it on line 4?

(edit: just realized you asked Vic; don't mean to be rude & intercede)

RE: execsetgamevar broken?

Posted: Sun Jun 22, 2014 1:32 am
by Jeffrey H.
Also, single quotes around test is that valid ?

RE: execsetgamevar broken?

Posted: Sun Jun 22, 2014 4:51 am
by bwheatley
I tested with strings or numeric. And the Quotes are generated by the function.

RE: execsetgamevar broken?

Posted: Sun Jun 22, 2014 3:02 pm
by Vic
Yes it is because you are doing something a bit weird here.

ExecSetGameVar( game var slot #, new value)

So specify a value between 0-499 for game var slot #.

You are actually specifying as the slot # the value stored in gamevar slot #4 (which is probably -1 and causing the error)

If you want to directly set a gamevar directly just use a

SETVAR: GameVarSlot_Testing(#4) = 'test'

best regards,
Vic

RE: execsetgamevar broken?

Posted: Sun Jun 22, 2014 11:23 pm
by bwheatley
ahh cool thanks Vic. :) Makes sense when you describe it that way. :)