Jump to content
Sign in to follow this  
Demolition man

Delete something and spawn something

Recommended Posts

I have made a enemy defence and I want it to delete itself when all enemy guarding it are killed.

Then I want it to spawn a friendly defence but I do not know how so could someone help me please.

Share this post


Link to post
Share on other sites

you should be able to make this work using the createvechicle and deletevechicle commands. Your best bet for defining positions are game logics and you should try to put all the commands in two scripts (one for to delete the stuff the other one for creating it), at the moment im not gonna do a step by step explanation but il give you some links which should be able to help you.

http://www.ofpec.com/COMREF/index.php?action=details&id=86&game=All

http://www.ofpec.com/COMREF/index.php?action=details&id=102&game=All

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

http://community.bistudio.com/wiki/ArmA:_Objects

http://community.bistudio.com/wiki/ArmA:_CfgVehicles

The last two are lists of object and unit names, you iwll need the object names to create your defence.

Share this post


Link to post
Share on other sites

This does not make no sense to me but I would really appreciate if you could give me a example mission. Sorry if I am asking too much.

Share this post


Link to post
Share on other sites

What is the spawn line for objects.

Example. (The spawn line for tanks is _tank = "Vulcan" createVehicle (getMarkerPos "Tank."); ).

Share this post


Link to post
Share on other sites

It does not work.

---------- Post added at 10:06 PM ---------- Previous post was at 08:52 PM ----------

deleteVehicle Vehicle1; deleteVehicle Vehicle2; deleteVehicle Static; deleteVehicle Wire1; deleteVehicle Wire2; deleteVehicle Wire3; deleteVehicle Wire4; deleteVehicle Sandbag; deleteVehicle Block1; deleteVehicle Block2; _tank = "Camp" createVehicle (getMarkerPos "Spawn a camp."); _jeep = "Landrover_Police" createVehicle (getMarkerPos "Spawn a police car.");

I have made a police car spawn when all enemy are dead but it is locked.

Can anyone tell me how to unlock it.

Share this post


Link to post
Share on other sites

Veh1 lock false

Will unlock a car, veh1 being your vehicle. ArmA has a tendancy of having a small delay with spawned objects, of which you may have to wait 10-20 seconds before you can get in.

If you want AI to be made you need to use createUnit as createVehicle will only spawn brain dead AI. They won't move.

Share this post


Link to post
Share on other sites

How do I add a action button to a truck saying "Deploy base." and then make it

spawn a tent, ammo box and a flag. (I know how to spawn stuff but not from a truck).

Share this post


Link to post
Share on other sites

the action menu entry you can do by adding this to the init line of the truck.

this addaction ["Deploy Base", "script_to_spawn_base.sqf"]

you can also spawn things with (position truck) instead of the getmarkerpositition you seem to be using, the truck would then be an object or unit with the name "truck". Now the problem is that if you spawn everything on the position of the truck every object will spawn onto each other, and im not sure how to fix that.

Share this post


Link to post
Share on other sites

Sorry, posted an answer, but I didn't see there was another page of replies. Cheers

Edited by Raptor 6 Actual
Typo

Share this post


Link to post
Share on other sites

to spawn units in buildings just put "this setPos ((nearestBuilding this) buildingPos 1)" with this being replaced by the name you gave that unit in the script.

http://community.bistudio.com/wiki/buildingPos

you might also want to check out mr-murrays editing guide, because you would find alot of answers to your questions in that guide.

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  

×