Jump to content
Sign in to follow this  
jeppelykke

Why dont this trigger set _var work?

Recommended Posts

Hey Hey (:

I trying to work with thise so called: variables my question why dont this work:

I have a trigger to activate on my person, it do work as i also set it to play music to hear it activate, now in my triggers activation field i enter: jlhstatus=1

and i have following script runing:

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

#start

? (jlhstatus==1) : goto "West"

goto "end"

#West

titleText ["It works Damm \n Am Good", "PLAIN"]

goto "end"

#end

goto "start"

For some strange reason this is not working, any know how i can get a trigger to set "global" var i think its called, from what i search in forums but not found any exsamples that use this!

Share this post


Link to post
Share on other sites

Looks ok, but remember you have to initialize the

variable jlhstatus as numeric variable by an init.sqs or

let's say by a trigger right from the start.

jlhstatus = 0

btw - you should add a small delay in your script to avoid

a game hanger

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

~0.1

? (jlhstatus==1) : goto "West"

goto "end"

#West

titleText ["It works Damm \n Am Good", "PLAIN"]

goto "end"

#end

goto "start"

~S~ CD

Share this post


Link to post
Share on other sites

ok diden know about this init.sqs thingy but thanx mate!

Well better add a delay then biggrin_o.gif

Thanx

Best Regards

Jeppe Lykke, Denmark

Share this post


Link to post
Share on other sites

Hey Hey all,

How do one delete a var again so i can use the same name exsample of my script:

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

#tank3

deleteVehicle tank3

tank3 = nil

~5

tank3 = "M1Abrams" createVehicle getmarkerpos "tank3"

Reason i have tank3 = nil is that in the "comref" it says that would:

Description:

Nil value. This value can be used to undefine existing variable.

Example:

variableToDestroy = nil

But when i try to create the same tank it says that the name/var is still in use, anyone have and idea how i can fix that. AND Yes that tank has to be same name! ;)

Share this post


Link to post
Share on other sites
Quote[/b] ]Chris, what is a "game hanger"??

lol Doolittle you're right, this Austrian phrase doesn't make

really sense in English biggrin_o.gif

What i tried to say was that the game could freeze by

that kind of nonstop script without a delay.

~S~ CD

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  

×