//tag 1 is spikes or -5 health
//tag 2-4 is heat (2 is -20 health 4 is -10)
//tag 5 is radiation or -10 health
//tag 6 is smoke inhalation or -5 health
//tag 7 is health or +10 health
//tag 8 is instant death or -101 health
//all objects have a trigger type of 6, so they keep hurting you
//set health and whatnot
on_start = [
editbind "I" [showgui health];
health = 100
]
//health gui, press i to see it.
newgui health [
guitext ( format "You have %1 health." $health )
if ( < $health 21 ) [
guitext "You are in the RED ZONE. You need health."
]
guibar
guibutton "OK." [cleargui]
]
level_trigger_1 = [ //Pokey spikes
health = (- $health 10 );
echo "Ouch! That hurt!";
echo ( format "You now have %1 Health." $health );
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_2 = [ //fire level 1
health = (- $health 20 );
echo "It burns!";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_3 = [ //fire level 2
health = (- $health 15 );
echo "The pain!";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_4 = [ //fire level 3
health = (- $health 10 );
echo "Thats hot!";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_5 = [ //radiation
health = (- $health 10 );
echo "Radiation! AUGH!";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_6 = [ //smoke in lungs
health = (- $health 5 );
echo "*COUGH!* *COUGH!*";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_7 = [ //health
if ( < $health 100 ) [
health = (+ $health 10 );
echo "Ahhhhh...";
echo ( format "You now have %1 Health." $health )
] [
health = 100
]
]
level_trigger_8 = [ //instant death
health = (- $health 101 );
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
the download for the demo map is in the attachment.
If a packet hits a pocket on a socket on a port,
and the bus is interrupted as a very last resort,
and the address of the memory makes your floppy disk abort,
then the socket packet pocket has an error to report
it was my failed attempt at making it easier to view the health info. i have no idea on how to put a static progress bar in game, or even just text. I came up with THAT bit of code by exploring defaults.cfg (Dont edit that unless you know what you are doing.) It does not do anything, but display an error. the script still works perfectly.
If a packet hits a pocket on a socket on a port,
and the bus is interrupted as a very last resort,
and the address of the memory makes your floppy disk abort,
then the socket packet pocket has an error to report
//tag 1 is spikes or -5 health
//tag 2-4 is heat (2 is -20 health 4 is -10)
//tag 5 is radiation or -10 health
//tag 6 is smoke inhalation or -5 health
//tag 7 is health or +10 health
//tag 8 is instant death or -101 health
//all objects have a trigger type of 6, so they keep hurting you
//set health and whatnot
on_start = [
bind "I" [showgui health];
health = 100
]
//health gui, press i to see it.
newgui health [
guitext ( format "You have %1 health." $health )
if ( < $health 21 ) [
guitext "You are in the RED ZONE. You need health."
]
guibar
guibutton "OK." [cleargui]
]
level_trigger_1 = [ //Pokey spikes
health = (- $health 10 );
echo "Ouch! That hurt!";
echo ( format "You now have %1 Health." $health );
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_2 = [ //fire level 1
health = (- $health 20 );
echo "It burns!";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_3 = [ //fire level 2
health = (- $health 15 );
echo "The pain!";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_4 = [ //fire level 3
health = (- $health 10 );
echo "Thats hot!";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_5 = [ //radiation
health = (- $health 10 );
echo "Radiation! AUGH!";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_6 = [ //smoke in lungs
health = (- $health 5 );
echo "*COUGH!* *COUGH!*";
echo ( format "You now have %1 Health." $health )
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
level_trigger_7 = [ //health
if ( < $health 100 ) [
health = (+ $health 10 );
echo "Ahhhhh...";
echo ( format "You now have %1 Health." $health )
] [
health = 100
]
]
level_trigger_8 = [ //instant death
health = (- $health 101 );
if ( < $health 1 ) [
nap;
health = 100;
echo "You died!"
]
]
the download for the demo map is in the attachment.
Realistically you might want to use an "on-release" bind, or a bind with cntrl. But those are just some of the ideas that randomly float around my head. I need to get working on my Shift-Speed script.
arcones wrote:Realistically you might want to use an "on-release" bind, or a bind with cntrl. But those are just some of the ideas that randomly float around my head. I need to get working on my Shift-Speed script.
I'm gonna take it you meant "ctrl" there...
I havent tested this script out yet... But I'm probably going to use it to test out EasyScriptBuilder 0.1.5 before I release it. Maybe even use it for 0.5.0 to test out Error Checking... If I ever implement it.