Jump to content

MTA Crash after load .col + .txd size


AvatoR

Recommended Posts

Hello, i have this script:

thisTXDfileName = 'primring2.txd'
mapObjectCoords = { -- filename, scale, objectID, posX, posY, posZ, rotX, rotY, rotZ
	{"1road_SUB0", 1, 14405, 119.03326416015625, -8.794629096984863, 4000.2884072959423, 0.0, 0.0, 0.0},
	{"1road_SUB1", 1, 620, 165.66696166992188, 8.17689037322998, 4000.512966156006, 0.0, 0.0, 0.0},
	{"1road_SUB2", 1, 3110, 180.93658447265625, -61.86378479003906, 4003.6350486278534, 0.0, 0.0, 0.0},
	{"1wall_SUB0", 1, 3111, -149.37530517578125, -4.85414981842041, 4003.0458328723907, 0.0, 0.0, 0.0},
}
function loadMap()
	local txd = engineLoadTXD(thisTXDfileName, true)
	outputChatBox("1")
	for i, v in pairs(mapObjectCoords) do
		outputChatBox("2 " .. v[1] .. " " .. v[3])
		engineImportTXD(txd,v[3])
		outputChatBox("2.1")
		local dff = engineLoadDFF(v[1]..'.dff', 0)
		outputChatBox("2.2 " .. tostring(dff))
		engineReplaceModel(dff,v[3])
		outputChatBox("2.3")
		local col = engineLoadCOL(v[1]..'.col', 0)
		outputChatBox("2.4 " .. tostring(col))
		engineReplaceCOL(col,v[3])
		outputChatBox("2.5")
		engineSetModelLODDistance(v[3], 5000)
		outputChatBox("3 " .. v[1])
		-- debPass()

		outputChatBox("4 " .. v[1])
		objMapSpawned[i] = createObject(v[3], v[4],v[5],v[6], v[7],v[8],v[9], false)
		-- setElementStreamable(objMapSpawned[i], true)
		setObjectBreakable(objMapSpawned[i], false)
		setObjectScale(objMapSpawned[i], v[2])
		setElementDimension(objMapSpawned[i], getElementDimension(getLocalPlayer()))
	end
end

Pay attention to outputChatBox functions.
So i loading to server and console outputs like that:

1
2 1road_SUB0 14405
2.1
2.2 userdata: 000216A9
2.3
2.4 userdata: 000216AA
2.5
3 1road_SUB0
4 1road_SUB0
2 1road_SUB1 620
2.1
2.2 userdata: 000216AC
2.3
2.4 userdata: 000216AD
2.5
3 1road_SUB1
4 1road_SUB1
2 1road_SUB2 3110
2.1
2.2 userdata: 000216AF
2.3
2.4 userdata: 000216B0
2.5
3 1road_SUB2
4 1road_SUB2
2 1wall_SUB0 3111
2.1
2.2 userdata: 000216B2
2.3
2.4 userdata: 000216B3


As you can see, the "1wall_SUB0" object collision can be loaded, but engineReplaceCOL() - not working, and immediately MTA crashes without any log in clientscript file.
Crash errors:

game_sa.dll
Code = 0xC0000005
Offset = 0x0003FB33
EAX=00000000 EBX=6B55C6F8 ECX=00000000 EDX=0B8B0901
ESI=37C76438 EDI=78A1BD58 EBP=0177EDCC ESP=0177EDC0
EIP=0B83FB33 FLG=00210203 
CS=0023 DS=002B SS=002B ES=002B FS=0053 GS=002B


The "1wall_SUB0":

spacer.png

Download here: https://drive.google.com/drive/folders/1lnBhoevsK4KOmFrFIaZgf8ViWVaskL-k?usp=sharing

 

And the other problem: size of created file by Migic.TXD is a bit large:

spacer.png

 

Edited by AvatoR
Image links to sources
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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