Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Scoring and variables

13 years ago
Hey all, I have a question about scoring. Lets say that I'm making a boxing game. The two fighters box for three rounds and each get points but not a knockout. Therefore, it must go to a decision. How do I make it that whoever has the higher variable score goes to the page that says they won?

Scoring and variables

13 years ago

If you're using advanced variables it should be possible for a link to only be available when varA > varB

So you make 2 links: Link 1 is visible if player 1 score > player 2 score, annd link 2 is visible if player 1 score < player 2 score and maybe you can make a tie link or something if player 1 score = player 2 score

Scoring and variables

13 years ago

Here's something I used (your variables and page #s will be your own of course) -

IF %HEALTH > 0 THEN
BEGIN
IF %WINS > %LOSSES THEN
 $DEST := @P4
IF %WINS = %LOSSES THEN
 $DEST := @P7
IF %WINS < %LOSSES THEN
 $DEST := @P5
END
IF %HEALTH < 1 THEN
 $DEST := @P12

The above allows for for a win, loss, or tie, and alsa where you lost all your health durring the round.

Scoring and variables

13 years ago
Wasn't that the scripting that you sent to me because it didn't work, or did you find a way to solve the problem?

Scoring and variables

13 years ago

Yeah, this is the final version that worked. If you want to add more you can, but you have to balance the nesting (BEGIN & END)'s - for example, the following didn't work until I got the (BEGIN & END)'s all in the right place:

 
IF %HEALTH > 0 THEN
BEGIN
IF %WINS > %LOSSES THEN
BEGIN
%SCORE:= %SCORE + (%ZZWINS * 10)
$DEST := @P8
END
IF %WINS = %LOSSES THEN
BEGIN
%SCORE:= %SCORE + (%ZZWINS * 5)
$DEST := @P10
END
IF %WINS < %LOSSES THEN
$DEST := @P5
END
IF %HEALTH < 1 THEN
$DEST := @P12