IPB


Welcome Guest ( Log In | Register )

 Forum Rules ArmedAssault.info Forum Rules
 
Reply to this topicStart new topic
> A little scripting help with an eventhandler
Eddie
post Feb 21 2010, 00:42
Post #1


Senior Member
Group Icon

Group: Addon Maker
Posts: 201
Joined: 9-October 07
Member No.: 1,420



Im trying to add a little flame to my mirage's engines. I have the hidden selection working propperly.

What i am trying to get right now is the engine eventhandler.

im trying to use:

engine = [_this select 0] setobjecttexture [4,"PRACS_Mirage3\tex\flame.paa"]


the effect this is supposed to have is while the engine is on the flame appears then when the engine turs off it disapears.

can anyone tell me what im doing wrong? i suck at scripting. or does anyone have a better idea to achieve this.


--------------------
wld427 on BI forums

 
Quote Post
D@V£
post Feb 21 2010, 08:30
Post #2


Gee, I wish we had one of them doomsday machines.
Group Icon

Group: Moderators
Posts: 2,037
Joined: 13-November 06
From: Wales
Member No.: 155



Could you tell us what isn't working about it? I don't see why you'd need the "engine =" bit at the start though... oh... right... sorry... I haven't finished my coffee yet tongue.gif

I take it your config looks something like this:
CODE
        class eventhandlers
        {
        engine = [_this select 0] setobjecttexture [4,"PRACS_Mirage3\tex\flame.paa"]
        };


Try turning the code to get the engine working into a script, so it'll look something like this:
CODE
        class eventhandlers
        {
        init = "_this exec ""\PRACS_Mirage3\flame.sqs"""
        };


Then have this as your sqs:
CODE
_plane = _this select 0
[_plane,true] addEventHandler ["Engine", [_this select 0] setobjecttexture [4,"PRACS_Mirage3\tex\flame.paa"]
[_plane,false] addEventHandler ["Engine", [_this select 0] setobjecttexture [4,"PRACS_Mirage3\tex\Noflame.paa"]


I think that's the right syntax for that event handler, but I don't really have time to test it right now unsure.gif


--------------------
The Rules - Nothing too complicated, follow these and we'll have no problems.
Moderation Feedback Thread - Tell everyone how much you hate me love me secretly fear that Mark is watching you while you sleep. secretly wish that Mark is watching you while you sleep.
Site Issues Thread - Complain about site issues here. We might even fix them!
Community Chatter Thread - Furthest Mud-sling gets a free subscription to "JdB Monthly".

QUOTE(Major Mike Shearer)
We can categorically state that we have not released man-eating badgers into the area.
QUOTE(Brace Belden)
A machine gun is like a woman, I don’t understand it, I’m afraid of it, and one day I’ll accidentally be killed by one.
 
Quote Post

Reply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 16th April 2024 - 10:07