Jump to content

Recommended Posts

Posted

The VA server has been using the CTTS v1.04 script to spawn and use cargo. Up until version 1.2.12, it has been working well. Now, the server crashes when the client goes to return the cargo to the field (cargo already loaded, uses radio item again to remove cargo from aircraft and place it in the world).

 

I have narrowed cause of the crash down to this function:

 

 

function NewStructure(angle, radius, xCenter, yCenter, groupside, loadedItem)
local name = "LogCargoItem" .. logcargoCounter

local objtype = logisticItemModel

if loadedItem ~= nil then	-- check if spawn item was an existing one
	for i=1,#DroppedObjects do
		if DroppedObjects[i] == loadedItem then
			name = loadedItem
		end
	end
end

   local xofs = math.cos(angle) * radius
   local yofs = math.sin(angle) * radius

   local static = {
       ["type"] = objtype,
       ["unitId"] = logcargoCounter,
       ["y"] = yCenter + yofs,
       ["x"] = xCenter + xofs,
	["mass"] = 450,
       ["name"] = name,
       ["category"] = "Cargos",
	["canCargo"] = true,		
       ["heading"] = angle,
   }

-- adds new object to the list of dropped objects
if CheckInTable (DroppedObjects, name) == false then
	table.insert(DroppedObjects, name)
end
   
   logcargoCounter = logcargoCounter + 1  

ConfigObject (static, groupside)
   return static  
end

 

 

 

Appreciate any help in getting this resolved. Thank you,

 

Shahdoh

Posted

Cargo static objects seem to be having some issues with this patch in terms of the scripting engine. I've had an unreliably reproduce crash spawning a cargo object. So if you can post crash logs that would be helpful to see if its similar to the log I had received.

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

  • 2 weeks later...
Posted

Have cargos been moved to a new object category?

 

 
StaticObject.getPosition(StaticObject.getByName(cargoName)).p

previously worked just fine, now I get "Object doesn't exist" lua error.

[sIGPIC][/sIGPIC]

 

Intel Core I7 4820K @4.3 GHz, Asus P9X79 motherboard, 16 GB RAM @ 933 MHz, NVidia GTX 1070 with 8 GB VRAM, Windows 10 Pro

  • Recently Browsing   0 members

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