Main Menu

SetScore?

Started by Jackeea, December 26, 2013, 10:18:16 PM

Previous topic - Next topic

Jackeea

I've tried to use the "SetScore" function in a code, but it keeps returning the error message "Invalid Token: SetScore." I get that this means that SetScore isn't a recognized command, but it's in the CRPL reference, under Score commands. I'm trying to make a script that stores a variable called "score", and when there're no more landed command nodes (i.e. the mission is lost), it destroys the enemy units and sets the score to whatever the variable was.
Here's the code, by the way:
$Score:0
$Landed:0
<-score 1 add ->score
GetCommandNodeCount neq0 if
1 ->Landed
endif
GetCommandNodeCount 0 eq if
<-Landed 1 eq if
<-score SetScore
DestroyAllEnemyUnits
Destroy (Self 2)
endif
endif

So what else could I do in order to make the score change?

J

#1
What I did was changing the time and the score would adapt automatically. This requires a timelimit however as you most likely can't set the time to negative values (didn't test). Using 'additional score' should work (increasing it every frame) however the game automatically substracts points from the score meaning you'll have to add a lot of points for this to work.

Relli

Out of curiosity, J, why do you always say 'Addictional' score?

knucracker

#3
There is no "SetScore" function... but there are these three four:

GETSCORE
SETADDITIONALSCORE
GETADDITIONALSCORE
ADDADDITIONALSCORE

Grauniad

Quote from: virgilw on December 27, 2013, 10:41:42 AM
There is no "SetScore" function... but there are these three four:

GETSCORE
SETADDITIONALSCORE
GETADDITIONALSCORE
ADDADDITIONALSCORE


:)
A goodnight to all and to all a good night - Goodnight Moon

knucracker


thepenguin

We have become the creeper...

kwinse

While you're fixing the main list, the score commands are duplicated between score commands and utility commands.

Jackeea

Quote from: virgilw on December 27, 2013, 10:41:42 AM
There is no "SetScore" function... but there are these three four:

GETSCORE
SETADDITIONALSCORE
GETADDITIONALSCORE
ADDADDITIONALSCORE


Okay, thanks. So, I'm assuming that SetAdditionalScore will change the score to something, GetAdditionalScore will push to the stack the amount of score points added, and AddAdditionalScore will add score points, or am I missing something?

thepenguin

Quote from: Jackeea on January 05, 2014, 02:18:25 PM
Quote from: virgilw on December 27, 2013, 10:41:42 AM
There is no "SetScore" function... but there are these three four:

GETSCORE
SETADDITIONALSCORE
GETADDITIONALSCORE
ADDADDITIONALSCORE


Okay, thanks. So, I'm assuming that SetAdditionalScore will change the score to something, GetAdditionalScore will push to the stack the amount of score points added, and AddAdditionalScore will add score points, or am I missing something?
That is the functionality, to my knowledge.
We have become the creeper...