Novahq.net Forum

Novahq.net Forum (https://novahq.net/forum/index.php)
-   Delta Force (https://novahq.net/forum/forumdisplay.php?f=101)
-   -   What is mission Varible? (https://novahq.net/forum/showthread.php?t=46020)

M.M. 06-16-2011 03:27 AM

What is mission Varible?
 
I see "Mission Varible" in events of many maps I downloaded, but what is it anyway???:dontknow:

dave61 06-16-2011 03:46 AM

I use mission variables in my maps for communication between .wac and map events.

For example , I can set a mission variable with MED events and then create a .wac event to recognize the variable change.

if eq(v10, 2) and never() then
set(seatbelt, 0)
endif

The above script sees the med variable change and locks the player onto a vehicle seat.


In reverse, you can use the .wac to set a variable for the med to see.

if ssnarea(10000,1) and never then
set(v2,0)
endif

The above .wac script sets the variable, when the MED sees the variable change and creates and MED action.

M.M. 06-16-2011 09:05 AM

Thanks dave61! But what to put? Equal, Greater Than, Greater Than or Equal To, Less Then, Less Then or Equal To???

Luis 06-16-2011 10:15 AM

Look at this:
Code:

Event 2: Player shoot at teammate

Triggers:
Group 1 has shot SSN 1

Actions:
Set Mission Var#1 to 1

In the .wac file i write this:
Code:

//*****************************
// PLAYER SHOOT TEAMMATE SSN 1
//*****************************

if eq(v1,1) and never() then
wave("happy1.wav",254)
endif

If the variable is equal 1 to 1, the .wac file will execute that sound or whatever you put there.

M.M. 06-16-2011 11:38 AM

Thanks Luis! And you too dave61. Thanks both of you!!! :)

SilentTrigger 06-16-2011 11:56 AM

Whats the never() part for? Seen it many times but never got around to ask what it's purpose is as it seems to always be included in a IF statement.

Luis 06-16-2011 12:12 PM

From the 'WAC TUTORIAL BY CHRISLEW200':
Ok this is the easiest one of the lot you have probobaly seen me use it allready in the
previous examples what does the “NEVER” command do.
The if never command normally follows another trigger it is to prevent the same event
happening time and time again and not causing a wave file which is activated by a area
trigger from playing over and over aslong as you are in that trigger.
So quite simply the if never command/trigger makes sure a wac command only happens
once.

SilentTrigger 06-16-2011 02:12 PM

Thanks for the info Luis! :)

dave61 06-16-2011 02:39 PM

Quote:

Originally Posted by M.M. (Post 373110)
Thanks dave61! But what to put? Equal, Greater Than, Greater Than or Equal To, Less Then, Less Then or Equal To???

These actions commands can be used with mission variables:

;---VARIABLE COMPARE
;eq(#,#) true if #==#
;ne(#,#) true if #!=#
;lt(#,#) true if #<#
;gt(#,#) true if #>#
;le(#,#) true if #<=#
;ge(#,#) true if #>=#
;true(#) true if #!=0
;false(#) true if #==0
;
;---VARIABLE MODIFY
;set(var,#) set var to #
;add(var,#) add # to var
;sub(var,#) subtract # from var, clamp at 0
;inc(var) add 1 to var
;dec(var) subtract 1 from var, clamp at 0

However , the ones' most commonly used are the eq(v#,#) equals and the set(v#,#) set variable commands.

M.M. 06-16-2011 02:52 PM

thx again dave61...

dave61 06-16-2011 03:28 PM

No problem, glad I could help !

Btw, here's my little experiment with variables.

Try this out in your .wac :

if never then
set(v100,59) ; cd s
endif

if elapse(1) then
dec(v100)
endif

if elapse(2) then
consol#("Seconds left",v100)
consol("<CO30>Countdown to") // YELLOW TEXT COLOR CHANGE
consol("<CO30>player death") // YELLOW TEXT COLOR CHANGE
endif

if eq(v90,0) and eq(v100,0) and never then
text("Countdown finished")
text("<CF500000>YOU'RE DEAD !") // RED TEXT COLOR CHANGE
endif

if chain(2) and never then
killssn(10000)
lose
endif

Hope ya like this ! :bigthumb:

M.M. 06-17-2011 07:27 AM

lol... Fun, good work!-Very good work...

Guest001 06-17-2011 11:42 PM

Quote:

QUOTE=dave61;373124 No problem, glad I could help !
G'day Dave.
Do any particular variables have a preset value?
IE: I have heard not to use v260
I am using v2,0 to v2,2 to trigger random actions in conjuction with "2nd time"
even or odd numbered time playing

dave61 06-18-2011 09:25 AM

Quote:

Originally Posted by stompem (Post 373148)
G'day Dave.
Do any particular variables have a preset value?
IE: I have heard not to use v260
I am using v2,0 to v2,2 to trigger random actions in conjuction with "2nd time"
even or odd numbered time playing

I don't think there's a preset value.

I never had to use any variables above v10 since the variables' value range is 0-10000.

The only variables I've ever had problems with was in the 0 to 1.5 range.

MERMITE 06-20-2011 02:04 AM

Quote:

Originally Posted by M.M. (Post 373104)
I see "Mission Varible" in events of many maps I downloaded, but what is it anyway???:dontknow:

Are a total waste of time, as a mapper and a very good one at that you will learn time, the meaning of Random, and it's affect in the game..in time in your life too!
these Variables are but switches, thats all.. end of story, as you can see they are not used that often, thats why you see them here, jokers trying to IMPRESS each other with boring code ....blah blah...dave!!
I have used them with great success for laying out an early morning Artillary barrage, complete with .ptl effect, smoke, noise, etc etc, but to be honest, they could have been done just as well with a 2-3 second chain .cmmd

"M":laugh:

dave61 06-20-2011 03:18 PM

Quote:

Originally Posted by MERMITE (Post 373168)
Are a total waste of time, as a mapper and a very good one at that you will learn time, the meaning of Random, and it's affect in the game..in time in your life too!
these Variables are but switches, thats all.. end of story, as you can see they are not used that often, thats why you see them here, jokers trying to IMPRESS each other with boring code ....blah blah...dave!!
I have used them with great success for laying out an early morning Artillary barrage, complete with .ptl effect, smoke, noise, etc etc, but to be honest, they could have been done just as well with a 2-3 second chain .cmmd

"M":laugh:

Try using an event to execute a .wac trigger. This "JOKER" would prefer to use a variable than to chase a ever-changing MED event.

Get a clue, Mermite.

Just when I think you've softened alittle you show your a$$.

Who's trying to impress who ?

You're beyond boring.

dave61 06-20-2011 03:28 PM

Quote:

Originally Posted by MERMITE (Post 373168)
as a mapper and a very good one at that
"M":laugh:

I'm still lmao at that one !

As I remember, you're still all BLOW and no show, LOL @ you !

Guest001 06-20-2011 10:45 PM

I have achieved true random causality in my new map!
Using variables "M"

Guest001 06-20-2011 10:49 PM

Game companies all use variables through necessity. It would be hopeless without them due to the complexity of the programming needed these days.

Guest001 06-20-2011 10:53 PM

Quote:

I have used them with great success for laying out an early morning Artillary barrage, complete with .ptl effect, smoke, noise, etc etc, but to be honest, they could have been done just as well with a 2-3 second chain .cmmd
What does this all mean? Where is it? What is it. Does it have any use?
Stomp


All times are GMT -5. The time now is 02:58 PM.

Powered by vBulletin®