Home   Help Search Login Register  

Author Topic: Creating Vehicles....WITH* a name????  (Read 505 times)

0 Members and 1 Guest are viewing this topic.

Kilo11

  • Guest
Creating Vehicles....WITH* a name????
« on: 14 Aug 2003, 22:15:32 »
Hello, is there anyway to create a vehicle using the "create vehicle" command?? I ned to have an M1A1 Abrams created from a trigger, with the *NAME* of Tank1.  Is there any way to do this? So far I got:

_tank = "M1Abrams" createVehicle getmarkerpos "Marker_1"

But I can't call the new M1A1, I can't set its behaviour, or dammage, and I can't delete the vehicle, which I need to do :-(  Any answers?  Thanks for the help!

-=Hoot=-

peter

  • Guest
Re:Creating Vehicles....WITH* a name????
« Reply #1 on: 14 Aug 2003, 22:19:28 »
as far as i know itÂ's empty ...
(and iÂ've never seen an empty vehicle behave in any way ...  ;))

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Creating Vehicles....WITH* a name????
« Reply #2 on: 14 Aug 2003, 22:32:48 »
I think it is empty.   And you shouldn't name them with a name starting with _.    I don't know if it's really a problem, but _ is used to denote a local variable within scripts and there doesn't seem any point in setting up a possible conflict.   Call it tank1 instead of _tank.

Learn the commands createUnit (which is what you wanthere I suspect) and camCreate too ... the three create commands are subtely different and it's worth undetstanding the differences.   I think there are some helpful comments in the online version of the Command reference in the Ed Depot.
Plenty of reviewed ArmA missions for you to play

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Creating Vehicles....WITH* a name????
« Reply #3 on: 14 Aug 2003, 22:37:09 »
You say you want to create it 'with the name of Tank1', but yet you create it with a local name of _tank

change the _tank to Tank1 if that's what you want.

Created vehicles are indeed empty  :o ::) :D

What you'd need to do is use createunit to create the crew.

for example:

Code: [Select]
?(local server): etank2 = "bmp" createVehicle getmarkerpos "vernon2"
~1
   ?(local server): "SoldierECrew" createunit [getmarkerpos "vernon2", vernon2tankgrp1, "et4 = this"]

   ?(local server): "SoldierECrew" createunit [getmarkerpos "vernon2", vernon2tankgrp1, "et5 = this"]

   ?(local server): "SoldierECrew" createunit [getmarkerpos "vernon2", vernon2tankgrp1, "et6 = this"]

et4 moveincommander etank2
et5 moveingunner etank2
et6 moveindriver etank2

That creates an empty bmp and 3 members of crew in it. Creating crew is slightly more complicated than creating empty tanks but can be learned. There are tutorials about it in the editors depot.
Or if you want to do it the easy way you can always place 3 crew members in editor and then just   moveincommander  (ect.) them to the tank in the same trigger you're using to create the tank in the first place  8)
Not all is lost.

Offline Burn

  • Members
  • *
Re:Creating Vehicles....WITH* a name????
« Reply #4 on: 16 Aug 2003, 14:40:38 »
Code: [Select]
?(local server): etank2 = "bmp" createVehicle getmarkerpos "vernon2"
~1
   ?(local server): "SoldierECrew" createunit [getmarkerpos "vernon2", vernon2tankgrp1, "et4 = this"]

   ?(local server): "SoldierECrew" createunit [getmarkerpos "vernon2", vernon2tankgrp1, "et5 = this"]

   ?(local server): "SoldierECrew" createunit [getmarkerpos "vernon2", vernon2tankgrp1, "et6 = this"]

et4 moveincommander etank2
et5 moveingunner etank2
et6 moveindriver etank2

I have a question... do you need that "?(local server):" in the script, isn't that for multiplayer or, is it only my imagination... but if it is needed in the script... why?
thanks in advance... :beat: :tomato: :wave:

Offline Artak

  • The old beanbag shaker
  • Former Staff
  • ****
  • You want to talk about it, yes?
    • OFP Team Finlanders
Re:Creating Vehicles....WITH* a name????
« Reply #5 on: 16 Aug 2003, 14:45:39 »
yeppers, it's for mp. not needed in sp.
Not all is lost.

Offline Burn

  • Members
  • *
Re:Creating Vehicles....WITH* a name????
« Reply #6 on: 16 Aug 2003, 19:05:25 »
All I wanted to know ;D...
thanks. :-* :thumbsup: :toocool: