OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: bigdave003 on 06 Mar 2005, 22:46:44
-
is it possible to use the camcreate command to fire a flare or drop smoke for an extraction? i used search and found one thread, but i couldnt find it or in the forum or read the whole thing, is there a way i missed that i can do that?
cheers, Dave.
-
Yes it is possible. ;)
flare = "DiscoFlare" camcreate (getpos GL)
Of course GL would have to be in the air for the flare to be lit. And it'd have to be dark out. You could use that in a trigger or script...
Also look here:
http://www.ofpec.com/editors/browse.php?browseon=&browsewhat=-1&catselected=-1_-1&catagory=-1&subcategory=-1_-1&numreturn=25&displayformat=0&ofpv=1&searchwhat=1&searchlevel=0&searchwhat=1&searchopts=&searchstring=flare (http://www.ofpec.com/editors/browse.php?browseon=&browsewhat=-1&catselected=-1_-1&catagory=-1&subcategory=-1_-1&numreturn=25&displayformat=0&ofpv=1&searchwhat=1&searchlevel=0&searchwhat=1&searchopts=&searchstring=flare)
And smoke can be camcreated on the ground using "SmokeShell".
Smoke:
http://www.ofpec.com/editors/browse.php?browseon=&browsewhat=-1&catselected=-1_-1&catagory=-1&subcategory=-1_-1&numreturn=25&displayformat=0&ofpv=1&searchwhat=1&searchlevel=0&searchwhat=1&searchopts=&searchstring=smoke&x=18&y=16 (http://www.ofpec.com/editors/browse.php?browseon=&browsewhat=-1&catselected=-1_-1&catagory=-1&subcategory=-1_-1&numreturn=25&displayformat=0&ofpv=1&searchwhat=1&searchlevel=0&searchwhat=1&searchopts=&searchstring=smoke&x=18&y=16)
Cheers
-
flare = "DiscoFlare" camcreate (getpos GL)
So this is the line i could shove in a script?
-
In structure yes, but not in detail. That was a generic line rather than one you can copy and paste.
flare is the name of the object you are creating. I'd recommend flare1 or something to avoid conflicts
discoflare is the type of flare you want. Check the weapons and ammo listing .,..... you won't find discoflare, sadly.
GL is the name of the gamelogic which is at the place where you want the flare to appear.
I recommend you spend some time with the comref (the online version has helpful Comments) until you are familiar with all of the commands used. Trying to copy and paste from the forum without understanding what youare doing is almost certain to end in tears.
Create a test missionette and experiment.
-
I would've replied but explorer had one of those "unexplained" errors and had to shut down. Then Microsoft says nothing can fix it...yea sure... ::)
And to add to what macguba said, flares are usually better as scripts. Makes it all nice and tidy and you can set everything up right.
-
cheers all :cheers:
shame about the lack of a discoflare, was looking forward to that one ::). Thats probably one for the addon ideas board :afro:
-
Try the attached script. It creates a barrage of three flares 120m up, 200m from your position in the direction you are facing. You can edit it to your heart's content to get it down to one flare, no custom ounds etc.
I use this as an addaction but you could trigger it via an event handler. Put the following in the player's Init field -
this addEventHandler ["fired", "this exec {callArtilleryFlare200.sqs}"]
Now while you're editing the script to make it to your liking (see above) simply add a line to check the type of weapon fired. If it's a rifle grenade (or whatever weapon you've chosen to be your flare gun) then run the script, otherwise exit.
Note that this won't be perfect as you could point your weapon at the ground and still create the flare 120m up, but it's a fair approximation until someone works out how to get the payer's angle of elevation from the game. :P
Cheers
roni