lonesoldier 0 Posted June 26, 2003 Simple Question. I have a picture of a health bar, with 10 squares on it. And ive got 10 .jpeg's of each square coloured in. For example, LIFE1.jpg has 1 square coloured red, LIFE2.jpg has 2 squares coloured in, and so forth. Now, i have a full coloured life bar graphic displayed at the bottom left of the screen, and ive got 10 triggers. Each trigger has a getdammage thing in the condition field. It detects how much damage aP(the player) has sustained, out of 10. Say ive sustained a dammage of 7 our of 10, then it will display the life bar with 7 boxes coloured in. BUT. The thing is, it wont display each graphic as i sustain damage. Ive got (getDammage aP >0.10), and (getDammage aP >0.20) etc. and the lifebars still will not change. If i put the > arrow to a < arrow (getDammage aP <0.20), then it will display a random graphic every time i start the mission. Main question is: How can i get a certain graphic to display on my screen as i sustain dammage? Is there a script i can make? If so, what will it look like? I have defined all 10 graphics in the description.ext, and they all work. I even got them to all display in order 1 - 10 by making a script that displays each graphic every 1 second. Also, another easy question: Ive got a large graphic of a suicide note, that appears on screen by the addAction command (aP addAction ["Read Letter","letter.sqs"]. And the graphic has a display duration of 15 seconds. Now, once 15 seconds is up, it dissappears, but the graphic of my health bar dissappears, even though the duration for the health bar is 2000 seconds. How can i get the health bar graphic to appear back on screen? I know i could set it to display the health bar at the end of the suicide note script, but what if i have sustained... say.... dammage of 0.50? How will i get it to display the last health bar graphic that was on-screen? Share this post Link to post Share on other sites
lonesoldier 0 Posted June 26, 2003 Dont worry fellas, figured it out! Apart from the last bit, which im still stuck on. Share this post Link to post Share on other sites
RED 0 Posted June 26, 2003 The last question should be quite easy to do: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _unit = _this select 0 #start ?(getdammage _unit) >= 0.00 && (getdammage _unit) < 0.10 : goto "1" ?(getdammage _unit) >= 0.10 && (getdammage _unit) < 0.20 : goto "2" ?(getdammage _unit) >= 0.20 && (getdammage _unit) < 0.30 : goto "3" ?(getdammage _unit) >= 0.30 && (getdammage _unit) < 0.40 : goto "4" ?(getdammage _unit) >= 0.40 && (getdammage _unit) < 0.50 : goto "5" ?(getdammage _unit) >= 0.50 && (getdammage _unit) < 0.60 : goto "6" ?(getdammage _unit) >= 0.60 && (getdammage _unit) < 0.70 : goto "7" ?(getdammage _unit) >= 0.70 && (getdammage _unit) < 0.80 : goto "8" ?(getdammage _unit) >= 0.80 && (getdammage _unit) < 0.90 : goto "9" ?(getdammage _unit) >= 0.90 && (getdammage _unit) < 1.00 : goto "10" #1 display image here ~_wait goto "start" #2 display image here ~_wait goto "start" ... That should solve your problem, execute the script after the note. RED Share this post Link to post Share on other sites
BraTTy 0 Posted June 26, 2003 Ahh but less cpu usage: _unit = _this select 0 #start _udamage = (getdammage _unit) ? _udamage >= 0.00 && _udamage < 0.10 : goto "1" ? _udamage >= 0.10 && _udamage < 0.20 : goto "2" ? _udamage >= 0.20 && _udamage < 0.30 : goto "3" ? _udamage >= 0.30 && _udamage < 0.40 : goto "4" ? _udamage >= 0.40 && _udamage < 0.50 : goto "5" ? _udamage >= 0.50 && _udamage < 0.60 : goto "6" ? _udamage >= 0.60 && _udamage < 0.70 : goto "7" ? _udamage >= 0.70 && _udamage < 0.80 : goto "8" ? _udamage >= 0.80 && _udamage < 0.90 : goto "9" ? _udamage >= 0.90 && _udamage < 1.00 : goto "10" I know Red knows,but just using his example for others Share this post Link to post Share on other sites
Bart.Jan 0 Posted June 26, 2003 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_unit = _this select 0 #start ~_wait _dam=10 * (getDammage _unit) _dam=_dam-(_dam%1) goto (format["%1",_dam]) #0 goto "start" #1 ... goto "start" #2 ... goto "start" The pictures must be (somehow) defined in description.ext and then called by titleRsc. Share this post Link to post Share on other sites
lonesoldier 0 Posted June 27, 2003 Thanks guys! BUT, where in that script do i type the cutRsc syntax for each of the 10 picture files? Share this post Link to post Share on other sites
RED 0 Posted June 27, 2003 Uisng Barts script (which is the best way of doing it): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _unit = _this select 0 ~_wait = time in seconds to wait (whatever you set it to in the description.ext) #start ~_wait _dam=10 * (getDammage _unit) _dam=_dam-(_dam%1) goto (format["%1",_dam]) #0 cutRsc blahblajhblah goto "start" #1 cutRsc blahblajhblah goto "start" #2 cutRsc blahblajhblah goto "start" Add more numbers for all the images to be displayed. RED Share this post Link to post Share on other sites