Jump to content
Sign in to follow this  
tzvetoslav

How can I make smoke screens with a trigger?

Recommended Posts

Hello.I'm making a mission and I want to do this.We go into a village and the opfor starts moving to our position and when they're in the right area a smoke screen apears activated from a trigger.I've seen that in some missions but how can I do it?Any help will be much apreceated smile_o.gif Thanks.

Share this post


Link to post
Share on other sites

Sounds like you need to create an invisible object, say an invisible helipad or, more usefully, an invisible viewblock object. Than use it as a particle source object.

Share this post


Link to post
Share on other sites
How would one do that in laymen terms please?

Easiest way imo is to do this:

1. Put invisible H'es in a line and name them (H1, H2 etc)

2. Put a trigger and add this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Smoke="SmokeShell" createVehicle [(getPos H1 select 0),(getPos H1 select 1), 2]

Notice that i already typed in H1. Remember to add as many of these lines in the trigger as you have H'es. wink_o.gif

You can also change the color of the smokes by typing SmokeShellGreen, SmokeShellRed instead of SmokeShell.

Share this post


Link to post
Share on other sites

Only I forgot,how can I connect it to the trigger,because I need the smoke to be activated in a specified time.Thanks.

Share this post


Link to post
Share on other sites
Only I forgot,how can I connect it to the trigger,because I need the smoke to be activated in a specified time.Thanks.

1. Put invisible H'es in a line and name them (H1, H2 etc)

2. Put a trigger and add this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Smoke="SmokeShell" createVehicle [(getPos H1 select 0),(getPos H1 select 1), 2]

In the triggers condition field type: bluforinarea

3. Make a 2nd trigger which gets activated by blufor and type in the On Activation field: bluforinarea=true

Share this post


Link to post
Share on other sites

it's probably a better idea to use game logics instead of H's

Share this post


Link to post
Share on other sites

Sorry i would of posted earlyer but i was PRed an extra 2 days due to a mistake.

so here it is..

Quote[/b] ]

; **********************************************************************

; **** Creates a smoke shell connected to a trigger.

; ****

; **** 2 parameters needed:

; **** 1. Trigger smoke is attached to. (Object)

; **** 2. Color of smoke. ("WHITE", "RED", "GREEN") (String)

; ****

; **** Example how to use:

; **** TRIGGER:

; **** Radius: 50

; **** Activation: WEST + PRESENT

; **** On Activation: [this, "GREEN"] Exec "Smoke.sqs"

; ****

; **** By CHenderMan@cableone.net

; **********************************************************************

; Get the parameters given

_trigger = _this Select 0

_color = _this Select 1

; Get the position of the trigger

_pos = GetPos _trigger

; Create the smoke shell

?(_color == "WHITE"): _color = ""

_type = "SmokeShell" + _color

_smoke = _type createVehicle _pos

Exit

Share this post


Link to post
Share on other sites

Is it possible to add like one smoke what just smokes all the time.

Basically i dont need trigger to launch it, i just want smoke that is on all the time.

if i do trigger doesent it just put them on and on and on and on... so there would come piles of smoke nades?

one smoke nade smoking forever at same location

Share this post


Link to post
Share on other sites
one smoke nade smoking forever at same location

You could probably do this by making the script loop and delaying the next step by making it sleep until the last grenade is almost done smoking (you would have to time it to see how long a grenade will smoke).

Share this post


Link to post
Share on other sites

do you have example script? as no problem for me to take the time, but me and scripting doesent go in same bracket.

Just if you have it allready or have time

Thanks

Share this post


Link to post
Share on other sites

I don't, but let me see what I can come up with tonight or tomorrow.

EDIT:

Ok, here's a simple implementation.

1) create a game logic and name it smoke. In the logic's init line place the following code:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nul = [] execVM "smokeloop.sqf";

2) Put the following script in your mission folder:

smokeloop.sqf

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">if (!isServer) exitwith{}; // Exit if not the server.

//Begin Infinite Smoke Loop.

while {true} do

{

_smoke = "SmokeShell" createVehicle (getPos smoke); // Create a white smoke grenade at the position of the game logic named smoke.

sleep 40; // Wait 40 seconds then create a new smoke grenade (each grenade smokes for approx 45 secs).

};

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  

×