Jump to content
Sign in to follow this  
Harkonin

Flames and functions

Recommended Posts

Well not alot to say here, I can script a flame up down and sideways with anywehre from 1 to 10 variables but I can't figure out how to get them working with functions.

Basically trying to convert this here -

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

_posDrop = _this select 0

_velocity = _this select 1

_lifeTime = _this select 2

_intensity = _this select 3

_object = _this select 4

[_posDrop, [0,0,0], _lifeTime, _intensity, _object] exec "fx\Fire\Fire.sqs"

this even close?

private["_posDrop","_velocity","_lifeTime","_intensity&

quot;,"_object"]

_posdrop = _this select 0;

_velocity = random 1;

_lifetime = 90;

_intensity = 5;

_object = _this;

(_this) addEventHandler ["Killed", {[(getpos _this), [.5,1,.5], 90, 6, "" ] exec "fx\Fire\Fire.sqs"}];

Share this post


Link to post
Share on other sites

Not even close actually biggrin_o.gif

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

private["_posdrop","_velocity","_lifetime","_intensity","_object"];

_posDrop = _this select 0;

_velocity = _this select 1;

_lifeTime = _this select 2;

_intensity = _this select 3;

_object = _this select 4;

_object addeventhandler ["killed",{[_posDrop, [0,0,0], _lifeTime, _intensity, _object] exec "fx\Fire\Fire.sqs"}];

If you want to pass in less parameters and hard code them in, do so but remember that the array you pass in changes and so do the _this select n indices

EDIT: You know there is no magic in getting this going, you just have to know what data you pass into your function (try player sidechat format ["%1",_this];) and then work with it as you please. You should be able to follow through how each parameter is used in your function, then you can start eliminating parameters you want hard coded.

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  

×