Jump to content

Enter Unit (EVENT)


GaSi
 Share

Recommended Posts

Sorry for my English which is not good.

 

Using the Event Handler, the Enter Unit events do not work, they only work with whoever hosts the server. Birth, Leave Unit, Start Up work perfectly. Please check and fix this bug as it breaks several scripts and one of the important ones I use in my flight group.

 

Thanks!

Link to comment
Share on other sites

Hi Flappie, thanks for your answer.

 

I send the .miz file with a simple event handler script showing the problem.

 

In BUG_1.jpg You can see that the EnterUnit event does not show it for any player, only for those who host the server. This did not happen before the update working without problems. But now for some unknown reason it doesn't take the event for any other player other than the host.

 

In BUG_2.jpg You can see that in MARK events, both when it is added and when it is removed it always shows the name of the player who host the server. I discovered this problem several months ago but it was not causing me problems, but it would be good to fix it.

 

I would be grateful if you could fix it as many of my missions use the EnterUnit event to add radio commands to them.

 

For my part excuse me, English is not my native language and if you need something to solve it you can contact me.

Test Events.miz

BUG_1.thumb.jpg.a3ca8a2fc5fdacca1527b10722e56b9d.jpg

BUG_2.thumb.jpg.bec8ce840fd7c5eb5933410409bb875a.jpg

Link to comment
Share on other sites

OK. I've never used these events but I might be able to help. Try loading this script instead of yours, and test it in a multiplayer session. Ask your friend to hop into an aircraft, then quit the game.

 

In the server's dcs.log file, you should see "SCRIPTING" messages like these:

2020-10-10 19:52:11.575 INFO NET: release unit 1

2020-10-10 19:52:11.575 INFO Scripting: event:type=relinquished,initiatorPilotName=[bSD] Flappie,target=Aerial-1-1,t=28804.006,targetMissionID=1,

2020-10-10 19:52:11.575 INFO SCRIPTING: 21

2020-10-10 19:52:12.791 INFO NET: client[1] occupied unit 3

2020-10-10 19:52:16.395 INFO DCS: MissionSpawn:spawnLocalPlayer 3,Su-25T

2020-10-10 19:52:16.443 INFO VISUALIZER: cockpit ILV loaded

2020-10-10 19:52:16.447 INFO Scripting: event:type=under control,initiatorPilotName=[bSD] Flappie,target=Aerial-3-1,t=28808.827,targetMissionID=3,

2020-10-10 19:52:16.447 INFO SCRIPTING: 20

2020-10-10 19:52:18.127 INFO Scripting: event:type=birth,initiatorPilotName=[bSD] Flappie,place=Kobuleti,t=28808.827,placeDisplayName=Kobuleti,initiatorMissionID=3,

2020-10-10 19:52:18.128 INFO SCRIPTING: 15

2020-10-10 19:52:19.121 INFO WORLDGENERAL: loaded from mission Scripts/World/birds.lua

2020-10-10 19:56:57.936 INFO NET: server has stopped

You're looking for a code different from 21 (PLAYER_LEAVE_UNIT), 20 (PLAYER_ENTER_UNIT), and 15 (EVENT_BIRTH).

 

If you can't find any new code when your friend enters an aircraft, this probably means you've found a bug.

id_event.lua

A track or it didn't happen.

Link to comment
Share on other sites

Hi Flappie.

 

Thanks for the file, I just tested.

 

 

The same thing happened with the lua you sent me, the event 20 EnterUnit does not take it.

 

I hope it is not a difficult problem to solve and in the next update it works.

 

I really need it to work because the dynamic campaign I have developed uses this event to add radio commands.

 

Thank you very much for the quick reply.

 

2020-10-10 20:40:29.676 INFO DCS: Screen: mission_online

2020-10-10 20:40:29.680 INFO Dispatcher: precache units resources in slots

2020-10-10 20:40:29.688 INFO Lua: Lua CPU usage: metric: average mission loading: 2.9667 %

2020-10-10 20:40:29.688 INFO Dispatcher: loadMission Done: Сontrol passed to the player

2020-10-10 20:40:46.322 INFO NET: onPlayerSlot(1, 1)

2020-10-10 20:40:46.322 INFO NET: passed onPlayerTryChangeSlot

2020-10-10 20:40:46.322 INFO NET: release unit

2020-10-10 20:40:46.324 INFO NET: client[1] occupied unit 1

2020-10-10 20:40:47.170 INFO NET: simResume: curTime=14293.170765, syncDelay=0.500000, startTime=14293.670765

