Home   Help Search Login Register  

Author Topic: Naming a Spawned Vehicle  (Read 1102 times)

0 Members and 1 Guest are viewing this topic.

Offline GoldGazelle

  • Members
  • *
  • Knowledge can be taught. Wisdom can not.
Naming a Spawned Vehicle
« on: 05 May 2010, 20:57:16 »
I'd like to say sorry ahead of time to anyone who rolls there eyes after reading this. I am a newbie.

I have a mission where a Bradley APC spawns out side of a town and drives to the town to extract the player back to base. I want the player to have the option of getting into the Bradley or proceeding on foot back to base. What I mean by option is that I don't want to use a Load waypoint for the Bradley and a Get In waypoint for the player.

I would like to use "unitname in vehiclename" in the condition field of the Bradley's waypoint at the town which brings us to my problem. How do I name a spawned vehicle that doesn't exist until a script is executed.

Thank you to anyone who can help,

GoldGazelle

PS  -I am using the "Createunit tutorial by CrashnBurn" for this mission (only using ai_assign.sqs, ai_control.sqs, and tank3.sqs files in my mission folder)

Offline bedges

  • Administrator
  • *****
    • OFPEC The Editing Center
Re: Naming a Spawned Vehicle
« Reply #1 on: 05 May 2010, 21:32:24 »
From the COMREF:

Quote
"soldierWB" createUnit [getMarkerPos "marker_1", groupAlpha,"loon1 = this ; this addweapon {binocular}", 0.6, "corporal"]

Offline RKurtzDmitriyev

  • Former Staff
  • ****
Re: Naming a Spawned Vehicle
« Reply #2 on: 05 May 2010, 23:05:15 »
Or, if you're using the createVehicle command, do this

Code: [Select]
newapc = "Bradley" createvehicle someposition

where newapc is the name of your new unit and someposition is the name of the spawning position. The createVehicle command seems to return the name of the created unit, which is why the code above works.
The OFP Editing Center wishes to remind you that the faithful COMREF will never threaten to stab you and, in fact, cannot speak.
However, in the event that it does speak, you are encouraged to heed its advice. ;)

Offline GoldGazelle

  • Members
  • *
  • Knowledge can be taught. Wisdom can not.
Re: Naming a Spawned Vehicle
« Reply #3 on: 06 May 2010, 05:38:13 »
Thank you very much,

Everything works the way I wanted it to now. Much appreciation for your help with this.

GoldGazelle