Home   Help Search Login Register  

Author Topic: random sound on death  (Read 2092 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:random sound on death
« Reply #15 on: 06 Sep 2005, 23:18:38 »
This still would not solve the problem of the dead unit not being able to say the sound (one hit could kill them outright).

I suggest you look at doing this instead.  

Change the line:

_unit say _soundname


to:

_soundobj = "logic" createvehicle [0,0,0]
_soundobj setPos getPos _unit
_soundobj say _soundname

then at the end of your script put:

~5
deleteVehicle _soundobj


This will create a thing called a game logic - these can do many things, saying a sound is one of them.

Then you move the game logic to the location of the unit and it says the sound.  Then at the end you delete the game logic.  The delay is so the sound has been completely said before the GL is deleted.

Sorry I didn't spot the dead units can't talk problem earlier.
 
« Last Edit: 06 Sep 2005, 23:44:25 by THobson »