2020-10-10 20:40:47.170 INFO NET: simulation starting, state=ssStarting

2020-10-10 20:40:47.170 INFO NET: syncStart at 14293.670765:

2020-10-10 20:40:47.687 INFO NET: simulation started, state=ssRunning

2020-10-10 20:40:47.689 INFO TACVIEW.DLL: Recording flight data in [x:\Tacview-20201010-174047-DCS-Test Events.zip.acmi]

2020-10-10 20:40:47.690 INFO LuaNET: [LOTATC] Load from simu...

2020-10-10 20:40:47.695 INFO LuaNET: [LOTATC] Load from simu OK

2020-10-10 20:40:51.837 INFO NET: onPlayerSlot(1, )

2020-10-10 20:40:51.837 INFO NET: passed onPlayerTryChangeSlot

2020-10-10 20:40:51.837 INFO NET: release unit 1

2020-10-10 20:40:51.838 INFO NET: client[1] occupied unit

2020-10-10 20:40:55.337 INFO Lua: Lua CPU usage: metric: average mission execution: 1.4623 %

2020-10-10 20:40:55.337 INFO NET: simulation paused, modelTime = 7.638000

2020-10-10 20:40:55.755 INFO NET: simResume: curTime=14301.755477, syncDelay=0.500000, startTime=14302.255477

2020-10-10 20:40:55.755 INFO NET: simulation starting, state=ssStarting

2020-10-10 20:40:55.755 INFO NET: syncStart at 14302.255477:

2020-10-10 20:40:56.270 INFO NET: simulation started, state=ssRunning

2020-10-10 20:41:13.411 INFO NET: accepting connection from xx.xxx.x.xxx:64818

2020-10-10 20:41:13.420 INFO NET: adding client[2]

2020-10-10 20:41:13.471 INFO NET: added client[2] name=CETAV - [sAINT] addr=xx.xxx.x.xxx:64818

2020-10-10 20:41:13.474 INFO LuaNET: [LOTATC] Player connect: xx.xxx.x.xxx

2020-10-10 20:41:13.475 INFO LuaNET: [LOTATC] Player connect done

2020-10-10 20:41:14.592 INFO NET: client[2] UDP port changed from 64818 to 56674

2020-10-10 20:41:24.720 INFO NET: onPlayerSlot(1, 1)

2020-10-10 20:41:24.721 INFO NET: passed onPlayerTryChangeSlot

2020-10-10 20:41:24.721 INFO NET: release unit

2020-10-10 20:41:24.721 INFO NET: client[1] occupied unit 1

2020-10-10 20:41:27.242 INFO DCS: MissionSpawn:spawnLocalPlayer 1,Su-25T

2020-10-10 20:41:27.249 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:41:27.297 INFO VISUALIZER: cockpit ILV loaded

2020-10-10 20:41:27.300 INFO Scripting: event:type=under control,initiatorPilotName=[CETAV] - GaSi,target=Aerial-1-1,t=28838.589,targetMissionID=1,

2020-10-10 20:41:27.300 INFO SCRIPTING: 20

2020-10-10 20:41:27.318 INFO COCKPITBASE: lua state still active GNS430, 1 (status undefined)

2020-10-10 20:41:27.318 INFO COCKPITBASE: lua state still active SNS, 2 (status undefined)

2020-10-10 20:41:27.318 INFO COCKPITBASE: lua state still active GNS430_Radio, 3

2020-10-10 20:41:27.318 INFO JSAVIONICS: Shaders preparing...

2020-10-10 20:41:27.318 INFO JSAVIONICS: Vertex shader prepared

2020-10-10 20:41:27.318 INFO JSAVIONICS: Pixel shader(col) prepared

2020-10-10 20:41:27.318 INFO JSAVIONICS: Pixel shader(tex) prepared

2020-10-10 20:41:27.318 INFO JSAVIONICS: initState OK

2020-10-10 20:41:27.933 INFO JSAVIONICS: loaded 129562 nav aids

2020-10-10 20:41:28.947 INFO JSAVIONICS: loaded 146684 cities

2020-10-10 20:41:28.948 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:41:28.953 WARNING LOG: 1 duplicate message(s) skipped.

2020-10-10 20:41:28.953 INFO Scripting: event:type=birth,initiatorPilotName=[CETAV] - GaSi,place=Kobuleti,t=28838.589,placeDisplayName=Kobuleti,initiatorMissionID=1,

2020-10-10 20:41:28.953 INFO SCRIPTING: 15

