|
Delta Force Anything to do with the Delta Force series of games, DF1, DF2, LW, TFD, BHD, DFX, AF etc. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
Wac limits? :( (DFX/JO)
So i am experiencing sys error crashing the game and it seems to be linked to the WAC. Im not aware of any WAC limits, but this has me baffled.
What ive gathered so far, the problem seems to stem from the looping wac scripts and med events. My map requires many looping wac scripts (does not contain "never ()") to test the trigger conditions repeatedly throughout the game. my theory is that theres a limit to how many triggers and actions can be tested on a loop at once. Heres some map specs and what i know so far... Singleplayer WAC size 37kb 1600+ WAC lines 160+ med events 700 decorations Less than 30 AI The problem: 1) If i add one more trigger or action to any looping WAC script (does not contain "never ()") then it will cause a sys error during map load. 2) It does not matter what type of trigger or action. 3) it does not crash if the action or trigger is added to a non looping script (containing "never ()"). 4) adding new triggers or actions to looping med events causes the same error. 5) game crashes right before the map is completely loaded. Has anyone heard of such an issue? Any ideas? Last edited by Oscarmike247; 05-16-2018 at 09:26 AM. |
#2
|
||
|
WAC meltdown is usually caused by invalid objects in the map, incorrect values for variables, wac statements with incorrect wording (syntax).
Also as you can imagine one action can cancel out another action, this is especially so when looping commands are still running and other actions are called at the same instance. |
#3
|
||
|
If you're not doing so already, try using variables to switch, I rely heavily on them to build huge wac files, in this example the wac is well over 1000 lines.
Code:
;Operation Twilight // ***VARS*** if never() then set(v8,0) // control set(v9,0) // Friendly Zodiac Crews (SET BELOW) set(v10,0) // Friendly Infils set(v11,0) // Friendly Zodiac (SET BELOW) set(v15,0) // Final Bombardment set(v16,0) // Final Bombardment set(v17,0) // Weather1 set(v18,0) // Enemy Mass Attack (SET BELOW) set(v20,0) // HUD - Unit Assists (SET BELOW) set(v21,0) // HUD - Casualties (SET BELOW) set(v27,0) // Weather2 set(v28,0) // Bombing set(v30,0) // Control set(v34,0) // Enemy group 34 set(v35,0) // Enemy group 35 (SET BELOW) set(v36,0) // Enemy group 36 set(v37,0) // Enemy group 37 set(v37,0) // infil Enemy group 39 set(v40,0) // Control infil effects set(v41,0) // Control infil flags set(v50,0) // HUD - Team Rating / clamp at 0 if <= 1 (SET BELOW) set(v51,0) // Tgts 5 set(v52,0) // Tgts 12, 13, 14, 15, 16 (SET BELOW) set(v61,0) // Control set(v70,0) // ka52 (SET BELOW) set(v71,0) // BTR (SET BELOW) set(v80,0) // Group Casualties / respawning set(v81,0) // Group Casualties / respawning set(v82,0) // Group Casualties / respawning set(v83,0) // Group Casualties / respawning set(v84,0) // Group Casualties / respawning set(v85,0) // Group Casualties / respawning set(v90,0) // Group Casualties / respawning endif // ***INIT*** if past(1) and never() then fx2tgt (Effect_FxFire2mF,3) ssnhp(61,200) // first enemy hidessn(98) // flag A hidessn(99) // flag B hidessn(100) // flag C hidessn(101) // flag D hidessn(102) // flag E hidessn(103) // flag F hidessn(104) // flag G hidessn(2) // Group39 Start hidessn(3) hidessn(4) hidessn(37) hidessn(38) // Group39 End hidessn(49) // Group40 Zodiac Enemy Infil Start hidessn(50) hidessn(51) hidessn(52) hidessn(53) hidessn(54) hidessn(55) hidessn(56) hidessn(57) hidessn(58) // Group40 Zodiac Enemy Infil End endif |
#4
|
||
|
Here is a small section triggering events using the vars.
Note that actions for v18 are set in the MEd event editor. Code:
// ***MassAttack*** if past(200) and eq(v9,6) and never() then set(v18,1) endif // ***ShootersInTheHills*** // if area(27) and lt(v50,0) and not eq(v34,2) or eq(v34,3) and never() then set(v34,1) endif if previous() and waveready() and never() then wave("ALPH554.wav") text("Shooters In The Hills!") endif // if area(27) and eq(v50,0) and not eq(v34,1) or eq(v34,3) and never() then set(v34,2) endif if previous() and waveready() and never() then wave("ALPH554.wav") text("Shooters In The Hills!") endif // if area(27) and gt(v50,0) and not eq(v34,1) or eq(v34,2) and never() then set(v34,3) endif if previous() and waveready() and never() then wave("ALPH554.wav") text("Shooters In The Hills!") endif |
#5
|
||
|
Now we get to always on events
Code:
// ***RANDOM*** if past(1) and elapse(12) and random(2) then set(v27,0) // weather on set(v28,1) // bombing off endif if past(14) and elapse(12) and random(2) then set(v27,1) // weather off set(v28,0) // bombing on endif if eq(v27,1) then if elapse(120) and random(2) then rain(40,20) overcast(40,20) set(v17,1) end if chain(60) and random(2) then rain(0,20) overcast(0,20) set(v17,0) end endif if eq(v28,1) then if elapse(6) and random(16) and waveready() then wave("xpLgF4.wav") quake(14) end if chain(0) then lightning(50,5,5) flash() end endif if eq(v17,1) then if past(1) and elapse(4) and random(30) then lightning(100,30,30) flash() end endif // ***CHOOSE*** if area(15) and never() then if lt(v50,0) then set(v64,1) elseif eq(v50,0) then set(v64,2) elseif gt(v50,0) then set(v64,3) end end end endif // var 64 2 area 16 if area(16) and never() then if lt(v50,0) then set(v64,4) elseif eq(v50,0) then set(v64,5) elseif gt(v50,0) then set(v64,6) end end end endif // var 64 3 area 17 if area(17) and never() then if lt(v50,0) then set(v64,7) elseif eq(v50,0) then set(v64,8) elseif gt(v50,0) then set(v64,9) end end end endif // ***REACTIONS*** if ssnalive(96) then if ssnarea(96,18) or ssnnearssn(96,121,30) then ssncspd(96,4) ssnpspd(96,4) else ssncspd(96,36) ssnpspd(96,36) end end endif // EZodiac ssn27 if ssnalive(27) and eq(v18,1) then if ssnarea(27,14) then ssncspd(27,26) ssnpspd(27,16) else ssncspd(27,46) ssnpspd(27,36) end end endif // Ferryboat ssn33 if ssnalive(33) and eq(v18,1) then if ssnarea(33,25) or ssnarea(33,26) or ssnnearssn(33,29,30) then ssncspd(33,4) ssnpspd(33,4) else ssncspd(33,36) ssnpspd(33,36) end end endif // Eboat2 ssn29 if ssnalive(29) and eq(v18,1) then if ssnarea(29,14) then ssncspd(29,22) ssnpspd(29,12) else ssncspd(29,46) ssnpspd(29,36) end end endif // ***DIVERSION*** ;sniper under dock if ssnalive(72) and ssnwounded(72) then SSNtoWP(72,15,0) endif ;first enemy if ssnalive(61) and ssnwounded(61) then SSNtoWP(61,20,0) endif |
#6
|
|||
|
Quote:
Initially, i was thinking the same. There must be a conflict in some of the loops or something. I looked through everything and i don't see where a conflict could have occurred, but the map is very complex using several scripts, events, and variables. So it is hard to tell If this was the case though, then why would the error occur no matter where I put a command, or what kind of command it is for that matter? It will only happen if you added something to a looping trigger. Even if you added one more simple looping script like... If past(1) then Text ("test") Endif ... the error would occur. I have removed a few looping scripts that were necessary and it has fixed the issue for now. But i feel that it will return once i add more stuff to the WAC. Last edited by Oscarmike247; 05-17-2018 at 08:40 PM. |
#7
|
||
|
So, once again i have run into the error. (I knew it would happen again once i added a certain number of looping scripts)
Im trying to get to the bottom of this. I experimented and pasted my wac into a new blank map and it caused the same error. And again if i remove a looping script (doesnt matter which one) it will fix it. This suggests that there is nothing in my maps events or objects causing the error. Its all in the WAC. |
#8
|
|||
|
Quote:
|
#9
|
|||
|
Quote:
I added a new looped script with not action... If eq(v60, 1) then Endif ... the game runs fine. But as soon as you add an action, even something as simple as text ("testing") it will crash. But if you remove 1 action from another looped script it will work again. |
#10
|
|||
|
Quote:
Also leaving out never() is not really looping in the strictest sense of the word, instructions in the same stream may be executing in the same instance, shorten your script and leave as many vars switched off until needed, use else, chain, link etc to exclude or reduce incidences of them queuing too long or firing whilst other variables are operating. |
#11
|
|||
|
Quote:
If past(1) then Text ("test") Endif try the following script with a delay of 7 seconds between the text display. Code:
if past(1) and elapse(7) then text("test") endif Trigger the values 1 to 3 from elsewhere in the wac or med. Code:
if not eq(v60,0) then if eq(v60,1) and never() then text("Test1") set(v60,0) else if eq(v60,2) and never() then text("Test2") set(v60,0) else if eq(v60,3) and never() then text("Test3") set(v60,0) end end end endif Code:
if not eq(v60,0) then if eq(v60,1) and never() then text("Test1") set(v60,0) end else if eq(v60,2) and never() then text("Test2") set(v60,0) end else if eq(v60,3) and never() then text("Test3") set(v60,0) end endif Last edited by Guest001; 05-20-2018 at 03:03 PM. |
#12
|
||
|
Maybe even this may work?
Code:
if not eq(v60,0) then if eq(v60,1) and never() then text("Test1") set(v60,0) end if eq(v60,2) and never() then text("Test2") set(v60,0) end if eq(v60,3) and never() then text("Test3") set(v60,0) end endif |
#13
|
|||
|
Quote:
Here are some examples of scripts from my maps WAC... Code:
;===v Player kills counter v=== ;Pre mission med event sets v16 to 1. if piskills(v16) then inc(V16) inc(V17) endif ;===^ Player kills counter ^=== ;Weather script if Eq(v14, 1) and elapse(V59) and random(9) then dornd Flash() gain(60,80,230) next FarFlash() gain(10,25,100) next SS2SSN(Thunder, 10000) enddo endif ;Battle difficulty levels if eq(v14, 1) and lt(v17, 5) then //Teir 1 Rain(60) Gsetaccuracy(8, 65) Set(V59, 9) //Weather script: Frequency elseif eq(v14, 1) and ge(v17, 5) and lt(v17, 10) then //Teir 2 Rain(60) Gsetaccuracy(8, 75) Set(V59, 8) //Weather script: Frequency elseif eq(v14, 1) and ge(v17, 10) and lt(v17, 15) and elapse(3) then //Teir 3 ammoarea(Ammo_60mm_mortar, 8) Rain(75) Gsetaccuracy(8, 85) Set(V59, 7) //Weather script: Frequency elseif eq(v14, 1) and ge(v17, 15) and elapse(1) then //Teir 4 ammoarea(Ammo_60mm_mortar, 8) ammoarea(Ammo_60mm_mortar, 8) Rain(100) Gsetaccuracy(8, 100) Set(V59, 6) //Weather script: Frequency endif endif endif endif Last edited by Oscarmike247; 05-20-2018 at 05:28 PM. |
#14
|
||
|
Ok
|
#15
|
||
|
Reckon it has anything to do with using a 64 bit OS? Not sure why that would make a difference, but its just a thought.
|
#16
|
||
|
It's a 32 bit program but based on the general understanding of things, I doubt it's anything relevant to this issue.
|
#17
|
||
|
Extrapolating on what you've put here...
Perhaps you could try this to circumvent v16 = 1 on init. Code:
// v16 ;counter // v17 ;helper if piskills(v16) then add(v16, 1) if gt(v16, 1) then add(v17, 1) end endif |
#18
|
|||
|
Quote:
Im not where i can test this at the moment, but wouldnt v17 continue to climb as soon as v16 is gt 1? So if you get one kill, the counter (v17) would just keep increasing every second. Last edited by Oscarmike247; 05-28-2018 at 09:56 AM. |
#19
|
|||
|
Quote:
Also your difficulty script looks like it only counts upwards. Try this to lower the difficulty one level below the current one on death. Code:
if piskills(v16) then add(v16, 1) if gt(v16, 1) then add(v17, 1) ; helper display kills add(v19, 1) ; helper difficulty end endif if not ssnalive(10000) then if le(v18, 1) then set(v19, 0) end if eq(v18,2) then set(v19, 5) end if eq(v18,3) then set(v19, 10) end else if eq(v14,1) and lt(v19, 5) then rain(60) gsetaccuracy 8,65 set(v59, 9) set(v18, 0) end if eq(v14,1) and ge(v19, 5) and lt(v19, 10) then rain(60) gsetaccuracy 8,75 set(v59, 8) set(v18, 1) end if eq(v14,1) and ge(v19, 10) and lt(v19, 15) and elapse(3) then rain(75) gsetaccuracy 8,85 set(v59, 7) set(v18, 2) ammoarea(Ammo_60mm_mortar, 8) end if eq(v14,1) and ge(v19, 15) and elapse(1) then rain(100) gsetaccuracy 8,100 set(v59, 6) set(v18, 3) ammoarea(Ammo_60mm_mortar, 8) ammoarea(Ammo_60mm_mortar, 8) end end endif Last edited by Guest001; 05-28-2018 at 04:31 PM. |
#20
|
||
|
Here's a simple alternative - I made this while back for another map but the var numbers shouldn't matter and you can drop it straight in just change the group and add weather etc...
For difficulty the ai just alternates between 2 standards. Code:
;by stompem 2017 ;Respawn AI if they kill themselves. ;if past(1) and gt(v223,0) and groupdead(0) then ; GroupSpawn 0,1 ;endif // Inits if never() then set(v223, 10) ; win target endif // Player if piskills(v220) then add(v220, 1) add(v225, 1) if gt(v220, 1) then add(v221, 1) sub(v223, 1) end if gt(v223,0) and groupdead(0) then GroupSpawn 0,1 end endif // Display if not eq(v223,0) and elapse(7) then text# "Player Score",v221 text# "Enemy Score",v222 text# "Enemy Left",v223 endif // AI if not ssnalive(10000) then add(v224, 1) set(v225, 1) if eq(v222, 10) and never() then win (0) end else set(v224, 0) endif if eq(v224, 1) then add(v222, 1) endif if lt(v225, 2) then accuracyspread = 10 Gsetaccuracy 0,50,85 GroupAtt 0,16 endif if gt(v225, 1) then accuracyspread = 5 Gsetaccuracy 0,100,100 GroupAtt 0,320 endif if never() and eq(v223, 0) then text " GAME OVER" text# "Final Score",v221 text# "Enemy Score",v222 endif if chain(7) and never() then win (1) endif |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|