I am trying to create a dynamic TEXT and PANEL that shows up every time an enemy gets hit, so that the TEXT/PANEL shows the TITLE of the enemy, along with that enemy's HEALTH number. I want this TEXT/PANEL to remain on the screen for a certain amount of time, like 10 seconds after the enemy was last hit (and then disappear), or if a different enemy gets hit (to which I would want that enemy's own TEXT/PANEL to appear in place of the previous injured enemy's TEXT/PANEL.
This is the code so far that I have to try and do this:
// OgreFortress.c
...
STRING* title;
...
TEXT* enemy_health_txt =
{
layer = 1;
pos_x = 830;
pos_y = 10;
string (title, "'S HEALTH:");
flags = CENTER_X | TRANSLUCENT | SHOW;
}
PANEL* pDisplay =
{
digits (880, 10, 5, *, 1, my.HEALTH);
flags = SHOW;
}
...
action ogre_action()
{
...
title = "OGRE";
my.HEALTH = 100;
...
while(1)
{
...
}
}
action wizard_action()
{
...
title = "WIZARD";
my.HEALTH = 100;
...
while(1)
{
...
}
}
When I run this script as it is, I receive this error:
< string ^title, "'S HEALTH:");>
OGREFORTRESS.C 5:2 (): Bad or missing parameter
.. 1.218 sec.
1 runtime errors
Error E355: Startup failure - any key to abort
If I tried replacing "title" in the "TEXT* enemy_health_txt" function with "my.title", I get this error:
< string ^my.title, "'S HEALTH:");>
OGREFORTRESS.C 5:2 (): Syntax error - my.title invalid character
.. 1.203 sec.
1 runtime errors
Error E355: Startup failure - any key to abort
Does anyone know what I am doing wrong in the "title" area of the TEXT function?
Keep in mind that I am at the very beginning stages of making this dynamic TEXT/PANEL. I am sure that once this "title" issue has been resolved, I will probably have more questions about making the full dynamic TEXT/PANEL functionality work, that I will use this forum chain for. Thank you.