2020-10-10 20:41:28.954 INFO WORLDGENERAL: loaded from mission Scripts/World/birds.lua

2020-10-10 20:41:28.954 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:41:29.014 WARNING LOG: 4 duplicate message(s) skipped.

2020-10-10 20:41:29.014 ERROR_ONCE DX11BACKEND: texture 'su25-cpt-mb-01' not found. Asked from 'NGMODEL'

2020-10-10 20:41:29.028 INFO EDTERRAINGRAPHICS41: surface5 gc() LOD 0 85 squares

2020-10-10 20:41:29.031 INFO EDTERRAINGRAPHICS41: surface5 gc() LOD 1 86 squares

2020-10-10 20:41:29.031 INFO EDTERRAINGRAPHICS41: surface5 gc() 8.680200 ms

2020-10-10 20:41:29.032 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:43:45.703 WARNING LOG: 12455 duplicate message(s) skipped.

2020-10-10 20:43:45.703 INFO NET: client[2] is ready to start

2020-10-10 20:43:45.703 INFO NET: spawning client[2]

2020-10-10 20:43:45.705 INFO NET: client[2] started

2020-10-10 20:43:45.705 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:43:53.936 WARNING LOG: 738 duplicate message(s) skipped.

2020-10-10 20:43:53.936 INFO NET: onPlayerSlot(2, 2)

2020-10-10 20:43:53.936 INFO NET: passed onPlayerTryChangeSlot

2020-10-10 20:43:53.936 INFO NET: release unit

2020-10-10 20:43:53.936 INFO NET: client[2] occupied unit 2

2020-10-10 20:43:53.937 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:44:05.208 WARNING LOG: 1015 duplicate message(s) skipped.

2020-10-10 20:44:05.208 INFO Scripting: event:type=birth,initiatorPilotName=CETAV - [sAINT],place=Kobuleti,t=28996.555,placeDisplayName=Kobuleti,initiatorMissionID=2,

2020-10-10 20:44:05.208 INFO SCRIPTING: 15

2020-10-10 20:44:05.208 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:44:46.169 WARNING LOG: 3685 duplicate message(s) skipped.

2020-10-10 20:44:46.169 INFO Scripting: event:type=relinquished,initiatorPilotName=CETAV - [sAINT],target=Aerial-2-1,t=29037.521,targetMissionID=2,

2020-10-10 20:44:46.169 INFO SCRIPTING: 21

2020-10-10 20:44:46.170 INFO NET: remove: client[2]

2020-10-10 20:44:46.171 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:50:29.701 WARNING LOG: 30919 duplicate message(s) skipped.

2020-10-10 20:50:29.701 INFO TACVIEW.DLL: During the last 600.0s an average of 0 units objects and 0 ballistic objects have been active per frame

2020-10-10 20:50:29.701 INFO TACVIEW.DLL: The average frame rate of 59.7fps would have been 60.0fps if the flight data recorder was disabled

2020-10-10 20:50:29.701 INFO TACVIEW.DLL: DCS World simulation is taking 99.5% of CPU

2020-10-10 20:50:29.701 INFO TACVIEW.DLL: DCS GetWorldObjects is taking 0.2% of CPU

2020-10-10 20:50:29.701 INFO TACVIEW.DLL: Tacview recorder is taking 0.3% of CPU

2020-10-10 20:50:29.735 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:53:47.305 WARNING LOG: 17782 duplicate message(s) skipped.

2020-10-10 20:53:47.305 INFO NET: accepting connection from xx.xxx.x.xxx:64916

2020-10-10 20:53:47.316 INFO NET: adding client[2]

2020-10-10 20:53:47.316 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:53:47.366 WARNING LOG: 4 duplicate message(s) skipped.

2020-10-10 20:53:47.366 INFO NET: added client[2] name=CETAV - [sAINT] addr=xx.xxx.x.xxx:64916

2020-10-10 20:53:47.367 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:53:47.367 INFO LuaNET: [LOTATC] Player connect: xx.xxx.x.xxx

2020-10-10 20:53:47.367 INFO LuaNET: [LOTATC] Player connect done

2020-10-10 20:53:47.383 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:53:48.475 WARNING LOG: 98 duplicate message(s) skipped.

2020-10-10 20:53:48.475 INFO NET: client[2] UDP port changed from 64916 to 55475

2020-10-10 20:53:48.483 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:53:52.716 WARNING LOG: 380 duplicate message(s) skipped.

2020-10-10 20:53:52.716 INFO NET: client[2] is ready to start

2020-10-10 20:53:52.716 INFO NET: spawning client[2]

