TEMPEST.114 Posted October 31, 2022 Posted October 31, 2022 I've tried including the script file in the .miz with the DO SCRIPT FILE action and also DO SCRIPT and point to the file on the server's hard drive. Is there something else that has to be done to allow the DCS DEDICATED server to run scripts?
TEMPEST.114 Posted November 8, 2022 Author Posted November 8, 2022 (edited) as title says. This only fires on single player games even if the player aircraft is set to CLIENT and not PLAYER. This is completely breaking all my scripts. --- Initialise this script -- @param #table newPlayerData <required> [the custom player object to have their menu setup] -- @return none function TIS:Initialise() self:InitialiseTables() world.addEventHandler(TIS) self:LogWrite("TIS", "INFO", "Initialisation Complete. Version %s", self.Version) end --------------------------------------------------------------------------------------------------- -- onEvent --------------------------------------------------------------------------------------------------- --- Subscribed DCS Event Handler -- @param #event event <required> [the name of the event to be handled (or not)] -- @return none function TIS:onEvent(event) if event.id == world.event.S_EVENT_PLAYER_ENTER_UNIT then self:LogWrite("TIS", "INFO", "S_EVENT_PLAYER_ENTER_UNIT") self:AddNewPlayerUsing(event) elseif event.id == world.event.S_EVENT_TRIGGER_ZONE then self:LogWrite("TRIGGER ZONE EVENT", "INFO", "TRIGGER ZONE EVENT!") elseif event.id == world.event.S_EVENT_PILOT_DEAD then self:LogWrite("TIS", "INFO", "S_EVENT_PILOT_DEAD") self:RemoveDeadPlayerFromListOfPlayersUsing(event) elseif event.id == world.event.S_EVENT_PLAYER_LEAVE_UNIT then self:LogWrite("TIS", "INFO", "S_EVENT_PLAYER_LEAVE_UNIT") self:RemoveDeadPlayerFromListOfPlayersUsing(event) end end world.event.S_EVENT_PLAYER_ENTER_UNIT => NEVER fires in a MP server environment. world.event.S_EVENT_PLAYER_LEAVE_UNIT => DOES fire in a MP server environment. PLEASE, can you fix this asap. Really...pretty please... Edited November 8, 2022 by Elphaba
ADHS Posted November 10, 2022 Posted November 10, 2022 Better and accurate results with S_BIRTH. Democracy was already invented, while Scrat was eating oak fruits.
TEMPEST.114 Posted November 12, 2022 Author Posted November 12, 2022 I sorted this out. It was because the script uses S_EVENT_PLAYER_ENTER_UNIT to track new players, but on a MULTIPLAYER server this never fires. I've changed the script to BIRTH - and my script works on MP servers, but it's annoying. 1
ADHS Posted November 13, 2022 Posted November 13, 2022 (edited) It works. This one is tracking just clients, but i've found BIRTH much more accurate. I think differs according the way that everyone is checking the events. I am using an if elseif block with a custom event variable to catch them all and continue. But, i always checking at MP enviroment as ME is not the best to rely that all is working. f.e: If your script starts at 5th second, ME won't get nothing before as it is waiting for you to enter and then start time running. Edited November 13, 2022 by ADHS Democracy was already invented, while Scrat was eating oak fruits.
TEMPEST.114 Posted November 18, 2022 Author Posted November 18, 2022 On 11/13/2022 at 1:27 PM, ADHS said: It works. This one is tracking just clients, but i've found BIRTH much more accurate. I think differs according the way that everyone is checking the events. I am using an if elseif block with a custom event variable to catch them all and continue. But, i always checking at MP enviroment as ME is not the best to rely that all is working. f.e: If your script starts at 5th second, ME won't get nothing before as it is waiting for you to enter and then start time running. The other thing now that I'm able to spawn statics and infantry in my scripts, these trigger the birth event too. So whilst I've had to put an 'if' in to see if they are a unit, and if they are do they have a playerName(), it's still not right. we have an event for just this. It just needs to work.
ADHS Posted November 19, 2022 Posted November 19, 2022 (edited) 22 hours ago, Elphaba said: it's still not right. we have an event for just this. It just needs to work. Hello. It's "right" and "works", but as i said before: is how each one of us is checking it. F.e: For this one, you can easily go through (avoiding pointless UNIT and NAME checks) if you just include or exclude DCS structure objects IDs CATEGORIES: VARIABLE = Event.initiator:getGroup():getCategory() AIRPLANE = 0, HELICOPTER = 1, GROUND_UNIT = 2, SHIP = 3, STRUCTURE = 4 if VARIABLE ~= 3 or VARIABLE ~= 4 then .... (you are excluding SHIP and STRUCTURE birth) or better : if VARIABLE == 0 then .... (you are interesting JUST for airplane birth, excluding ALL the rest CATEGORIES) Edited November 19, 2022 by ADHS Democracy was already invented, while Scrat was eating oak fruits.
ADHS Posted November 26, 2022 Posted November 26, 2022 Did you did pass the problem with the CATEGORY explanation (my comment above) ? Democracy was already invented, while Scrat was eating oak fruits.
TEMPEST.114 Posted November 26, 2022 Author Posted November 26, 2022 9 hours ago, ADHS said: Did you did pass the problem with the CATEGORY explanation (my comment above) ? No, that's how I've already been dealing with this bug, by using the BIRTH and doing a huge IF statement. That's not the point; the point isn't that there is a workaround. The point is that they have an event already in game that a) should work b) does what we need and c) works in all other environments EXCEPTED dedicated MP - therefore it's a bug - and so we shouldn't have to do this. This bug has been known about for years. It just needs 30mins to fix it.
ADHS Posted November 29, 2022 Posted November 29, 2022 (edited) On 11/19/2022 at 2:39 AM, Elphaba said: statics and infantry in my scripts, these trigger the birth event too I am refering about this. It was obvious that you didnt knew about categories checking. (Beware, i am testing you) Edited November 29, 2022 by ADHS Democracy was already invented, while Scrat was eating oak fruits.
TEMPEST.114 Posted November 29, 2022 Author Posted November 29, 2022 6 minutes ago, ADHS said: I am refering about this. It was obvious that you didnt knew about categories checking. (Beware, i am testing you) I DID know about category checking - I've been using it whilst writing scripts with it for months before I found that the MP Dedicated Server doesn't get these events. 8 minutes ago, ADHS said: I am refering about this. It was obvious that you didnt knew about categories checking. (Beware, i am testing you) I don't get what's so hard for individuals to understand. Not just you, but others too. ED have invented this event table / system to fire events. Some of these events don't fire on MP dedicated servers. They should - there is no reason they shouldn't. I just want them to fix it. I don't care that there are workarounds with the BIRTH and category and huge IF statements... that's not the freakin' point. The point is it's currently broken and needs fixing,. How isn't this clear to everyone? I do NOT accept that just because there is a workaround that it doesn't need fixing.
ADHS Posted November 29, 2022 Posted November 29, 2022 Well,if you ask and you got answers you have to...., anyway its not a school here to give/learn baby steps Democracy was already invented, while Scrat was eating oak fruits.
WinterH Posted April 6, 2023 Posted April 6, 2023 Bump, as I've also encountered this, just last evening. Took me about 3 evenings to develop a troop transportation for player helicopters script (I know, CTLD exists, I just like reinventing the wheel I guess, so, yeah :P). It was working beautifully in singleplayer, and we got DCS evening going for the mission yesterday, aaaandd... main highlight of the mission didn't work in multiplayer because of this exact issue. Now, I've changed the event to S_BIRTH, and it will work as intented without changing anything else, no problem. But, there's another script in the mission that makes ground vehicles to deploy squads when they stop, so S_BIRTH will fire up many times. Code will only do actual work if what ever fired the even is a UH-1H, Mi-8MT, or Mi-24P, so that's fine, but still not exactly ideal as we have an event that's supposed work exactly for this kinds situation, and does so without problem on singleplayer. 1 Wishlist: F-4E Block 53 +, MiG-27K, Su-17M3 or M4, AH-1F or W circa 80s or early 90s, J35 Draken, Kfir C7, Mirage III/V DCS-Dismounts Script
Pikey Posted April 11, 2023 Posted April 11, 2023 fyi the MOOSE creator logged this in 2017 He quit DCS waiting for it. I'd recommend not waiting, for your own sanity. I use the Birth event personally then do the working out from there. ___________________________________________________________________________ SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *
mousepilot Posted October 5, 2023 Posted October 5, 2023 Hi everyone, Are there news regarding getting the event "triggered"? This event is really needed for multiplayer mission creation. Could someone at ED give a status update on this? Thanks in advance. 1
cfrag Posted October 6, 2023 Posted October 6, 2023 (edited) 16 hours ago, mousepilot said: This event is really needed for multiplayer mission creation. It surely would help, and I think it is a bit puzzling that we hear nothing from ED on this issue - if this event is deprecated, a simple note to that effect should suffice. In the mean time, you can emulate that event by triggering on Birth, and see if the initiator has getPlayerName implemented, and if it is implemented, if it returns a non-nil result. Something along these lines: function myScript:onEvent(event) local theUnit = event.initiator if not theUnit then return end -- not interesting for us if event.id == 15 then -- Birth event if (not theUnit.getPlayerName) or (not theUnit:getPlayerName()) then return -- AI birth event end -- no player unit. -- if we get here, a player has entered a unit as PIC end end Cheers, -ch Edited October 6, 2023 by cfrag
mousepilot Posted October 6, 2023 Posted October 6, 2023 Hi @cfrag, Thanks for your reply. Unfortunately, the workaround serves only for a few use cases. While it's appropriate for things like adding menus to the "player", it won't work if you are detecting "entry" into a unit (considering also CA units). I think the event should not be deprecated as there is a very clear distinction between both events' semantics (one deals with a unit being spawned, and the other deals with a unit being "entered"). I've also noticed something peculiar in the logs. There is an entry from the scripting engine about the event "under control". Scripting (Main): event:initiator_unit_type=MiG-29A,type=under control, This occurs just before the "S_EVENT_PLAYER_ENTER_UNIT" event. Unfortunately, it doesn't get passed on to the handlers. That seems odd. But I'm guessing that the event is currently "recognized" by DCS (hence the log entry), but it's not being passed to the scripting engine handlers. In fact, there are several other events where this happens (like the "S_EVENT_DISCARD_CHAIR_AFTER_EJECTION"). Is there something else we can do? Can we provide more information to ED or to a representative? Thanks again. 1
cfrag Posted October 6, 2023 Posted October 6, 2023 2 hours ago, mousepilot said: Unfortunately, the workaround serves only for a few use cases. I fully agree. We still have no way to determine when a player enters or leaves a unit as crew, and your point wrt CA is well taken (I hope that some day we may receive an extension to DCS that is worthy of that moniker. IMHO, CA is a very, very rough pre-alpha of what may turn out something worthwhile). That's why I find ED's silence on this topic to disappointing. Myself, I'm hoping against hope that eventually we receive a fully fledged event system that also allows scripts to post appropriate events across DCS. Let's keep our fingers crossed and hope for the best. It's only been 6 years, there's still hope... 1
Grimes Posted October 6, 2023 Posted October 6, 2023 Its on the bug tracker and there has been complaints about it going back to May 2014. The gist is that the event handler is running on each game client, but there are some "local" events that don't get broadcast out to every client when it occurs because your local game uses it for whatever purpose ED decide to use it for. In this instance it is probably related to the logbook or just telling the game that you are in a specific unit. The day night event does the same thing, but is based on camera location. The refueling stop event used to be another one, but this has since been fixed and now occurs for all. 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
mousepilot Posted November 2, 2023 Posted November 2, 2023 I understand, but it seems that several events are in this "situation" where they work in SP or locally hosted MP, but don't work on a dedicated server. Events being so "foundational" should, in my humble opinion, be harmonized between SP and MP. It's tough to develop a mission (for MP) only to realize you've used an event that doesn't work in MP. I won't presume to know what the technical challenges are that prevent ED from making these events trigger both in SP and MP, but I'm hoping that they can find a way to "multicast" the event so that it can reach the handlers on the clients as well. Finally, it would be even better if they could make all events (not just the ENTER UNIT one) be triggered for MP just as they are for SP. Is there any chance you Grimes could raise it up with the dev team again? Any help is appreciated. Thanks again. 1
TEMPEST.114 Posted March 25, 2024 Author Posted March 25, 2024 On 11/2/2023 at 9:58 PM, mousepilot said: I understand, but it seems that several events are in this "situation" where they work in SP or locally hosted MP, but don't work on a dedicated server. Events being so "foundational" should, in my humble opinion, be harmonized between SP and MP. It's tough to develop a mission (for MP) only to realize you've used an event that doesn't work in MP. I won't presume to know what the technical challenges are that prevent ED from making these events trigger both in SP and MP, but I'm hoping that they can find a way to "multicast" the event so that it can reach the handlers on the clients as well. Finally, it would be even better if they could make all events (not just the ENTER UNIT one) be triggered for MP just as they are for SP. Is there any chance you Grimes could raise it up with the dev team again? Any help is appreciated. Thanks again. Hear hear. A decade of waiting for this event to be fixed.
Recommended Posts