I never have done really complicated scripts, but the ones used in my two games, especially Mikey T, made me proud.
Sadly, I haven't scripted in over a year, and don't remember jack crap. Even the simplest things seem tough. Here's my script:
Code:
include, plotscr.hsd
include, scancode.hsi
global variable,begin
1, health
end
define constant,begin
1, string:health
end
plotscript,game,begin
health := 10
$1="Health: "
show string at (1,20,10)
append number (string:health, health)
show string at (string:health,30,10)
wait for all
end
plotscript,collision,begin
health -= 1
wait (10)
clear string (string:health)
append number (string:health, health)
if (health == 0) then (game over)
end
include, scancode.hsi
global variable,begin
1, health
end
define constant,begin
1, string:health
end
plotscript,game,begin
health := 10
$1="Health: "
show string at (1,20,10)
append number (string:health, health)
show string at (string:health,30,10)
wait for all
end
plotscript,collision,begin
health -= 1
wait (10)
clear string (string:health)
append number (string:health, health)
if (health == 0) then (game over)
end
I know this is probably the most hillbilly way to set a health bar and update it, but it is the only way in over an hour's time that I've figured out how to do it.
The problem is that when I clear the string, it erases the other string on the screen as well, not just the actual representation of health.
Any help on this would be much appreciated. Again, I know it is an easy fix, but I can't wrap my head around scripting anymore.
Which leads me to another thing; we've had many good plotscripting articles over the years. Unfortunately though, many of them were made for specific things in mind (the side-scrolling ones come to mind). I was thinking it would be pretty sweet if someone were to make a general tutorial on plotscripting. Something that is a bit more advanced than this.
Maybe it's just me, but I think such an article would be really beneficial to folks looking for a refresher on plotscripting altogether.[/url]
Cornbread Chemist



