Home   Help Search Login Register  

Author Topic: Checking if unit in list has been injured?  (Read 5706 times)

0 Members and 1 Guest are viewing this topic.

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Checking if unit in list has been injured?
« on: 06 Sep 2002, 23:10:31 »
LATEST QUESTION AT BOTTOM OF PAGE  ;)

after looking through a mission by BIS - they make editor music play by using (in scripts):

playmusic "res7"

or summit like that

now - i wanna do the same but make a voice sound...

the reason being is i have an atmospheric script that basically (well in the end) will check any1 who gets injured on side west and then makes that guy who gets injured say one of the MEDIC!!!! or HELP!!! etc.

now - i need to place that in a script and make a guy say it - so i have to know how to acces these voices using a snytax...

oh - and on the same subject - how can i make a trigger check for any1 on west side who is injured - and then on activation it will make that person exec a script - could be any1 in the list (another trigger that makes a list of all west)

cheers :thumbsup:
« Last Edit: 07 Sep 2002, 10:59:29 by Messiah »
Proud Member of the Volunteer Commando Battalion

Kaliyuga

  • Guest
Re:editor voices
« Reply #1 on: 06 Sep 2002, 23:34:21 »
Well if you want to play a sound through the playmusic command, why not either record, or find a suitable .wav file of the sound you want (probably could find something from a movie on-line I'd bet ;) ) convert to .ogg and play it like you would a song

I'm not at home at the moment otherwise I'd post what the description.ext would look like.. but I'm guessing you know how to do that already anyways... ;D

Not sure bout the other thing, but something along the lines of a countside in conjunction with a getdammage would be my best guess

:cheers: :toocool:
« Last Edit: 06 Sep 2002, 23:35:11 by Kaliyuga »

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:editor voices
« Reply #2 on: 06 Sep 2002, 23:40:45 »
no, no, no

i wanna use the ones already in the editor - and play them using a similiar method to that - im sure it must be possible.
Proud Member of the Volunteer Commando Battalion

Gameer_77

  • Guest
Re:editor voices
« Reply #3 on: 07 Sep 2002, 00:06:38 »
The editor sounds like the russian ones are:

player say "rus1"
player say "rus2"
....
player say "eng1"
player say "eng2"


And so on...

 8)PEACE

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:editor voices
« Reply #4 on: 07 Sep 2002, 01:02:48 »
so are the eng1 are west?

i need to select the medic ones - but this is cool - its possible.

 ;)
Proud Member of the Volunteer Commando Battalion

Gameer_77

  • Guest
Re:editor voices
« Reply #5 on: 07 Sep 2002, 01:11:51 »
Yes, the english ones are west. Go into the effects menu in the trigger and count down the list in the voices bit to find the sound you want.

 8)PEACE

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:editor voices
« Reply #6 on: 07 Sep 2002, 01:26:21 »
h0000t...

gamer, u are a freakin legend again my man :thumbsup:

now, the last thing (gurus please)

i have this script now, and basically (with the help of good old gamer) it creates a random thing for the guy to say.

now...

LATEST QUESTION HERE :thumbsup:

how do i make a trigger check a list of side west for ANYONE who gets injured and then in the onactivation take that guy and make him exec a script, along with another array variable?

thats all i need.... and its all done (i hope)

cheers.

(jeeeze Gamer - fancy teaming up on this one? youve done most the work so far  ;) )
« Last Edit: 07 Sep 2002, 11:01:22 by Messiah »
Proud Member of the Volunteer Commando Battalion

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:editor voices
« Reply #7 on: 07 Sep 2002, 04:38:37 »
You can also grab the voice name from the mission.sqm, if
you search for sensors and scroll down to that trigger.

You could run one-timer scripts for each soldier, waiting for
him to become injured.

~S~ CD
« Last Edit: 07 Sep 2002, 04:42:18 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:editor voices
« Reply #8 on: 07 Sep 2002, 10:38:24 »
hmmm i could, but for all of the 100 or so soldiers?

i know there must be a way to do this - does any1 know?
Proud Member of the Volunteer Commando Battalion

Gameer_77

  • Guest
Re:Checking if unit in list has been injured?
« Reply #9 on: 07 Sep 2002, 11:46:46 »
Hmm...Tricky one. Try making another script and in it:

