OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Killzone on 07 Jul 2003, 18:22:18

Title: Showing the names of the dead
Post by: Killzone on 07 Jul 2003, 18:22:18
Hi.

Is there a way to have the names of the ones that died show up on the screen using text. For example if I tell my men to go over to a certain area
and I then hear gun fire. Everytime my men shoot someone it will tell me on the screen like: "Sergei is dead" I dont know if I explained this right but if you can help it would be appreciated ;D
Title: Re:Showing the names of the dead
Post by: gadolinite on 07 Jul 2003, 19:05:49
hi

 ;)this is not hard at all.

set up a script, and execute it with a this condition trigger, activate by west, since you said, "when you enter an area"

#a
~.001
?alive <soldiername>) : goto "a"
titletext ["Sergei is dead", "PLAIN DOWN"]

set up tests like this for every soldier
Title: Re:Showing the names of the dead
Post by: _hammy_ on 07 Jul 2003, 19:32:54
accually it should be:

Code: [Select]
#check
~0.1
!alive <soldiername>:goto "a"
goto "check"

#a
hint "Dude1 is dead" ;or u can use a titletext thing

exit

or you can do teh same thing inside a trigger instead of a script, just change condition to !alive <soldiername>
and on activation to hint "Dude is dead" or the titletext thing
Title: Re:Showing the names of the dead
Post by: LCD on 07 Jul 2003, 20:42:25
we (da EC  8)) gonna realese kool script dat wil do it (we got som misions w/ dis script already ;)) - so ur friends say over da radio "ohh no unitname is down" ;D

just wait til our webmaster (asmodeus) updates da site (or just go nd ask him in IM ;D)

LCD OUT
Title: Re:Showing the names of the dead
Post by: Killzone on 07 Jul 2003, 22:27:07
Hey this works great but now I have a new question if you don't mind?

how can I get the text to dissapear after 1 or 2 seconds or have it show more than one dead at the same time.

My problem is when a soldier dies the hint comes up and says: Sergei is dead but as long as that is on the screen it does not report any other deaths even though some died

Thanks in advance ;D
Title: Re:Showing the names of the dead
Post by: Igor Drukov on 07 Jul 2003, 23:11:07
Or you could have a loop like this :

Code: [Select]
_group=_this select 0
_i=0
#loop
_num=(count units _group)
?!(alive (units _group select _i)):hint format ["Oh no ! %1 is dead", name (units _group select _i)];[units _group select _i] join grpnull
_i=_i+1
?_num==0:exit
? _i>= _num :_i=0
~0.001
goto "loop"

Implementation : [_mygroup] exec "casualties.sqs", in a trigger with "true" in the condition field, for instance...

*edit*

Instead of "hint", you could use :

Code: [Select]
leader _group sidechat format ["Oh no ! %1 is dead", name (units _group select _i)]