Home   Help Search Login Register  

Author Topic: Spawnable campfires and tents?  (Read 1586 times)

0 Members and 1 Guest are viewing this topic.

Offline izaktj

  • Members
  • *
Spawnable campfires and tents?
« 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?
« Last Edit: 15 Aug 2010, 06:02:18 by izaktj »

Offline eegore

  • Members
  • *
Re: Spawnable campfires and tents?
« Reply #1 on: 16 Aug 2010, 15:46:28 »

  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.

Offline haroon1992

  • Members
  • *
  • My life is hopeless...
Re: Spawnable campfires and tents?
« Reply #2 on: 16 Aug 2010, 17:34:41 »
use createVehicle to spawn any desired things.

My example :

player addaction ["Set up campfire","setUpCampFire.sqf"]

setUpCampFire.sqf
Code: [Select]
//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
Very busy with life, business, and other stuff. Away from OFP for months. Not sure if I could get back onto it. :(