Givescore

Started by ncw14, Wed 19/12/2007 00:10:07

Previous topic - Next topic

ncw14

I have a game based on southpark, my HP on gui is same as score - i have a problem, i already have hp as both
Givescore (100);
SetGlobalInt (1, 100);

if i erase either my scripts will make no scence.

is there a way in script to say something like

Givescore = SetGlobalInt (1, 100);

or how would i write the operation 

Givescore (+20);
      it doesnt accept it, how do i add 20 to givescore

Ashen

Go back and read the manual entries for SetGlobalInt and GiveScore (along with everything else on variables you can find). They're two quite different functions. SetGlobalInt, as the name suggests, SETS the Global Int to whatever value you input; GiveScore on the other hand ADDS the value you input to the current score. So, the two lines you quote:
Code: ags

GiveScore (100);
SetGlobalInt (1, 100);

Aren't actually doing the same thing.

What are you asking? Because the obvious answer to "how do i add 20 to givescore" is GiveScore(20); - as it says in the manual. (The current score is the game.score variable, but you can't set that directly.)
The way to ADD to a Global Int would be SetGlobalInt(1, GetGlobalInt(1)+20); - which isn't in the manual, but is in the BFAQ.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk