Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Delta Force (https://novahq.net/forum/forumdisplay.php?f=101)
-   -   Using elseif (https://novahq.net/forum/showthread.php?t=44375)

Navigator 10-30-2009 09:50 AM

Using elseif
 
Does anyone have a working WAC example of using "elseif" ?

Navigator 10-30-2009 02:35 PM

I have this, but the ELSE constantly prints to screen ???

if
event(1) and event(4) and never() then
Text("In Area 1 and switch 9 destroyed")
elseif
event(1) and event(5) and never() then
Text("In Area 1 and switch 10 destroyed")
elseif
event(1) and event(6) and never() then
Text("In Area 1 and switch 11 destroyed")
else
Text("What are you waiting for")
endif

Navigator 10-30-2009 02:56 PM

What I'm looking for is a either or type of script. A decision made.

MERMITE 10-30-2009 05:01 PM

You speak Chinese too??? lol One of the hardest to understand of Boolan is the GRAMMER. Look hard you will see YOUR PROBLEMS
(you might combine 2 events to one, but too ardous)

There is NO advantage to you using this trigger on that action, like loading your weapon back to front.....lol

if trigger then
action
else
if trigger then
action
endif
endif

that does exactly the same as.

if trigger then
action
endif
if trigger then
action
endif

dave61 10-30-2009 06:13 PM

Quote:

Originally Posted by gorlosky (Post 356212)
I have this, but the ELSE constantly prints to screen ???

if
event(1) and event(4) and never() then
Text("In Area 1 and switch 9 destroyed")
elseif
event(1) and event(5) and never() then
Text("In Area 1 and switch 10 destroyed")
elseif
event(1) and event(6) and never() then
Text("In Area 1 and switch 11 destroyed")
else
Text("What are you waiting for")
endif

gorlosky,

Really confused on this ..... but here is my answer:

if event(1) and event(4) and never() then
Text("In Area 1 and switch 9 destroyed")
elseif event(1) and event(5) and never() then
Text("In Area 1 and switch 10 destroyed")
elseif event(1) and event(6) and never() then
Text("In Area 1 and switch 11 destroyed")
else and never() then
Text("What are you waiting for")
endif

I believe all you were missing on the ELSE command was the "and never() then" loop stopper.

I hope this helps !

Dave

Navigator 10-31-2009 12:45 PM

I used a combination of both those suggestions to make it work as I needed a multiple choice, but not a mutlipe answer. Thanks.

One last peice:

How do you delay an action as part of an IF, but not separately ??? has to be in the same IF statement.

if 'some action' then
Text("x")
wave("wave.wav")
*** delay for 3 seconds ***
killssn(10000)
endif

MERMITE 10-31-2009 01:05 PM

if trigger and never() then
text("000000")
wave("000000.wav")
endif

if chain(3) then ;//*** delay for 3 seconds ***
killssn(10000)
endif

go have a look at dave61's site click his sig

"M"

Navigator 10-31-2009 02:24 PM

Can't have it as a secondary follow-up, because of other multiple choices within the primary IF.

It needs to be in the IF itself.

How do you delay an action as part of an IF, but not separately ??? has to be in the same IF statement. (NOT chained)

if 'some action' then
Text("x")
wave("wave.wav")
*** delay for 3 seconds ***
killssn(10000)
endif


All times are GMT -5. The time now is 09:35 PM.

Powered by vBulletin®