2020-10-10 20:53:52.718 INFO NET: client[2] started

2020-10-10 20:53:52.718 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:53:55.849 WARNING LOG: 282 duplicate message(s) skipped.

2020-10-10 20:53:55.849 INFO NET: onPlayerSlot(2, 2)

2020-10-10 20:53:55.849 INFO NET: passed onPlayerTryChangeSlot

2020-10-10 20:53:55.849 INFO NET: release unit

2020-10-10 20:53:55.849 INFO NET: client[2] occupied unit 2

2020-10-10 20:53:55.850 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:53:57.887 WARNING LOG: 181 duplicate message(s) skipped.

2020-10-10 20:53:57.887 INFO Scripting: event:type=birth,initiatorPilotName=CETAV - [sAINT],place=Kobuleti,t=29589.234,placeDisplayName=Kobuleti,initiatorMissionID=2,

2020-10-10 20:53:57.887 INFO SCRIPTING: 15

2020-10-10 20:53:57.887 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:54:33.166 WARNING LOG: 3175 duplicate message(s) skipped.

2020-10-10 20:54:33.166 INFO Scripting: event:type=engine startup,initiatorPilotName=CETAV - [sAINT],place=Kobuleti,t=29624.52,placeDisplayName=Kobuleti,initiatorMissionID=2,

2020-10-10 20:54:33.166 INFO SCRIPTING: 18

2020-10-10 20:54:33.166 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

2020-10-10 20:57:16.481 WARNING LOG: 14697 duplicate message(s) skipped.

2020-10-10 20:57:16.481 INFO Scripting: event:type=takeoff,initiatorPilotName=CETAV - [sAINT],place=Kobuleti,t=29787.833,placeDisplayName=Kobuleti,initiatorMissionID=2,

2020-10-10 20:57:16.482 INFO SCRIPTING: 3

2020-10-10 20:57:16.482 ERROR WORLDGENERAL: MagVar: Storage hasn't been initialized!

Link to comment
Share on other sites

Really thanks Flappie!

 

Please don't forget to also check out the ADD / REMOVED MARK Event. It always shows the name of the player who hosted the server. There must be some conflict or some parameter that is not taking into account since the mark left on the map shows the player's name but the event does not.

 

and thanks again for quick answer!

 

Have a nice weekend!

Link to comment
Share on other sites

I will ask the team about it, but can not make any promises.

 

thanks

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 10 Pro x64, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 32GB DDR @3000, ASUS ROG Strix Z490-F Gaming, HP Reverb G2

Link to comment
Share on other sites

I will ask the team about it, but can not make any promises.

Thank, BN. I hope you will be more successful then the last couple of times you said that.

 

But don't worry, this is just one of the most important (MP) events in the game. Fortunately, there is a workaround otherwise it would simply not be possible to create player specific stuff like F10 menus and the like.

 

Sorry, if I sound a bit sarcastic. But we have been begging on our knees for this to be finally fixed and all we ever got was "I will ask about it", "it takes time".

A warrior's mission is to foster the success of others.

i7-8700K | Asus RTX 2080Ti Strix OC | 32 GB Ram 3200 MHz DDR-4 | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | Rift S

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

Thank, BN. I hope you will be more successful then the last couple of times you said that.

 

But don't worry, this is just one of the most important (MP) events in the game. Fortunately, there is a workaround otherwise it would simply not be possible to create player specific stuff like F10 menus and the like.

 

Sorry, if I sound a bit sarcastic. But we have been begging on our knees for this to be finally fixed and all we ever got was "I will ask about it", "it takes time".

 

The stage we are at with this is that if it was to be implemented it could create more problems for the team and DCS that would require a lot more work, hence the reluctance to enable it.

 

As mentioned I have brought it up with the team again, but can make no promises.

 

thanks

smallCATPILOT.PNG.04bbece1b27ff1b2c193b174ec410fc0.PNG

Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status

Windows 10 Pro x64, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 32GB DDR @3000, ASUS ROG Strix Z490-F Gaming, HP Reverb G2

Link to comment
Share on other sites

The stage we are at with this is that if it was to be implemented it could create more problems for the team and DCS that would require a lot more work, hence the reluctance to enable it.

Oh, I surely hope it's not an easy fix. Otherwise six years would really be a long time ;)

 

As mentioned I have brought it up with the team again, but can make no promises.

