Home
Intel Depot
Editors Depot
Missions Depot
Addons Depot
Forum
Home
Help
Search
Login
Register
OFPEC Forum
»
Editors Depot - Mission Editing and Scripting
»
OFP - Editing/Scripting General
(Moderators:
h-
,
savedbygrace
,
Gruntage
) »
!alive problem
« previous
next »
Send this topic
Print
Pages: [
1
]
Go Down
Author
Topic: !alive problem (Read 1280 times)
0 Members and 1 Guest are viewing this topic.
Zombie
Members
Beware the night, the zombie walks among you
!alive problem
«
on:
12 Nov 2003, 01:09:41 »
I have a script that detects when a certain unit(not a player) is not alive which works just fine. The unit is respawned after 10 seconds, but the detection script still detects it as being not alive. HBow can I get the script to recognize the unit has been respawned and is alive again?
example:
?!(alive bb2):goto "next"
This works just fine the first time, so I'm guessing the respawned unit isn't named bb2 anymore?
Logged
Terox
Former Staff
Follow the Sappers!
Re:!alive problem
«
Reply #1 on:
12 Nov 2003, 17:21:28 »
when you respawn ai, you actually create a brand new ai, so basically what you have to do is attach a variable name to the newly created ai, this would be done in the ai creation script that you have used
= BB2
Logged
Zeus ARMA2 server IP = 77.74.193.124 :2302
Teamspeak IP = 77.74.193.123
Zombie
Members
Beware the night, the zombie walks among you
Re:!alive problem
«
Reply #2 on:
12 Nov 2003, 17:36:37 »
Ok, I tried this by adding the _vcl = bb1 line, but it still doesn't work properly. Am I missing something obvious? This is an excerpt from the script that is run by the unit named bb1
@!(alive _vcl)
~_respawndelay
deleteVehicle _vcl
_vcl = _type createVehicle _position
_vcl setdir _dir
_vcl setdammage .73
_vcl = bb1
Logged
Zombie
Members
Beware the night, the zombie walks among you
Re:!alive problem
«
Reply #3 on:
12 Nov 2003, 19:04:11 »
OK, I was able to solve my problem by changing the detection of BB1 not alive to !bb. I manipulate bb like this:
#start
?(getdammage _vcl)<.75:goto "start"
_shell = "heat125" camcreate (getpos _vcl)
_shell = "heat125" camcreate (getpos _vcl)
_shell = "heat125" camcreate (getpos _vcl)
_shell = "heat125" camcreate (getpos _vcl)
~2
bb = false
@!(alive _vcl)
~_respawndelay
deleteVehicle _vcl
_vcl = _type createVehicle _position
_vcl setdir _dir
_vcl setdammage .73
bb = true
Logged
Zombie
Members
Beware the night, the zombie walks among you
Re:!alive problem
«
Reply #4 on:
13 Nov 2003, 17:59:46 »
I see what you mean, but I still want a slight delay between the destruction of the vehicle and the respawning of a new one. _respawndelay is set to 10 for this script. Thanks for your help, I learned a few things hammering this out.
Logged
Send this topic
Print
Pages: [
1
]
Go Up
« previous
next »
OFPEC Forum
»
Editors Depot - Mission Editing and Scripting
»
OFP - Editing/Scripting General
(Moderators:
h-
,
savedbygrace
,
Gruntage
) »
!alive problem
Top of page