Jump to content

Recommended Posts

Posted

I've been on hiatus from DCS for a few months (last seen on 1.5) and decided to run up some existing test cases I've built last year to check if any of the scripting engine bugs have been fixed since last year.

 

Looks like it's still the same set of issues as before - so I'm raising awareness on these again:

 

1) Unit:getCategory() still broken (always returning "HELICOPTER")

 

All but 1 test fails

-- test that Unit:getCategory() works
 UT.TestCompare(function() return Unit.getByName("DCSPlane"):getCategory() == Unit.Category.AIRPLANE end) -- fails
 UT.TestCompare(function() return Unit.getByName("DCSGroundUnit"):getCategory() == Unit.Category.GROUND_UNIT end) -- fails
 UT.TestCompare(function() return Unit.getByName("DCSHelo"):getCategory() == Unit.Category.HELICOPTER end) -- pass
 UT.TestCompare(function() return Unit.getByName("DCSStructure"):getCategory() == Unit.Category.STRUCTURE end) -- fails

 

2) Group:getByName doesn't return client slots that are not occupied. It's not possible to manipulate or get a group that is a client slot in mp.

 

-- Client slots should be visible in Group.getByName
 UT.TestCompare(function() return Group.getByName("DCSClientSlot") ~= nil end) -- fails

 

3) coalition.getGroups() doesn't return client slots at all. It's really not possible to get the client slots defined in a mission at all.

if true then
   local found = false
   for i, gp in pairs(coalition.getGroups(2, 0)) do
     if gp:getName() == "DCSClientSlot" then
       found = true
       break
     end
   end
   
   UT.TestCompare(function() return found end) -- fails
 end 

 

4) calling :destroy on cargo object doesn't work in same scope as rest of code. This breaks a lot of behavior in my crate scripts, and allows people to 'unpack' the same dead crate multiple times.

 

-- test that spawning, then calling :destroy() on a cargo object actually kills it
 if true then
   local pos = StaticObject.getByName("DCSCargo"):getPoint()
   local obj = coalition.addStaticObject(country.id.RUSSIA, {
     country = "Russia",
     category = "Cargos",
     x = pos.x,
     y = pos.z,
     type = "ammo_cargo",
     name = "DCSSpawnedCargo",
     mass = 1400,
     canCargo = true
   })
   UT.TestCompare(function() return obj:isExist() end) -- pass
   obj:destroy()
   UT.TestCompare(function() return not obj:isExist() end) -- fails
   UT.TestCompare(function() return obj:getLife() < 1 end) -- fails
 end

 

5) [NEW] calling net.get_player_info(1) returns nil in single player. This used to work in 1.5, returning the local player. Now it returns nil, and only works in MP.

Developer of Kaukasus Insurgency - a customizable Dynamic PvE Campaign with cloud hosting and stats tracking. (Alpha)

 

http://kaukasusinsurgency.com/

  • Recently Browsing   0 members

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