And I am very grateful that you did that again. This is not to blame the messenger and all in good faith. Similar to Grimes, I had already given up on this ever being fixed. It's something we can work around, but the workaround is not working rigorously due to another DCS bug affecting multicrew aircraft. So for those, we are currently in a situation where even the workaround of the bug is broken. And that is the point where working around stuff is simply getting "a bit" too much.

A warrior's mission is to foster the success of others.

i7-8700K | Asus RTX 2080Ti Strix OC | 32 GB Ram 3200 MHz DDR-4 | Asus Maximus Hero X | Samung EVO 960 Pro SSD | VKB Gunfighter Pro | MFG Crosswind | Rift S

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

I will ask the team about it, but can not make any promises.

 

thanks

 

Hi BiG!

 

I know I sometimes ask some silly questions on Discord. But in my flight group we have a dynamic campaign that is continuous over time with a socio-economic environment. It is insane and very popular, it requires a lot of tactics and strategies. But just these functions trigger Player events to save to tables and doing it with Birth is very annoying. I understand that the team is working on things of greater importance, but I think it can even solve a lot of problems for them in the development of their dynamic campaign.

 

I hope it is solved and thanks for your answer Big!

Link to comment
Share on other sites

If you want to use it more as a slot management then I'd recommend using the gameGUI API. If its more for combined arms and knowing which vehicles players are in then you are pretty much out of luck unless this and another bug get attention.

 

A tiny bit of background for why it might not be fixed. It is considered a "local" event that is used to send an event to the debriefing/logbook code for each player. For example the following is a section of what is added to the debrief.log for the server and a client in the same test.

 

Server:

[2] = 
{
	t	=	30611.734,
	type	=	"birth",
	initiatorMissionID	=	"2293",
}, -- end of [2]
[3] = 
{
	type	=	"start shooting",
	weapon	=	"KPVT",
	target	=	"A-10A",
	t	=	30621.811,
	initiatorMissionID	=	"2296",
	targetMissionID	=	"2293",
}, -- end of [3]

 

 

Client

[213] = 
{
	type	=	"under control",
	initiatorPilotName	=	"New callsign",
	target	=	"Aerial-1-1",
	t	=	30610.641,
	targetMissionID	=	"2293",
}, -- end of [213]
[214] = 
{
	t	=	30610.641,
	type	=	"engine startup",
	initiatorMissionID	=	"2293",
}, -- end of [214]
[215] = 
{
	t	=	30610.641,
	type	=	"birth",
	initiatorMissionID	=	"2293",
}, -- end of [215]
[216] = 
{
	type	=	"start shooting",
	weapon	=	"KPVT",
	target	=	"A-10A",
	t	=	30621.846,
	initiatorMissionID	=	"2296",
	targetMissionID	=	"2293",
}, -- end of [216]

 

Worth noting the timings don't match perfectly. Could be any combination of testing locally on the same PC and the server had slmod running which hijacks the events a bit which could delay it.

 

Aside for the timing there are two main differences.

1. The client has different events for when they spawn, it has the under control (which is enter_unit) and engine startup. Where-as the server just sees the birth event.

 

2. Client also has a bunch of birth events that occur while connecting for every unit in the mission. Hence for the server the player spawning occurs at event 2 while for the client it was 213.

 

There is also a bug related to "leave_unit" event where the event occurs on the server whenever someone just selects different slots in the MP ui. You don't even need to have spawned into a unit for that event to occur.

The right man in the wrong place makes all the difference in the world.

Current Projects: Scripting Wiki, Something...

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread), SLMOD, IADScript, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Thanks a lot for the help Grimes!

 

Long ago I really didn't know anything about scripts

 

A few years later I have my own dynamic campaign with many very cool features that DCS would really miss.

 

It is a real war conflict where a lot of COMBINED ARS is used (ED don't forget that you did it and there are many loose things there too) a lot of strategy involved, taking into account the available weapons, the economic budget of each coalition, costs of unit maintenance, buying / selling and much more.

 

Completely persistent over time and does not require a 24 hour server. You just run one day and you can continue another day.

 

The only insoluble thing is that the client airplanes that remain in other bases at the end of the day have to be touched by hand. The rest is all automated.

 

The stock system of each airbase of the mission editor is very funny. If you put a client aircraft, then it takes off from that base, the stock goes to 0, it lands in another base, add the stock to that base but ... then the client cannot leave any of them because they have nowhere to do SPAWN ... And for the number of players we have in the group, which are more than 20 per session, they do not reach the parking lots since if you put too many they start already on ... well.

 

Things that remain in time and are never solved ... we will see how they solve it with their own dynamic campaign.

 

I hope one day they solve these things that are totally meaningless!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...