OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Robinhansen on 09 Jun 2005, 16:09:31

Title: Name a VehicleCreated object
Post by: Robinhansen on 09 Jun 2005, 16:09:31
I've using at script to VehicleCreate some objects (FDF_Mortars) How can I give the same name every time in order to have other scripts working along them
Title: Re:Name a VehicleCreated object
Post by: bedges on 09 Jun 2005, 18:46:05
when you say the same name, what do you mean exactly?

you can name vehicles created by giving them a variable, like this:

Code: [Select]
tank = "M1Abrams" createVehicle getmarkerpos "tankFactory"
tank can then be referenced by other scripts...
Title: Re:Name a VehicleCreated object
Post by: THobson on 09 Jun 2005, 23:19:37
But I would not use the word tank on its own.  It is a defined term in OFP.

Tank1 Tank2 etc. would be fine.
Title: Re:Name a VehicleCreated object
Post by: Robinhansen on 10 Jun 2005, 13:39:36
This is the name of the mortar:heitin1. I use the script below to vehicleCreate the mortar by an AI.
Somewere in this script the mortar needs to be named heitin1 or else other related scripts won't work... :-\
Title: Re:Name a VehicleCreated object
Post by: hermano on 30 Jun 2005, 15:33:09
Try this:
"Mortar" CreateUnit [_destination,_group,"heitin1 = this",1,"PRIVATE"]
(comref: type createUnit unitInfo)
h
Title: Re:Name a VehicleCreated object
Post by: MachoMan on 30 Jun 2005, 16:26:16
Aah you just want your variable to inference with the standard FDF stuff, right? What you do not understand (I think) is that there are global variables.
heitin1 is probably just a global variable, so if you replace _mot with heitin1 you should be fine.
Title: Re:Name a VehicleCreated object
Post by: hermano on 05 Jul 2005, 12:13:18
Sorry,ignore my post above, bedges already gave the right answer:
heitin1 = _vehicleType createVehicle _location
 ;)
h