Jump to content

Known Scripting Engine Issues


Grimes

Recommended Posts

another function doesn't work or better returns always the same

SceneryObject.getDescByName()

 

it returns every object to be a building!

 

I'd suspect anything reported on 1.5.3 for terrain related scripting functions will be rendered moot due to the process of updating it for 2.0.

 

Every time i try something, it is not working due to bugs in DCS 1.5.

 

When are these things going to be fixed. Now i am developing workaround after workaround to get the sim do what i want it to do ...

Sorry to express my frustration a bit here. I know DCS is doing a great job, but the scripting is always the last to be fixed and tuned when new releases come.

 

I share your frustration. Not sure what else I can do to try and get any of these fixed. It seems my hands are tied. :cry:

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

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Hi Grimes,

 

From a distance, there seems to be a problem with the getCategory() functionality of a Unit. :poster_oops:

 

Try the attached mission. It shoots off a trigger that displays 4 messages, enquiring for each message the category of a Vehicle, Plane, Helicopter and Ship...

 

The function used is:

Unit.getByName( "<Unit Name>"):getCategory()

 

The getCategory() function always returns 1.

Is this correct behaviour or is there a problem with this function?

 

Note: As a workaround, i am using the getDesc() function of a unit. The returned descriptor table contains a field [category] with a correct category in it (but not matching the Unit.Category table ...)

 

Sven

2016-02-27 - DCS 1.5.3 - getCoalition returns wrong values.miz


Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Yes that is normal. It is a little confusing because there is a Unit.Category enum and an Object.Category enum. The function Unit.getCategory() is inheriting the Object level function, in which case the category returned is "Unit" as opposed to weapons, static objects etc. You can use the Group.getCategory() function to return the groups actual category type or use your method. I should probably update teh wiki page on it to make it more clear.

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

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Thanks Grimes for the explanation, that helps ...

 

A few notes though ... The Group Category function is of no use to me at the moment, as Group functions return nothing in multi player for Clients in DCS 1.5.3 (the famous bug). The getDesc() function or method on a Unit however works very well, but not sure about performance.

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

@Grimes, allow me to say that the wiki pages and documentation you created of the DCS scripting function library is excellent and you've put a lot of work in it.

 

I've been actively referencing and using your library to understand the available functions. A few things can be improved but in general these pages are a great work.

 

 

 

Sven

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

I'd suspect anything reported on 1.5.3 for terrain related scripting functions will be rendered moot due to the process of updating it for 2.0.

 

I share your frustration. Not sure what else I can do to try and get any of these fixed. It seems my hands are tied. :cry:

 

Dear Grimes,

 

don't wory about that. If you are not be able to push this malefunction up in the Debuglist who else?

 

So, if you ain't and ED doesn't care, how does ED belive that I will buy any further modules??? :mad:

 

Sadly but unfortunatly true... :music_whistling:

 

 

Only to point it out! ED and guys like you made a hell of a Job with the actual DCSW. But as an supervisor in an Aircraft Maintenance and Repair Org we would say this is an AOG....."Aircraft on Ground" :D

 

Cheers

My Rig: Windows 11 Pro, Intel i7-13700k@5.4GHz, 64GB DDR5 5200 RAM, Gigabyte Z790 AORUS Elite AX, 1TB Samsung EVO 970, RTX4080, Thrustmaster HOTAS WARTHOG + Saitek Pro Flight Pedals, LG 32" 4K 60FPS, ACER 30" 4K 60FPS GSync Display, HP Reverb G2 V2

Link to comment
Share on other sites

Yes that is normal. It is a little confusing because there is a Unit.Category enum and an Object.Category enum. The function Unit.getCategory() is inheriting the Object level function, in which case the category returned is "Unit" as opposed to weapons, static objects etc. You can use the Group.getCategory() function to return the groups actual category type or use your method. I should probably update teh wiki page on it to make it more clear.

 

This solves one of my issues with EWRS. Thanks!!!

-16AGR- 16th Air Guards Regiment is always looking for pilots - http://www.16agr.com

 

EWRS - Early Warning Radar Script

 

Specs:

 

 

Gigabyte Sniper Z5-S

Intel i5-4670k 3.4GHz OC'd 3.9GHz w/ Thermaltake 120mm Water 3.0 Pro Liquid CPU Cooler

16GB RAM

Gigabyte GTX 1080

TM Hotas Warthog: SN: 06976

Saitek Pro Flight Combat Rudder Pedals

TrackIR5 with TrackClipPro & Oculus Rift

2x 28" 4k UHD Monitors (3840x2160 each) + 1280x1024

 

 

