Page 1 of 7 12345 ... LastLast
Results 1 to 10 of 64

Thread: create vehicle with name

  1. #1
    Gunnery Sergeant
    Join Date
    Apr 3 2002
    Location
    Brighouse, West Yorkshire. (UK)
    Posts
    576

    create vehicle with name

    How do I create a vehicle with a name so that I can use other scripts with it after it has spawned. I can create the vehicle using a trigger ie: [getmarkerpos "air1", 0, "BMP3", east] call BIS_fnc_spawnVehicle;
    I just dont know how to add the name? Thanks

  2. #2
    Master Gunnery Sergeant Hellfire257's Avatar
    Join Date
    Feb 17 2009
    Location
    (getPosATL player)
    Posts
    1,207
    Give it a handle.

    _myunit = [getmarkerpos "air1", 0, "BMP3", east] call BIS_fnc_spawnVehicle;

    That will only be local to the script though.

  3. #3

  4. #4
    Gunnery Sergeant
    Join Date
    Apr 3 2002
    Location
    Brighouse, West Yorkshire. (UK)
    Posts
    576
    Author of the Thread
    thanks guys you have both been very helpful and I managed to spawn it with name, now I have to work out how to spawn it with crew?

  5. #5
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    Quote Originally Posted by LockJaw-65- View Post
    now I have to work out how to spawn it with crew?
    use BIS_fnc_spawnVehicle to spawn vehicle with full crew.
    note that you need function module placed on map.
    My scripts:
    Spoiler:

    what to do when posting any kind of code dammit!!

    Any new mission editor or scripter in Arma2 should have read Mr Murrays Editing Guide Deluxe at least once, it still applies for A2 even though it was made for Armed Assault.

  6. #6
    Gunnery Sergeant
    Join Date
    Apr 3 2002
    Location
    Brighouse, West Yorkshire. (UK)
    Posts
    576
    Author of the Thread
    Thanks for quick reply, will try that now

  7. #7
    Gunnery Sergeant
    Join Date
    Apr 3 2002
    Location
    Brighouse, West Yorkshire. (UK)
    Posts
    576
    Author of the Thread
    Just been trying with bis function, I can get it to create vehicles etc but Im back to same problem with naming the spawned vehicle. I just cant get it to have a name id?

  8. #8
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    Array - 0: created vehicle (Object), 1: all crew (Array of Objects), 2: vehicle's group (Group)
    so creating a vehicle:
    Code:
    _createdVehicle = [getPos mySpawnPos, 180, "BMP3", EAST] call bis_fnc_spawnvehicle;
    _theVehicleItSelf = _createdVehicle select 0;
    _theGroupOfTheCrew = _createdVehicle select 2;
    you can now simply ignore giving it a name if you manage all its actions within a script or use setVehicleVarName to name it for outside use.

  9. #9
    Gunnery Sergeant
    Join Date
    Apr 3 2002
    Location
    Brighouse, West Yorkshire. (UK)
    Posts
    576
    Author of the Thread
    @ Demonized thanks for your help but im really not sure how you use or implement that or setVehicleVarName to it. It creates empty vehicles?

  10. #10
    Warrant Officer Demonized's Avatar
    Join Date
    Nov 16 2010
    Location
    Back from afk 2013
    Posts
    2,614
    you need to have at least one unit present on the map of the side you are trying to spawn from.
    you can place one unit in editor, then set probability precense slider to 0 (lower right of unit window in editor), unit will not be in mission but the spawns will work.

    this is the same as using the scripting command
    Code:
    createCenter side;
    also in your script have this at the top to make sure function module is ready:
    Code:
    waitUntil { !isNil "BIS_fnc_init" };

Page 1 of 7 12345 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •