Just when I think I'm getting the hang of scripting... I've got the player entering into a battle scenario, with the option to use one of two weapons. Each of the links is set up with scripting which determines if they hit the enemy, how much damage they do, if the enemy hits them, and how much damage the enemy does. The links just circle around to themselves until either the enemy is dead, or until the player is dead, or until the player chooses to retreat.
So, the problem I'm running into is this: I have a variable called %BATTLETRAC which keeps track of how many rounds of combat have passed. Each time the player clicks on a link, this variable increases by one. So, when I made the script for the page, this is what I did:
IF %BATTLETRAC = 1
THEN $PAGETEXT := "%%PLAYERRTH%<%12%You swing at the crocodile but your staff harmlessly bounces off its skull.%%%%PLAYERRTH%>=%12%Your staff connects, banging against the crocodile's skull with a satisfying thud. You've done some damage.%%" + "<br>" + "%%ENEMYRTH%<%ACHUNTER%The croc swings its mighty jaws toward you, but you're able to dodge out of the way.%%%%ENEMYRTH%>=%ACHUNTER%The croc's strong jaws close down on you! Ouch!%%" + "<br>" + "Your Health: %%PLAYERHP%%/%%HPHUNTER%%" + "<br>" + "Enemy Health: %%ENEMYHP%%/%%ENEMYMAXHP%%"
IF %BATTLETRAC = 2
THEN $PAGETEXT := "%%PLAYERRTH%<%12%Your quarterstaff harmlessly bounces off the croc's thick scales.%%%%PLAYERRTH%>=%12%You swing your quarterstaff directly into the crocodile's eyes! It blinks violently.%%" + "<br>" + "%%ENEMYRTH%<%ACHUNTER%The croc's jaws open and slam shut, but you manage to avoid being biten. This time.%%%%ENEMYRTH%>=%ACHUNTER%Your leg is caught in the croc's jaws! It shakes its head back and forth violently.%%" + "<br>" + "Your Health: %%PLAYERHP%%/%%HPHUNTER%%" + "<br>" + "Enemy Health: %%ENEMYHP%%/%%ENEMYMAXHP%%"
IF %BATTLETRAC = 3
THEN $PAGETEXT := "%%PLAYERRTH%<%12%You swing your staff down mightily toward the croc, but unfortunately your blow lands to the side of the croc's body.%%%%PLAYERRTH%>=%12%The staff lands directly on top of the croc's scaly head, seeming to stun it some!%%" + "<br>" + "%%ENEMYRTH%<%ACHUNTER%The crocodile thrashes back and forth, but you leap out of the way of its attack.%%%%ENEMYRTH%>=%ACHUNTER%The croc closes its jaws with a mighty bite directly onto your leg!%%" + "<br>" + "Your Health: %%PLAYERHP%%/%%HPHUNTER%%" + "<br>" + "Enemy Health: %%ENEMYHP%%/%%ENEMYMAXHP%%"
I was mostly trying to do this so there was some flavor and difference between each of the rounds. The %BATTLETRAC variable is working, but the variables for whether the player/enemy hits are displaying as typed, not as I intended for them to be scripted. Where have I gone wrong?