Code: [Select]
_unitarray= [sold1,sold2,sold3,sold4,sold5]

_tmp=1
#loop1
? (getdammage (_unitarray select _tmp)) > 0:[(_unitarray select _tmp)] exec "somescript.sqs"
_tmp = _tmp + 1
?_tmp>5:_tmp=0
~0.05
goto "loop1"

What you do is you add the name of each soldier into the array (Sorry, but you have to name them. Although you could pass everyone to a script with thislist....  ::)). So you put each soldier's name into the script. Then in this line:

?_tmp>5:_tmp=0

Make sure you change the five to the amoount of people in the script.

Now, i predict problems, so just ask...

Quote
jeeeze Gamer - fancy teaming up on this one? youve done most the work so far  ;)

Em...Joke or not? Not?  :-\

Cheers

Gameer

 8)PEACE

Bremmer

  • Guest
Re:Checking if unit in list has been injured?
« Reply #10 on: 07 Sep 2002, 12:58:17 »
That script looks like a good start Gameer, but once injured the unit will execute the script on every loop.

A slight modification to remove the unit from the array, and change the value that controls the looping would sort that out:


_unitarray= [sold1,sold2,sold3,sold4,sold5]

#start
_tmp=0
_count = count _unitarray
#loop1
_unit = _unitarray select _tmp
? getdammage _unit > 0:[_unit] exec "somescript.sqs"; _unitarray = _unitarray - _unit; goto "start"
_tmp = _tmp + 1
?_tmp > _count : _tmp=0
~0.05
goto "loop1"


Should work OK.

 :)

Gameer_77

  • Guest
Re:Checking if unit in list has been injured?
« Reply #11 on: 07 Sep 2002, 13:19:12 »
Good point Bremmer. My Excuse: I was "tired"   ;D

But, a slight modification:

Code: [Select]
_unitarray= [sold1,sold2,sold3,sold4,sold5]

#start1
_tmp=0
_count = count _unitarray
#loop1
_unit = _unitarray select _tmp
? getdammage _unit > 0:[_unit] exec "somescript.sqs";_unitarray = unitarray - unit;goto "start1"
_tmp = _tmp + 1
?_tmp > _count : _tmp=0
~0.05
goto "loop1"

Before it was doing the whole "unknown operator" thing with the "_unitarray = _unitarray - _unit" bit.  :)

 8)PEACE

Bremmer

  • Guest
Re:Checking if unit in list has been injured?
« Reply #12 on: 07 Sep 2002, 13:28:35 »
Opps sorry!

My bad  :-[

_unit needs to be in array format before you can remove it from the array

ie. _unitarray = _unitarray - [_unit]

I was also thinking that its possible to get around the problem without removing the unit from that array. This means the unit will execute the script each time he is hurt (after being healed). I havent tried this yet, so it may be buggy:


_unitarray= [sold1,sold2,sold3,sold4,sold5]
_hurt = []
_count = count _unitarray

#start
_tmp=0

#loop1
_unit = _unitarray select _tmp
? _unit in _hurt : goto "check"
? getdammage _unit > 0:[_unit] exec "somescript.sqs"; _hurt = _hurt + [_unit]

#cycle
_tmp = _tmp + 1
?_tmp > _count : _tmp=0
~0.05
goto "loop1"

#check
? getdammage _unit == 0: _hurt = _hurt - [_unit]
goto "cycle"


[edit]Just tested it out - everything seems OK  :)[/edit]
« Last Edit: 07 Sep 2002, 13:59:35 by Bremmer »

Gameer_77

  • Guest
Re:Checking if unit in list has been injured?
« Reply #13 on: 07 Sep 2002, 14:08:16 »
Nice idea, Bremmer!  :)

Now, where is Messiah  ::)

 8)PEACE


Offline Messiah

  • Honourary OFPEC Patron & Drinking Buddy of Wolfsbane
  • Honoured Contributor
  • ***
  • OFPEC Veteran
    • Project UK Forces
Re:Checking if unit in list has been injured?
« Reply #14 on: 07 Sep 2002, 16:54:47 »
here.... scared... ummm... those scripts mean nuthing to me...

how do i execute them? remember its for the whole of side west under a list trigger.... so.... ummm... yeah, im cofused  :-\

Proud Member of the Volunteer Commando Battalion