Home   Help Search Login Register  

Author Topic: Scripts for repsawned vehicles.  (Read 1769 times)

0 Members and 2 Guests are viewing this topic.

Anubis-LOC

  • Guest
Scripts for repsawned vehicles.
« 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?   ???

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re:Scripts for repsawned vehicles.
« Reply #1 on: 30 Oct 2002, 21:04:11 »
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

PRiME

  • Guest
Re:Scripts for repsawned vehicles.
« Reply #2 on: 14 Mar 2003, 02:39:37 »
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..

Tactician

  • Guest
Re:Scripts for repsawned vehicles.
« Reply #3 on: 14 Mar 2003, 04:24:20 »
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.

PRiME

  • Guest
Re:Scripts for repsawned vehicles.
« Reply #4 on: 14 Mar 2003, 08:15:02 »
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.

Nasty Buttler

  • Guest
Re:Scripts for repsawned vehicles.
« Reply #5 on: 16 Mar 2003, 03:08:47 »
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

5hole

  • Guest
Re:Scripts for repsawned vehicles.
« Reply #6 on: 03 May 2003, 20:08:58 »
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