Home   Help Search Login Register  

Author Topic: Unit is alive/dead command in script?  (Read 1361 times)

0 Members and 1 Guest are viewing this topic.

Offline Mostly

  • Members
  • *
Unit is alive/dead command in script?
« on: 17 Jan 2009, 14:49:50 »
I basically want to add a line to the start of a script which detects if a particular unit is alive. If he is alive the script continues, if he's dead then the script ends.

I can't use a trigger to do this, it must be included in the script.

Any help would be appreciated.
Ta.
They mostly come out at night. Mostly!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Unit is alive/dead command in script?
« Reply #1 on: 17 Jan 2009, 15:10:26 »
Maybe something like:

? !(alive particularunit) : exit


Planck
I know a little about a lot, and a lot about a little.

Offline Mostly

  • Members
  • *
Re: Unit is alive/dead command in script?
« Reply #2 on: 18 Jan 2009, 14:04:58 »
Yep, that works a treat.

Thanks.

Without posting another thread, I've got another quick question. Lights on vehicles, how do I disable them completely? I've searched the forum and have found a few similar posts but a few years old and they claim that it's not possible. Has anyone discovered a way to do it? Maybe by editing something in the vehicle's config file?
« Last Edit: 18 Jan 2009, 14:26:32 by Mostly »
They mostly come out at night. Mostly!

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re: Unit is alive/dead command in script?
« Reply #3 on: 18 Jan 2009, 15:17:14 »
You can certainly switch off an AI vehicles lights but the AI driving it will just switch them back on again.

You can loop the command I suppose, but the effect would probably be something like a strobe.

I believe that if you switch the Ai into 'combat' mode they will keep the lights off:

unitname setbehaviour "combat"


Planck
I know a little about a lot, and a lot about a little.

Offline Mostly

  • Members
  • *
Re: Unit is alive/dead command in script?
« Reply #4 on: 18 Jan 2009, 15:53:54 »
Yeah, switching them to combat mode does work but if I order a man to take up the gunner position without a driver in the vehicle then the lights come on! The lights also come on at certain times, like when the men are getting in or out of the vehicle. Just for realism I want to stop that. It's hardly a good military practice to keep flashing your lights when trying to remain undetected!
Ideally I want to completely disable the lights. I've played around with scripts to keep checking if the lights are on and to turn them off but this creates a little bit of a drag on the system and like you say can have a strobe light effect.
Are vehicle lights buried deep in the actual games coding or can I find them somewhere else eg. config file or a script?
They mostly come out at night. Mostly!

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Unit is alive/dead command in script?
« Reply #5 on: 17 Feb 2009, 22:51:37 »
This is really a question for the addons forum, but you could modify the config of a vehicle to eliminate the lights. You could make a new addon of the vehicle that uses all the original BIS stuff, but only has a different config for your new vehicle. I think you should re-post this question on the addons forum to get better help from people experienced in doing this kind of thing.