Link to comment
Share on other sites

getPlayerName() on unit

 

In the intiaial change log of 1.5.0 ( http://forums.eagle.ru/showthread.php?t=147601 ), it was said that:

 

Unit.getPlayerName() is now functional on ground units and will return a player’s name if they are directly controlling the unit via Combined Arms.

 

Well, it seems that this function is not working in 1.5.3 in a multi player environment. I have created a nice scoring algorithm, but it seems the unit:getPlayerName() function does not return anything in a multi player environment.

 

Anybody who can confirm that?

 

Sven

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

I think it doesn't at this moment.

 

See attached a scoring table created ... All the units that are of type ground unit, have the playername blank ...

 

 

Sven

Player_Scores_2016-03-01_20-19-32.zip


Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Well it was working at one point.

Well, does that to be meant as "everything is subject to change"?

 

Sorry just joking....

My Rig: Windows 11 Pro, Intel i7-13700k@5.4GHz, 64GB DDR5 5200 RAM, Gigabyte Z790 AORUS Elite AX, 1TB Samsung EVO 970, RTX4080, Thrustmaster HOTAS WARTHOG + Saitek Pro Flight Pedals, LG 32" 4K 60FPS, ACER 30" 4K 60FPS GSync Display, HP Reverb G2 V2

Link to comment
Share on other sites

  • 3 weeks later...

24826 - Dynamically spawned AI do not display properly in debrief, logbook. (To test new MP interface and messages)

 

Could this be the reason dynamically spawned infantry (CTLD) not appearing in

mist.makeUnitTable({"[blue][vehicle]"})

and

[color=#2C2D30][font=Slack-Lato]mist.DBs.aliveUnits[/font][/color]

I can still force the table to update using a "manual" PLAYER LEAVE UNIT event though.

Also i noticed the birth events for the spawning infantries is there, but it has a time tag of 0 (10 mins into the mission). Can that be causing the DCS database to ignore these events?


Edited by stinkx
Link to comment
Share on other sites

Yes that is normal. It is a little confusing because there is a Unit.Category enum and an Object.Category enum. The function Unit.getCategory() is inheriting the Object level function, in which case the category returned is "Unit" as opposed to weapons, static objects etc. You can use the Group.getCategory() function to return the groups actual category type or use your method. I should probably update teh wiki page on it to make it more clear.

 

The Problem with the Group.getCategory() function is groups are (still) not accessible for MP-Clients... I'll use the getDesc() workaround I found in this thread instead. Lost a couple of hours dev-time through this problem. Glad I finally get it sorted.

Link to comment
Share on other sites

pfff. This problem with the Clients bug in multiplayer is eating me... Dealing with a workaround logic makes things way more complex to get a mission working as it should... We are almost end of March now, and still there is no fix, not even a communication for a fix.

 

I understand it is exciting for DCS to show new modules and to do bug fixes on modules, but if their core engine is not working as it should, at least they could communicate that there is a problem and a view on when it would be fixed. But there is no communication, nothing... This for the last 3 months now.

 

How is it possible.

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

What else can I say other than its is reported and the timeframe for fixing it is out of my hands? For a more detailed answer for why it isn't fixed you have to go up to someone on the ED team.

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

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Link to comment
Share on other sites

Hi Grimes, you may have misunderstood.

The comment was not meant to make critic on your reporting.

 

Who would you suggest to contact from the ED team?

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

  • 2 weeks later...

Had a short chat with Chizh concerning the client bug. He confirmed the bug and said they will go for a fix.

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

Hello all,

 

The underlying DCS lua function does not seem to work in 1.5.3. Anybody having the same issues with this function?

 

function boolean detected, boolean visible, ModelTime lastTime, boolean type, boolean distance, Vec3 lastPos, Vec3 lastVel, Controller.isTargetDetected(Controller self, Object target, [Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN] or nil)
The function does not crash, but it always returns false, no matter what object or what detection type i try to execute it with.

 

Note that before i execute this function, i have executed the underlying function, which returns me the detected targets:

 

function array DetectedTargets Controller.getDetectedTargets(Controller self, [Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN] or nil)
anybody can help on this? Or, is there definitely a bug in DCS 1.5.3 with this function? If yes, we should report it to DCS dev team.

 

kind regards,

FC

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

  • 4 weeks later...

Sorry, I cannot help with that function. I just experienced unexpeted results with the "Controller.isTargetDetected" function.

 

I currently have an issue with a script, which is supposed to revome a group with

 

group:destroy()

 

function.

 

I am not quite sure, but I think a server crash is related to this. In singleplayer I have no issues with the script, but on a servermachine, it seems to cause a crash. The group in this case is a client in MP. Might this be related to the client-groups not being accessible, or should this function still work in MP?

 

Here is the complete function I use to remove client groups, in case the join an A/C which type is currently not available...

 

function removeAC(unitnametoremove)

local currentaircraftunitname = unitnametoremove
if Unit.getByName(currentaircraftunitname) == nil
then
	return
else

	local currentaircraftunit = Unit.getByName(currentaircraftunitname)
	if Unit.getGroup(currentaircraftunit) == nil
	then
		return
	else
		local currentplayergroup = Unit.getGroup(currentaircraftunit)

		currentplayergroup:destroy()
	end
end

end


Edited by SNAFU

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Link to comment
Share on other sites

Could this be the reason dynamically spawned infantry (CTLD) not appearing in
[color=#2c2d30][font=Slack-Lato]mist.DBs.aliveUnits[/font][/color]

 

Is this confirmed?

 

cause I'm trying as hard as possibile to make DAWS Save Mission to work with spawned units but I need to rely on mist DBs to be successfull.

 

If so, I might halt developing that part and focus on other areas of improvement...

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Gents. When I was testing the Respawn function in the moose framework, I got a crash after the last dcs version update. Suddenly a function that used to work did not work anymore... The original logic was that the respawn function would just execute a coalition.addGroup() without checking if there was already a group with the same name alive or not. When there was already a group, dcs would nicely replace the group with the new spawned group. But after the dcs update, the coalition.addGroup() call would crash. I had to specifically write a logic to destroy the existing group first.

 

 

 

Note that when you destroy a group with group:destroy(), there is no crash event generated, neither a dead event... This explains why the alive units DB of mist might not be updated.

 

 

 

You need to generate those events yourself after the destroy. When I get home I will show you how to do that...

 

 

 

Hope this hints towards a solution for you.

 

 

 

Sven


Edited by FlightControl

[TABLE][sIGPIC][/sIGPIC]|

[/TABLE]

Link to comment
Share on other sites

I might better modify the script to check which unit in the spawned Group is still alive at the moment I save the mission status. Anyway I'm looking forward to see your solution :)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Sorry, I cannot help with that function. I just experienced unexpeted results with the "Controller.isTargetDetected" function.

 

I currently have an issue with a script, which is supposed to revome a group with

 

group:destroy()

 

function.

 

I am not quite sure, but I think a server crash is related to this. In singleplayer I have no issues with the script, but on a servermachine, it seems to cause a crash. The group in this case is a client in MP. Might this be related to the client-groups not being accessible, or should this function still work in MP?

 

Here is the complete function I use to remove client groups, in case the join an A/C which type is currently not available...

 

I ran into a very similar issue. I wrote this bit of code to test it:

local unit = 'Test'
unit = Unit.getByName(unit)
trigger.action.outText(unit:getPlayerName(), 100)
local group = unit:getGroup()
trigger.action.outText('GroupID: ' .. tostring(group:getID()), 100)

 

It works fine if run through the ME or as Host in MP, but if a Client is in the slot, it will crash with:

00127.560 ERROR DCS: Mission script error: : [string "local unit = 'Test'..."]:5: Group doesn't exist

 

Is it this bug?

 

 

 

31682 - Client groups not accessible in multiplayer. Units are still accessible, workarounds exist

what is the workaround?


Edited by St3v3f

aka: Baron

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

I ran into a very similar issue. I wrote this bit of code to test it:

local unit = 'Test'
unit = Unit.getByName(unit)
trigger.action.outText(unit:getPlayerName(), 100)
local group = unit:getGroup()
trigger.action.outText('GroupID: ' .. tostring(group:getID()), 100)

 

It works fine if run through the ME or as Host in MP, but if a Client is in the slot, it will crash with:

00127.560 ERROR DCS: Mission script error: : [string "local unit = 'Test'..."]:5: Group doesn't exist

 

Is it this bug?

 

 

what is the workaround?

 

.getPlayerName() and .getID() is not working for clients in MP as far as I experienced. It worked in 1.2.X but not anymore in 1.5.X

 

I am afraid group:destroy() doesn´t work anymore too for clients in MP and it seems you have the same experience. Would be great to have a list which functions do not work under which circumstances, sinde the getGroup() bug seems to cause further issues in MP.

 

There is a workaround function for the getID() issue further up in this thread or you find it in the CTLD script, but I am not aware of other workaround to getPlayerName() or :destroy().

[sIGPIC][/sIGPIC]

 

Unsere Facebook-Seite

Link to comment
Share on other sites

  • Recently Browsing   0 members

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