|
Joint Operations Anything about the Joint Operations series of games. |
![]() |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||
|
WAC Limits?
Hi all. I'm making a fairly complex single player map for JO:E and have encountered an issue with my WAC scripts.
The problem is that I seem to have run into a limit. If I add any more scripts, they do not work. I have gone through each line to look for errors multiple times and have not found any. It is always the last script or part of the last script in the file that does not work. I have a Text script that prints "WAC 100%" at the end of the WAC to ensure the whole WAC is completing on map start. The only thing that gets the WAC to load 100% is to remove a script, any script. weather it's from the top or middle, as long as I remove something, it seems to work. Have I hit some kind of memory limit? I thought maybe it was the number of lines in the WAC. The WAC is quite large at 1332 lines. although a lot of that is comment lines and such. But I have another map that has even more lines than this and has a bigger WAC file size and I have no issues with it. I'm afraid I may have hit some sort of limit manipulating too many variables or something. The map involves things like a player money and inventory system, vehicle fuel system, and vehicle repair system. Also some interactions with NPC's. I even tried removing all of my comment lines and such from the WAC. Has anyone ran into this issue before with large WAC scripts? |
#2
|
||
|
Have you tried searching for permanent spaces? I think a permanent space gave me a .wac-induced headache once, or it was some other weird non-printable character of some sort, something you can type by accident, like with ctrl+shift+space or something dumb like that.
I vaguely recall a .wac or two that seemed to quit after a point, and I tried just moving the events around, and eventually, it stopped breaking, and I'm not sure if I ever found the actual problem, and there are few things in this world that I hate as much as breaking something with no clue as to how, but fixing something with no clue as to how is one of them. Should also mention I write and edit all my .wacs by hand in notepad.exe, and mostly for DFBHD, so I might be lost on JO:E scripting. Wish you all the luck, though.
__________________
////////////////////<- SIGNATURE STARTS ->\\\\\\\\\\\\\\\\\\\\\ The NSO Deadline Mod at NovaHQ.net: /////////////////////<- SIGNATURE ENDS ->\\\\\\\\\\\\\\\\\\\\\\
Last edited by Baldo_the_Don; 07-08-2024 at 01:54 AM. |
#3
|
||
|
try repositioning those non-read command lines to be on the side of another line. even though you do not want the game to read certain lines, i do believe they count against a perceived "limit".
also, make sure you dont have something in one of your command lines that is impossible for the game to execute. edit: too many variables can cause issues. i know there are like 511 ish variables but i think most people didnt go too fsr into the 200's when using vars. ![]() |
#4
|
||||||
|
Thanks guys for the replies!
Quote:
Quote:
Quote:
Quote:
Here is what I've found since I posted this. It may have something to do with the number of Text("") strings I'm printing. I noticed that if I remove some text from some of the text strings it fixes the issue! Not by removing the Text("") commands, but removing some of the text within the strings. I tallied up all of my text in the game, There are 163 Text("") commands and 4414 characters of text that will be displayed on the screen through out the map. So I took all of these lines and put them into a NEW test map WAC and found that it prints every line until text line 153 or 4246 characters! after that it cuts it off the rest of the text and won't let any WAC commands fire after that. So maybe I'm hitting a memory limit to the number of Text("") lines or text character limit in the game?? |
#5
|
|||
|
Quote:
![]() |
#6
|
||
|
Oh. I know that in DFBHD(TS), if a text or consol message in the .wac has more than 63 characters between the double-quotes, the game will crash to desktop at 90% loadbar. In the DFWIQ and SFOD mods I experiment in, if a text or consol message in the .wac has more than 63 characters between the double-quotes, the game just doesn't display any more than the first 63 characters in that line.
Maybe there's a text buffer that's overrunning. Maybe you're onto something.
__________________
////////////////////<- SIGNATURE STARTS ->\\\\\\\\\\\\\\\\\\\\\ The NSO Deadline Mod at NovaHQ.net: /////////////////////<- SIGNATURE ENDS ->\\\\\\\\\\\\\\\\\\\\\\
|
#7
|
|||
|
Quote:
Good question. Im currently using console to display player info such as money in his wallet and items he's holding. Next time im at my PC I'll test it and see. |
#8
|
|||
|
Quote:
![]() |
#9
|
|||
|
Quote:
if I do the following in the WAC... Text("1.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U. V.W.X.Y.Z.1.2.3.4.5.6.7.8.9.0") in game I get... 1.A.B.C.D.E.F.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.X. Y.Z.1.2.3.4.5 Which is 63 characters. |
#10
|
||
|
As I found in my previous reply, there seems to be a 63 char limit per text command. Now my question was, is there a Text command limit, or a character limit? or both?
So I made a script with text commands Text("1") Text("2") Text("3") Text("4") Text("5") Text("6") Text("7") Text("8") Text("9") Text("10") .... Text("198") Text("199") Text("200") all the way to 200 text lines (much more than my map WAC that is failing), and it printed every line just fine. So there doesn't seem to be an issue there. Next I started testing for a character limit. So I set up about 70 text lines each containing 63 chars. See screenshots. As you can see, it stopped at "65.A.B.C.D.E.F." So it appears that the char limit for text is 4,047 characters. Now I'll test if the Console text is included in this... Edit: Yes, the console text is included in this 4047 character limit. Last edited by Oscarmike247; 07-08-2024 at 10:07 PM. |
#11
|
||
|
To remedy the issue, I came up with a way to drastically reduce the text used in the map. Most of my text lines were the same or similar messages just repeated under different scripts. So I took all of the text lines that were the same and used in multiple scripts and set them up with a single variable. In this case v9...
So I can do this... if eq(v9, 1) then Text("Text string 1") endif if eq(v9, 2) then Text("Text string 2") endif if eq(v9, 3) then Text("Text string 3") endif Then add a script to automatically set the text variable v9 back to 0 after it's used, this way the text doesn't keep repeating when it is called on by another script... If gt(v9, 0) and elapse(1) then set(v9, 0) endif Now when ever I want to use these text strings in multiple scripts, instead of doing this... If CONDITION then Text("Text String 1") endif I can do this... If CONDITION then Set(v9, 1) //Text String 1 endif This allows me to use the same 'Text(" ") command over several scripts without using up more of the character limit. In some cases I had up to 11 different scripts using the same text line. I did this process for every text line that was used more than once and reduced my total characters from 4,246 to 1,639 characters. That's a big difference. Sorry I'm rambling on, but maybe someone else can use this in the future. |
#12
|
||
|
hell, great find. too bad all the old sites are gone. i do recall the guys over at CMHQ were discussing wac limitations and there were theories about this but nothing definitive.
![]() |
#13
|
||
|
Well I'm having more issues. This time getting a crash when the map gets to the end of the loading bar.
I fear I may have reached some other sort of limit. This time it seems to be with actual If statements. if I add anymore scripts, it crashes, even if the script has no actions in it. I'm currently at 314 if statements. Is there no dump file or any way for me to know what exactly causing the crash? I checked for a sysdump.txy but it doesn't generate one. |
#14
|
|||
|
Quote:
i dont remember how many the limit is, but there is one for the wac file. there is also a limit in the med but i think the way to possibly get around that is to "nest" if statements to a specific event in the wac similar to how you can choose several if/then statements per event in the med scripting. ![]() Last edited by jabo1SFH; 07-16-2024 at 10:17 PM. |
#15
|
||
|
something like this:
Code:
if gt(v56,100) then if elapse(60) then if random(4) then set(v58,0) overcast(40,20) skyspeed(30) fogdist(512) Rain(35,20) else if eq(rnd,2) then set(v58,3) overcast(15,20) skyspeed(20) fogdist(682) Rain(0,20) wave("wren8.wav") endif else if eq(rnd,3) then set(v58,0) overcast(60,20) skyspeed(40) fogdist(341) Rain(65,20) endif else if eq(rnd,4) then set(v58,1) overcast(100,20) skyspeed(60) fogdist(204) Rain(100,20) farflash() set(v58,1) endif else if eq(rnd,5) and eq(v58,1) then flash() wave("gustb_4.wav") endif endif endif if elapse(25) and eq(v58,1) then flash() endif if elapse(55) and eq(v58,3) then wave("wren8.wav") endif if eq(v56,102) then set(v56,100) set(v58,0) fogdist(1024) skyspeed(23) overcast(0,20) Rain(0,20) wave("wren8.wav") endif endif thats how nile generates a nesting for a wac file. ![]() |
#16
|
||
|
Nesting them doesn't seem to affect the crashing. In my testing, it doesn't seem to matter it the "If" statement is nested in another or not. If I go over 313, it seems to crash.
This also goes for "elseIf" statements. I have been able to go through my WAC and optimize many of them. I was able to reduce the number of if statements used by using different methods or structuring them differently to achieve the same affect. but so far I was only able to knock it down to 308 If's. Which is concerning because I still have more I need to add to the map. Worth noting, MED events do not seem to affect the crash. so I may need to go through the WAC scripts and see what events I can create in the MED events instead. Here's some examples of scripts that have some nesting. Do I have them structured correctly? Ignore the ";c" and ";e" I just use those in Notepad++ to collapse scripts. Code:
;c //v102 Gas level SSN 15 TAXI if medrive(15) and gt(v102, 0) and elapse(12) then //Drains gas when driving dec(v102) endif If true(V108) and lt(v102, 1) then //disables vehicle when out of gas disablessn(15) elseif true(v108) and gt(v102, 0) then //enables vehicle if> it has gas enablessn(15) endif endif ;e ;c //Vehicle Repair Taxi SSN 15 if (ssnseesssn(player, 15, 5) or ssnonssn(player, 15)) and weaponfired(1) and ssnalive(15) then if gt(v3,0) then //if player has spare parts Set(v9, 1) //text("Repaired Vehicle") SSNADDHP(15, 250) //Add HP to vehicle dec(V3) //Remove one spare parts from player inventory ss2ssn(FARP, 15) else set(v9,2) //Text("<cff0000>Not enough parts to repair vehicle") //Text Color RED endif if gt(v54, 0) and le(v102, 85) then //Refuel vehicle from player's gas can add(v102, v54) //add fuel to vic sub(v54, v54) //remove from inventory Text("fueled from gas can") endif endif ;e Last edited by Oscarmike247; 07-17-2024 at 06:30 AM. |
#17
|
||
|
I'm not sure what exactly is going on here, I just know that this happens...
So I did some optimizing and restructuring of my WAC scripts and was able to knock my total scripts down from 314 to 282 without losing any features or events in the map. which is cool. But I did this because it seemed that my new crashing issue was related to the number of scripts. Again, if I removed any script, it would work. then if I even added a script with no conditions or actions (If then endif) it would crash. So, after reducing everything down, I figured I could go ahead and start adding more scripts for another part of the map. I added 4 new scripts, loaded the map and it crashed again on load. So I deleted the new scripts until I was one script away from triggering a crash. then I added an if statement with no conditions or actions (if then endif). If I add this script at the end of my WAC, the map runs fine, but if I place it anywhere ABOVE the last script in the WAC or even at the very start, it causes a crash. So I added my new scripts to the bottom of the WAC instead of in the middle, and boom, it runs fine. It's starting to sound similar to Baldo's issue. but like him, I might be able to fix it by moving scripts around, but I'm frustrated not knowing what the hell is going on to cause the crash. Also disappointed that I wont be able to keep my scripts organized since I have to add new ones to the bottom. |
#18
|
||
|
I can't help thinking that if certain hexes or certain strings of hexes in certain lines or at certain positions in lines with certain values are present in a .wac file, the game gets weird about it.
Like if, semi-randomly exampled, 0D and 0A are the 71st and 72nd characters in a line, the game misinterprets it as a line break, and can do nothing with it, or anything after it. Or some other arcane misreading of some character chain as an invalid control order. I don't know exactly what I'm talking about, so I can't exactly express it cogently, but if just cutting a .wac event out and inserting it in a different postion in a .wac file fixes the script or changes where the script breaks, that means something, doesn't it?
__________________
////////////////////<- SIGNATURE STARTS ->\\\\\\\\\\\\\\\\\\\\\ The NSO Deadline Mod at NovaHQ.net: /////////////////////<- SIGNATURE ENDS ->\\\\\\\\\\\\\\\\\\\\\\
|
#19
|
|||
|
Quote:
I've gone through my script for the 10th time, looking for anything that's misprinted or wrong. Also using Notepad++ helps a lot with this, because I have it set up to read the WAC language. so it can tell me if an "if" statement is missing an "Endif" somewhere for example. I'm pretty confident there are no errors in my scripts. I've also noticed that if I even just add a new action to one of the scripts above the the break point, it will also cause it to crash. I don't think that was happening the last time I ran into this. For now, I have created a comment line in my WAC, and anything new will have to be added below that line, which seems to work. |
#20
|
||
|
yeah, always add new wac events towards the botto, especially if you have break lines in them. the game reads the entire wac something like 2x per second or something similar so it will fire an event if the condition has been met with the next read-through.
also, at the very bottom of your wac, leave a 1 line return space. i remember reading that it helps the game understand that is the end of all scripting. ![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|