Jump to content
Sign in to follow this  
Vanklinken

Creating Vehicles Via Debug console in both Warfare & Singleplayer

Recommended Posts

Hi, beeing quite new to scripting i can only handle basic things.

So far i've been able to add weapons to my character via the debug console found here :http://www.armaholic.com/page.php?id=5773

basically what i do is,for example : player addweapon "ado_famasf1"

i did the same with magazines and it works too. Now, what i'm trying to do is add an empty vehicle via the console, so far i haven't had any luck.

i've tried many commands:

createunit: http://community.bistudio.com/wiki/createUnit

createvehicle: http://community.bistudio.com/wiki/createVehicle

createvehicle local: http://community.bistudio.com/wiki/createVehicleLocal

following some of the instructions given i typed this in the console

_tank = "M1Abrams" createVehicleLocal [position player]

nothing worked. i've been surfing the forum for answers for about a month but to no avail.

any suggestions? By the way try to keep it simple, as i said earlier i have no experiance in those things

Share this post


Link to post
Share on other sites

"vehicle_classname" createVehicle position player;

That works all the time for me.

Share this post


Link to post
Share on other sites

I also do not think you can use local variables (ones that start with an underscore (_) in the debug console. All variables have to be global. So nul instead of _nul.

Share this post


Link to post
Share on other sites

Thanks for the answers, i tried both, but neither worked.

I tried the 1st example given at http://community.bistudio.com/wiki/createVehicle_array

like this :veh = createVehicle ["ah1w", position player, [], 0, "FLY"]

but nothing happened, then i tried "

Code:

"vehicle_classname" createVehicle position player;

that gave this : "M1Abrams" createVehicle position player;

nothing happened there either, did i do something wrong?

Share this post


Link to post
Share on other sites

Thanks mate, it seems to have worked, all of a sudden i was "pushed" by something and when i looked behind, the tank was there:rolleyes:

as for module-added vehicles, how do i know if the're "tank=" "car=" etc...?

Share this post


Link to post
Share on other sites

for instance i wanna add this vehicle : the amx 10 rc fom HEXA mod, Class : "HEXA_10RC"

What do i need to add before it?

tank= that would give: tank="HEXA_10RC"

or something else, for instance =car or = truck?

Share this post


Link to post
Share on other sites

What you add before it? You can add anything before it!

It doesn't have to be:-

tank = "M1A1" createvehicle (getpos player);

It could just as easily be:-

boat = "M1A1" createvehicle (getpos player);

It would still create it.

The "tank" or "boat" part is only the variable name you are assigning to the object created. It can be anything... but must be unique in all the code in the mission.

So to make the tank go somewhere if you happened to call it boat:-

boat domove (getpos player) ...would make the tank move to the player!

Edited by twirly
Calrity

Share this post


Link to post
Share on other sites

Great, thanks for the swift answers!

By the way, is there a way to find the vehicle classnames in an addon?

i started searching in the PBO files with an editor but i've had no luck so far.

is there a certain keyword to find or something?

Share this post


Link to post
Share on other sites

They will most likely be in the config.cpp/.bin.

An alternative way is to place the units in the editor then open up the mission.sqm to get the classname.

Since you're using the debug console you could just simply get in the vehicle and enter this in the debug console:

typeOf vehicle player

That will return it's classname.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×