I never really tried multiplication in AGS before and now that I am I am having truoble.
I can't figure out how to set this line up
game.score *= Link;//Link = int
Can someone tell me what it is I'm doing wrong?
game.score is read-only. Use GiveScore(game.score * 4);
See the manual for more info.
Thanks it works now.
Is there a way around this to get this to work?
@1
score = game.score;//Is there something else I could use in the place of game.score?
if(score <= 2000){
}
stop
[code]
[/code]
You can read game.score any time, no need to set it to another variable to check it. It looks like this is in a dialog though so make sure you add one tab to use the script commands (see the "Using scripting commands in dialogs" section in "Setting up the game" in the manual)
I got it working but I have my last questions
The player is getting to much score points and it makes it go down into the negatives.
I would like to use this instead.
Link *= 50;// or something like it.
no no thats not right. I wanted to have it do something else so just give me a sec to think.
I wanted to have 50x2 then add that to the score.
You can manage score (and multiply it in another variable) then set it back to the real score with GiveScore:
int score = game.score;
score *= Link;
GiveScore(score - game.score);
I don't use score in my games but it seems like you could manage score in a custom variable (since it's basically just a global variable being displayed on a GUI anyway), but you would also have to add in any sound you wanted to make when it changed manually (and the on_event for the change wouldn't fire).
i dont think AGS supports the *= operator.
I think it only has += and -=
@pcj: Thanks but I found away to around it.
@Calin: that maybe true but it would be nice if it was included.