-
-
December 16, 2018 at 11:15 #2618
NOTA BENE: some commands only work with MED and some only work on the HOST, which means they will either not work at all in COOP or they will not produce a visible effect on the client side!
Questions? Do not post a comment here! Please check if your question has been asked already and if not start a new subject here:
This is the kyle.wac command list extracted from the localres.pff
WAC FILE SYNTAX
WAC debug screens under keypad “/”
debug_hud, keypad arrows to select and scroll
GLOBAL WAC is GAME.WAC (executed first)
MISSION WAC is misname.WAC (executed second)Left to Right order of operations—WAC LANGUAGE COMMANDS
nestable flow control
IF THEN ELSE ELSEIF END
DOSEQ NEXT NEXT END
DORND NEXT NEXT END
boolean logic
AND OR
function modifier
NOTcomments
//Syntax –
if trigger1 params and trigger2 params then
event1 params
event2 params
end
Example I want to open doors in group 12 the first time I enter area 1501
if location 1501 and never then
opendoors 12
end
—VARIABLES & IMMEDIATES (a variable can always be used as an immediate)
“STRING” immediate string value
# immediate decimal number
anim_move immediate equate from ADM file
ammo_name immediate ammo name (ex. ammo2tgt ammo_rocket 1)
fx_fxname immediate effect name (ex. fxrain fx_effect_lightning)
effect_name immediate effect name (ex. fxrain effect_lightning)
SS_SoundSet immediate soundset name
sSoundSet immediate soundset name (alternate syntax)
face_name immediate face name (ex. ssnface 45 face_happy)
face_normal
face_happy
face_sad
face_smirk
face_angry
face_surprise
face_disgust
face_fear
face_aggressive
V# V0 to v511 game variables, cleared at start of mission
G# G0 to vG11 global variables, not cleared during link
M# Music Script Variable
result current return/accumulator value (mostly for debug)
ticks number of seconds into game
GameOver true is game is over
Winvar true if blue team won
Losevar true if red team won
wind used by SWING, FLICKER, and particle wind2
health player’s health/hp value
mana player’s mana
neartype the type of the nearest enemy (from items.def dialog)
neardist the distance to the nearest organic
nearmove the anim move of the nearest organic (setable)
nearid the unique dcb/id of the nearest organic
neartid the id of the organic’s target or 0 if no target
nearblind
nearflying
nearguard
nearSSN
nearWP
nearGroup
nearHPdeadDist the nearest corpse info
DdeadType
ddeadSSN
DdeadMove
DdeadGroupbbadDist the nearest badguy info (team 2)
bbadType
bbadSSN
bbadMove
bbadGroup
—TRIGGERS (# param can be number or variable)
never() true if current IF has never fired, for one time only events
elapse(#) true if past # seconds since current IF activated-IF Link (these commands fire once only for every fire of linked IF)
previous true if previous (same nesting level) IF fired
chain(#) true if previous (same nesting level) IF fired # seconds ago
link(#1,#2) true if IF #1 away from current IF fired #2 seconds ago-Game Time (seconds of WAC script running)
past(#) true if past # seconds into game, keeps firing after #
before(#) true if before # seconds into game. keeps firing before #
ontick(#) true if ontick #, only fires oncerandom(#) randomly true 1 in # times, sets RND for additional tests
location(#) true if you are at that music location
area(#) true if within MED area without checking vertical
area3D(#) true if within MED 3D area
outside() true if you are not in a blink box
waveready() true if no talking going on
groupdead(#) true if entire group is dead
groupalive(#) true if anyone in group is alive
ssnwounded(#) true if ssn is wounded
ssndead(#) true if ssn is dead
ssnalive(#) true if ssn is alive
ssnride(#) true if any organic is standing on SSN
ssnonssn true if SSN is standing on SSN
ssnnearssn true if SSN is near SSN within dist
ssnlosssn true if SSN is near SSN within dist and has LOS
ssnseesssn true if SSN is near SSN within dist and can see it
meride(#) true if player is standing on SSN
meattached(#) true if player is attached to SSN
medrive(#) true if player is driving SSN
meongun(#) true if player is on emplaced weapon on SSN
ssnloc(#,#) true if vehicle or person is in music location
ssnarea(#,#) true if vehicle or person is in 2D med area #
ssnarea3D(#,#) true if vehicle or person is in 3D med area #
dooropen(#) true if group # has door open
event(#) true if med event has triggered
squadevent(#) true if squad event is in que, sets squadSSN to talker
playerfired(#) true if player has pressed fire and has slot # selected
1=knife, 2=small arm, 3=main weapon, ect..—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—EVENTS (# param can be number or variable)
squadclear clears squadevent selected by squadevent(#)
forceanim(anim) forces all organics into anim slot (debug only)
report(“text”) pop-up debug report window
report#(“text”,#) pop-up debug report window with number
text(“text”) output text to chat – right side
text#(“text”,#) output text to chat w/# – right side
consol(“text”) output text to consol – left side
consol#(“text”,#) output text to consol w/# – left sideflash produce a flash of lightning & thunder
farflash produce a far away flash of lightning & thunder
quake(#) earthquake for # 10th of a secondscolorfade(#) seconds for color to transition (zero is normal)
sun(#,#,#) sets sun rgb ENV override
sky(#,#,#) sets sky rgb
ground(#,#,#) sets ground rgb
ceiling(#,#,#) sets ceiling rgb
floor(#,#,#) sets floor rgb (inside ground)
lightning(#,#,#) sets the color of the lightning
cloud(#,#,#) sets the cloud color
gain(#,#,#) sets the brightness of the whole scenefogcolor(#,#,#) set fogcolor to R,G,B, changes at color fade rate
fog(#,#,#) same as fogcolor
skyfogcolor(#,#,#) set skyfogcolor to R,G,B
skyfog(#,#,#) same as skyfogcolor
fogtype(#) set fog type 0=fog, 1=haze, 2=haze wall, 3=fog wall
fogdist(#) sets fogdist to # meters
movefog(#,#) move fogdist to # meters over # seconds
skyspeed(#) sets the sky movement speed
skyheight(#) sets the height of the sky
sound(sSSNAME, dist, head) plays soundset at distance(meters) and heading(bangle)
nearwave(“wave.wav”, dist) plays wave file from the mouth of the nearest enemy with max dist to be heard
nearanim(anim_move) sets the nearest enemy to ADM move slot
SSNwave(ssn, “wave.wav”, dist) plays wave file from the mouth of the ssn with max dist to be heard
wave(“wave.wav”, dist) plays wave file from mouth of player
SSNanim(ssn, anim_move) sets the ssn to ADM move slot
SSNradio(ssn, “wave.wav”) sets the ssn to talk on radio
SSNmax(ssn, maxengage) set max engage distance
SSNmin(ssn, minengage) set min engage distance
SSNatt(ssn, maxattack) set max attack distance
SSNSpawn(ssn, spawn count) set the spawn count, 0=don’t respawn
GroupMax(group, maxengage) set max engage distance
GroupMin(group, minengage) set min engage distance
GroupAtt(group, maxattack) set max attack distance
GroupSpawn(group, spawn count) set the spawn count, 0=don’t respawn
remove(grp) remove group # without a trace
kill(grp) kill group #
removeSSN(ssn) remove SSN # without a trace
killSSN(ssn) kill SSN #
teleport(grp,tgt) teleport group # to target #
telessn(ssn, tgt) teleport SSN # to target #
targetfx(tgt) create med particle fx at target #
sound2tgt(ss,tgt) create ssoundset at target # (ex. sound2tgt sSoundSet 1)
ss2ssn(ss,ssn) create ssoundset at center of ssn
ammo2tgt(ammo,tgt) create ammo # at target # (ex. ammo2tgt ammo_rocket 1)
fx2tgt(fx,tgt) create fx # at target # (ex. fx2tgt effect_lightning 1)
opendoors(group) open doors in group #
closedoors(group) close doors in group #
SSNtoWP(ssn, wp) redirect SSN to WP list
GtoWP(group, wp) redirect Group to WP list
ammorain(ammo) rain down ammo # somewhere near player
ammoarea(ammo, area) rain down ammo # somewhere inside area #
fxrain(fx) rain down effect # somewhere near player
ssncspd(ssn,speed) set ssn to combat speed of #
ssnpspd(ssn,speed) set ssn to patrol speed of #
ssnuse(ssn) snap ssn to emplaced weapon if within 3 meters
ssnrelease(ssn) remove ssn from emplaced weapon
ssn2ssn(ssn, ssn) have ssn goto ssn and try to snap to emplaced
ssnface(ssn, face) set face expression of ssn
ssnguard(ssn, #) set ssn to guard 1=ON, 0=Off
ssnturn(ssn, heading) turn ssn to heading 0-360
ssnhp(ssn, hp) set ssn’s hitpoints to hp
blockfire(wpnkey, #) blockfiring of weapons under key, 0=fire, 1=blockexample select 1 of 3 randomly
dornd
text “1”
next
text “2”
next
text “3”
enddoexample select 1 or 3 sequentialy
doseq
text “1”
next
text “2”
next
text “3”
enddo*********************************************************
if waveready and elapse(12) then // and eq(neartype,1)
consol (“srgt talking”)
nearwave(“taunt1.wav”, 100)
nearanim anim_idle_7 //pace and talk
endif
-
December 16, 2018 at 11:28 #2619
Commands are missing in the list above and also in the following.
Source: OLDMAN on Godfathers Nile Mapmakers > Mapmaking FAQ’s (this forum is no longer available, it was the best mapmaking forum out there and all is lost! or is it?)
Unfortunately I only stored the basic commands, so here’s what I have…
Syntax
————
WAC Flow Control (basic statements)
IF triggers THEN actions ENDIF
IF [ifname] triggers THEN actions ENDIF (optional named if)
IF triggers THEN actions ELSE actions ENDIF
IF triggers THEN actions ELSEIF triggers THEN actions ENDIF
PLOOP actions(player) END
GLOOP group actions(item) END
DOSEQ actions NEXT actions [NEXT actions..] ENDDO
DORND actions NEXT actions [NEXT actions..] ENDDO // work like DOSEQ (not random) !!
IF triggers ENTER actions ENDIF (triggers on first true)
IF triggers LEAVE actions ENDIF (triggers after last true)
The order of operations in WAC scripting is left to right.
Any lines preceded with a semicolon or text after two forward slashes is considered as a comment. Examples: ; this is a comment about this script if Past(60) then //This is the events name
(usually defaults to //New Event The syntax should look something like this: – (parens, line returns and tabbing are all optional)
CODE
if trigger1(params) and trigger2(params) then //Event Name or Comment
event1(params)
event2(params)
endif
Example 1.)
Door triggered by area trigger.
If I want to open doors in group 12 the first time I enter area 1501 then I use
CODE
if location(1501) and never() then
opendoors(12)
endifExample 2.)
Time lapsed rain and random thunder and lightning.
(Originally posted by Sal UK and modified by Kip Kilagan -PR-) Explanation:
After 90 seconds has passed it will begin to rain and go overcast, both reaching full strength 20 seconds later. It also sets variable 1 to 1 with “set (v1,1)”. After another 90 seconds (180 seconds into the round) the rain and overcast will die away to nothing over 20 seconds and the map will brighten up again. Also the variable 1 is now set to 2. Only if variable 1 is set to 1 will the last part of the script activate… causing thunder and lighting randomly once in every 30 times.
CODE
if ontick(90) then
rain(100,20)
overcast(100,20)
set(v1,1)
endifif ontick(180) then
rain(0,20)
overcast(0,20)
set(V1,2)
endifIf eq(v1,1) and random(30) then
farflash
flash
endifExample 3.)
Co-op win/lose condition after killing of a certain AI or objects. Remember many things can trigger a win condition not just the death of an object or AI. // ssndead is a bad choice on vanish objects like bots !
If SSN 10001 is dead and SSN 10002 then Win1 = JO wins otherwise if AI 10003 dies then WIn2 = Rebels win would look like this:
CODE
if ssndead(10001) and ssndead(10002) and never() then
win(1)
else
if ssndead(10003) and never() then
win(2)
endif
endif
————————————— WAC Language Commands
======================
Nestable flow control
IF
THEN,ENTER,LEAVE
ELSE
ENDIF Boolean logic
AND
OR Function modifier
NOT
! Note: At this moment in time NILE doesn’t like it if you use nested events, it would apear that you need to use seperate events for most things to work. You can use the following to randomize between nested action in a conditional IF event.
dornd = do the following nested action randomly (don’t work anymore -> work like doseq)
doseq = do the following nested actions sequentially
next = used between the actions
enddo = used to close the do statement, comes just before the last endif of the event. Example:
CODE
If elapse(120) and random(5) then
doseq
rain(30, 30) // Light Rain
set(v1, 1)
next
rain(100, 30) // Hard Rain
set(v1, 2)
next
rain(60, 30) // Medium Rain
set(v1, 3)
next
rain(0, 30) // No Rain
set(v1, 4)
enddo
endif————————————————————————- VARIABLES & IMMEDIATES
——————————————–
Note:- A variable can always be used as an immediate “STRING” immediate string value
# immediate decimal number
v# v0 to v255 these are game variables you can set or have set, these are cleared at start of each mission
G# G0 to vG11 these are global variables,( these are not cleared during link !! no more)
M# Music Script Variable anim_move immediate equate from ADM file
ammo_name immediate ammo name (ex. ammo2tgt ammo_rocket 1)
fx_fxname immediate effect name (ex. fxrain fx_effect_lightning)
effect_name immediate effect name (ex. fxrain effect_lightning)
result current return/accumulator value (mostly for debug)
SS_SoundSet immediate soundset name
sSoundSet immediate soundset name (alternate syntax)
wind used by SWING, FLICKER, and particle wind2
health player’s health/hp value
mana player’s mana
player payer’s variable
item group variable
rnd random’s variable
ticks number of seconds into game 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
———————-
# == # -> eq(#,#)
# != # -> ne(#,#)
# < # -> lt(#,#)
# > # -> gt(#,#)
#<=# -> le(#,#)
# >= # -> ge(#,#)
# -> true(#)
!# -> false(#) VARIABLE MODIFY
———————————-
Note: The “v” is followed by the number you want as the variable (0 to 256). Ensure variables don’t clash with each other.
Also when incrementing variables remember to set the variable to a value prior to the first increment.
set (v,#) set variable # to # // v = #
add (v,#) add # to variable # // v = v + #
sub (v,#) subtract # from variable #, clamp at 0 // v = v – #
inc (v) add 1 to var // v = v + 1
dec (v) subtract 1 from var, clamp at 0 // v = v – 1
—————————————————
TRIGGERS
———————————-
Note:- # param can be number or variable. chain(#) true if previous IF statement has fired # ammount of seconds ago and previouse is closed and chain(#) isn’t nesting in an closed condition.
dooropen(#) true if group # has door open
elapse(#) true if # seconds have past since last activated / first time it fire immediately !
groupdead(#) true if entire group is dead
groupalive(#) true if anyone in group is alive
location(#) true if you are at that location
meride(#) true if you are riding SSN # (Only works as a trigger for the host of the game)
never() true if event has never fired / fire only once !
outside() true if you are not in a blink box
past(#) true if past # seconds into game / after # sec. its always true
ontick(#) true if exact # seconds into game / fire only once !
previous() true if previous event has fired?
random(#) randomly true if rnd 1 in # times
ssnalive(#) true if ssn is alive
ssndead(#) true if ssn is dead / isn’t true if an object doesn’t exist anymore
ssnloc(#,#) true if vehical or person is in location
ssnnearssn(#,#,#) true if SSN is near SSN within # distance
ssnride(#) true if organic is standing on SSN
tod(#) true if time of day equals # (000 to 2359)
waveready() true if no talking going on / be carefull on dedicated servers !
————————————————————————— EVENTS
———————————-
Note:- # param can be number or variable CO-OP Win/Lose Conditions:
win(#) # is set to 0,1 or 2 these are draw,JO win and Rebels win respectively.
lose(#) gives the opposite result as win Weather/Enviroment Events:
ammorain(ammo) rain down ammo # near player (only host sees/hears the fx, but clients still lose health/die
fxrain(fx) rain down effect # somewhere near player
farflash produce a far away flash of lightning & thunder
flash produce a flash of lightning & thunder
fogdist(#) sets fogdist to # meters (same as set(fog,#)
fogtype(#) set fog type 0=fog, 1=haze, 2=haze wall, 3=fog wall
gain(#,#,#) sets the brightness of the whole scene
overcast(#,#) produce an overcast (strength, time it takes to get to that strength)
quake(#) earthquake for # 10th of a seconds
rain(#,#) produce rain (ammount of rain, time it takes to get to that ammount) (Don’t use FXRAIN)
skyspeed(#) set the sky speed to #
tod(#:#) set the time of day to #:# eg: tod(12:00)
wind (#,#) produce wind sounds ect (strength, time it takes to get to that strength) Text Output Events:
consol(“text”) output text to consol
consol#(“text”,#) output text to consol w/#
text(“text”) output text to chat
text#(“text”,#) output text to chat w/# Various Events:
ammo2tgt(ammo,tgt) create ammo # at target # (ex. ammo2tgt ammo_rocket 1)
closedoors(group) close doors in group #
fx2tgt(fx,tgt) create fx # at target # (ex. fx2tgt effect_lightning 1)
forceanim(anim) forces all organics into anim slot (debug only)
GroupMax(group, maxengage) set max engage distance
GroupMin(group, minengage) set min engage distance
GroupAtt(group, maxattack) set max engage distance
GtoWP(group, wp) redirect Group to WP list
Gkill(grp) kill group #
killSSN(ssn) kill SSN #
opendoors(group) open doors in group #
Gremove(grp) remove group # without a trace
removeSSN(ssn) remove SSN # without a trace
sound(sSSNAME, dist, head) plays soundset at distance(meters) and heading(angle)
sound2tgt(ss,tgt) create ssoundset # at target # (ex. sound2tgt sSoundSet 1)
SSNanim(ssn, anim_move) sets the ssn to ADM move slot
SSNatt(ssn, maxattack) set max engage distance
SSNmax(ssn, maxengage) set max engage distance
SSNmin(ssn, minengage) set min engage distance
SSNspawn(#,#) set SSN # to spawn # ammount of times, 0=do not respawn
SSNtoWP(ssn, wp) redirect SSN to WP list
SSNwave(ssn, “wave.wav”, dist) plays wave file from the mouth of the ssn with max dist to be heard
ssncspd(ssn,speed) set ssn to combat speed of # kph (seems to only work for vehicles not AI themselves)
ssnpspd(ssn,speed) set ssn to patrol speed of # kph (seems to only work for vehicles not AI themselves)
targetfx(tgt) create med particle fx at target #
teleport(grp,tgt) teleport group # to target #
telessn(ssn, tgt) teleport SSN # to target #
tod(#) set time of day to # (00:00 to 23:59)
wave(“wav file”) play wav file
-
December 16, 2018 at 11:54 #2620
Here are some additional commands I cannot really find anywhere except in my head. I think I got these from Oldmans’ contributions to Godfather’s forum as well.
ssnSEESssn ssn,ssn,distance
ssnNEARssn ssn,ssn,distance
ssnleadssn2ssn ssn,ssn,ssn
hidessn ssn
unhidessn ssn
ssnaddhp ssn,X //add X hp to ssn health, negatives are allowed!
ssnaddexp ssn,X //add X Exp points to ssn, negatives are allowed!
pisvar
setvarYou can of course use () if you think that’s useful but you don’t need to if you are not dealing with a collection of triggers!
You know commands that are not listed here? Please leave a comment to share your knowledge with us!
Questions? Do not post a comment here! Please check if your question has been asked already and if not start a new subject here: https://awmod.com/forums/forum/mapping-hangout/mapping-questions/
That’s all.
-
December 1, 2021 at 14:50 #3658
I’m building a map where the opening is to swim up river. I would like to know how to set the breath of player longer to enable them to make it up river without coming up for air part way through the river.
Any ideas would be greatly appreciated.
I’ve tried looking through the wac commands in here and am unable to find the code for this problem.
Many thanks
(OF) Skunk
-
December 6, 2021 at 16:24 #3662
Simply use the Breath Time WAC script
if never() then
breathtime = 70 // (Set 1-100 with 100 being the longest time)
endif
-
This topic has 4 replies, 3 voices, and was last updated 2 years, 9 months ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.
Latest 10 Comments