OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: izaktj on 14 Aug 2010, 06:19:25
-
Is it possible to add to the user actions the ability to "spawn" a campfire?
I assume having a script with something like createunit, but it seems that only works for soldier units not static or empty objects.
The idea is to have an option on the action menu that would say "create campfire" and when selected a campfire is spawned at the player position. Maybe play the healing animation too.
Help?
-
I'm at work and can't test this first but I think you could name the fires camp1, camp2 etc. and drop them in the corner of the map then use domove getpos player command combined with the ideal player animation. Addaction it, or have it on a repeated radio trigger.
I don't know if you want an infinite number of fires or pre-determine that you have 5 or so camp kits etc. If you want infinite amounts then you would need to createunit I believe. I've never done that though.
-
use createVehicle (http://community.bistudio.com/wiki/createVehicle) to spawn any desired things.
My example :
player addaction ["Set up campfire","setUpCampFire.sqf"]
setUpCampFire.sqf
//how many meters should the fire get spawned in front of player?
_front=3;
_fireCamp = "Fire" createVehicle [0,0,0];
//ignite fire (set FALSE to spawn un-lit fire)
_fireCamp inflame TRUE
_fireCamp setPos [(getpos player select 0)+_front*sin(getDir player),(getpos player select 1)+_front*cos(getDir player),0];
Procedure :
add action to player
copy above code and put into setUpCampFire.sqf
and put that .sqf in your mission.
the same method goes to tents........
Regards
Haroon1992