OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Anubis-LOC on 30 Oct 2002, 07:54:27
-
I am trying to figure out how to get a vehicle that has respawned to activate a script. more specifically the Turbo and Nitrous from the snippet section. Can anyone tell me how to get em to do that? ???
-
How are you respawning the vehicles?
Try making a trigger that runs Repeatedly and activates with
not alive VEHICLENAME
Have nothing for OnActivation
Have
[VEHICLENAME] exec "myscript"
or however it's done for the OnDeactivation...it will deactivate in this case when the vehicle is "alive" again.
Can't you just run the KITT script on vehicle Initialization (I haven't seen KITT)?
Doolittle
-
I am trying to figure out howto do this.. Doolittle most people use Createvehicle so no you can't do it like what your saying "Least Effectivly"
Basicly I tried a few hundred different ways and still no go..
Be good if someone had SOME input..
-
If the vehicle is initialized as a variable (i.e. vehName = this in init field instead of vehName in "name" field) and the vehicle respawn script uses that variable name, you can publicVariable the variable name upon respawn to propagate the change to all clients.
Preserving vehicle names after respawn is tricky, because createVehicle can only be called on the server or problems arise.
The reason for not using the classic "name" for the vehicle is that a named vehicle can't be publicVariabled (it will return an error about the variable being reserved).
To propagate the names of helicopters after respawn in one of my missions, I created an array of code strings and passed the number of the proper array element to vrespawn. The code array looks kind of like this:
codeArray = [{veh1 = _newVeh; publicVariable "veh1"},{veh2 = _newVeh; publicVariable "veh2"}]
and would be called like this:
call (codeArray select _index)
from the script.
Let me know if you need more help.
-
Yeah unfortunately im a bit lost there some some more help would be great. perhaps a example mission or something..
I am currently trying to get the Nitro script to run on all new vehicles but the action menu option for it does not show apon respawning of the new vehicle.
-
if u need help assigning variable names to createvehicle'd units message me, i got a 100% working vehicle respawn with variables now....i can be contacted on ICQ or private message
-
Couldn't you just apply the nitro script from within the respawn script?
If the respawn is actually a createVehicle, it should have a name, right?
_newVehicle = _type createVehicle _pos
or something like that. So just put this in the next line:
[_newVehicle] exec "nitro.sqs"
or however the script is called, and you should be good to go.
-5hole