ENO Posted April 6, 2013 Posted April 6, 2013 (edited) Eh guys. I've been wrestling with this issue and I'm wondering if there is a workaround. Basically, when I set up MIST with SLMOD pausing the server when empty I'm having a bit of an issue with the first person joining. I run a mission start trigger with "time more (1)" and then do script file for the MIST function. In the meantime I have MIST monitoring for dead map objects. Every time someone FIRST joins the server they can't join because on the server side an error mission comes up saying "null value MIST etc." I took this to Speed once before and he walked me through it and I think I fluked through the resolution because every time I try to run a mission with that loaded I have issues. I think what's happening is that because it's "time more (1)" and because I have the mission "paused when empty" when that first person joins- MIST wants to load but can't because it hasn't yet elapsed 1 second. Once the error is acknowledged (if someone else actually joins) and the clock ticks past the 1 second, it doesn't happen anymore. Is there another workaround? Any chance the pause can be delayed a few seconds to let the scripts load properly? Just wondering. Thanks! EDIT: Well- Maybe I solved my own problem but I'll leave this up in case anyone else has similar problems. That first MIST activation (recommended to be near the top of your trigger list) can be a "mission start" trigger with no condition... with the action being "do script file" I believe it is- and point to the MIST 1.1.lua. I've done that and seems to have resolved the issue. Edited April 6, 2013 by ENO "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Grimes Posted April 7, 2013 Posted April 7, 2013 I run a mission start trigger with "time more (1)" and then do script file for the MIST function. In the meantime I have MIST monitoring for dead map objects. I realize you figured it out, but I'll explain what had happened. Mist and other lua tables are either going to be global or local variables within the scripting engine. Lua variables simply do not exist until it is created, thus it is impossible to use a Mist function until the actual script to create Mist is run. This differs from flags as flag values default to "0" and can be checked even if the flag was never used anywhere else. The only similarity is that you can check for the existence of a lua variable, which would essentially return a true/false. You can actually protect yourself slightly from scripting errors for slmod functions by simply putting slmod functions inside a statement like this if slmod then slmod functions end For reference for figuring out dependency between multiple scripts I believe the order in which scripts are loaded/checked is the following: 1. Mission Start/Once> Time less than 1>Do Script 2. Do Script/Do Script file waypoint action on a groups first waypoint 3. Once>Time More> Do Script If multiple scripts are associated with a single trigger then the scripts are loaded from the list top to bottom. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
ENO Posted April 8, 2013 Author Posted April 8, 2013 Thanks Grimes- Another quick question... I'm setting something up so that a certain number of aircraft need to be in the mission before a trigger is hit- I'm basically doing it by having a big zone and when "unit in zone" a flag increases in value. When the unit is out of the zone, the same flag decreases in value. I'm running it off a switched condition trigger. I'm wondering if there's a way that you can check a flag's value to make sure it's actually working the way it should. Is there a way to do that? Also, having a heck of a time trying to figure out how to establish "moving" zones- presumably around particular vehicles... any secret to that or am I blind? "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Grimes Posted April 8, 2013 Posted April 8, 2013 For testing purposes just put a script like this on a continuous trigger: trigger.action.outText(trigger.misc.getUserFlag(FLAGNUMBER), 2) While the group inside/outside zone triggers certainly work, you can use Mist in the mission to do the same sort of thing more efficiently :) Moving zones are pretty simple. You just place the zone anywhere on the map, preferably in the middle of nowhere. The moving zone triggers look the same as normal zone triggers, except for the extra "unit zone" value or something like that. This value defines which unit the zone will be "attached to." I haven't used moving zones in a while, but if I remember correctly the zone that you placed on the map might still be a "valid" zone. If units travel into the map placed zone or the one defined by the moving zone, the trigger might still be true. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
ENO Posted April 9, 2013 Author Posted April 9, 2013 Thanks Grimes- that WAS easy. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
ENO Posted April 12, 2013 Author Posted April 12, 2013 For testing purposes just put a script like this on a continuous trigger: trigger.action.outText(trigger.misc.getUserFlag(FLAGNUMBER), 2) While the group inside/outside zone triggers certainly work, you can use Mist in the mission to do the same sort of thing more efficiently :) Well- the moving zone was easy... I can't seem to make that script work. I keep getting a do script error... :doh: "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
Grimes Posted April 12, 2013 Posted April 12, 2013 trigger.action.outText(trigger.misc.getUserFlag('1'), 2) Number needs to be inputted as a string, hence needs to be like this: 'number' The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
ENO Posted April 12, 2013 Author Posted April 12, 2013 Thanks Grimes- I'll give it a try. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
johnv2pt0 Posted May 13, 2013 Posted May 13, 2013 Eh guys. I've been wrestling with this issue and I'm wondering if there is a workaround. Basically, when I set up MIST with SLMOD pausing the server when empty I'm having a bit of an issue with the first person joining. I run a mission start trigger with "time more (1)" and then do script file for the MIST function. In the meantime I have MIST monitoring for dead map objects. Every time someone FIRST joins the server they can't join because on the server side an error mission comes up saying "null value MIST etc." I took this to Speed once before and he walked me through it and I think I fluked through the resolution because every time I try to run a mission with that loaded I have issues. I think what's happening is that because it's "time more (1)" and because I have the mission "paused when empty" when that first person joins- MIST wants to load but can't because it hasn't yet elapsed 1 second. Once the error is acknowledged (if someone else actually joins) and the clock ticks past the 1 second, it doesn't happen anymore. Is there another workaround? Any chance the pause can be delayed a few seconds to let the scripts load properly? Just wondering. Thanks! EDIT: Well- Maybe I solved my own problem but I'll leave this up in case anyone else has similar problems. That first MIST activation (recommended to be near the top of your trigger list) can be a "mission start" trigger with no condition... with the action being "do script file" I believe it is- and point to the MIST 1.1.lua. I've done that and seems to have resolved the issue. Do you mind explaining how you're setting the server to pause when clients are not present? I'm guessing you're populating a table and then having a trigger set a flag that then runs a script to pause? What is the verbiage to "pause"...and more to the point where can I find all those types of commands (possible options for use when scripting). TYIA ~
ENO Posted May 13, 2013 Author Posted May 13, 2013 If you're asking me I simply use slmod. It is an option in the config.lua. If you're asking about how they script it to work that way, I will need to hand that off to one of the masters. "ENO" Type in anger and you will make the greatest post you will ever regret. "Sweetest's" Military Aviation Art
johnv2pt0 Posted May 13, 2013 Posted May 13, 2013 If you're asking me I simply use slmod. It is an option in the config.lua. If you're asking about how they script it to work that way, I will need to hand that off to one of the masters. I was poking around in the wrong file...sigh. Thanks for the response ~
Recommended Posts