Hand MTA the IPL index, section index and item index to make LOD implementation possible
This commit is contained in:
parent
93d125ff2d
commit
c11fdadfad
|
@ -99,11 +99,11 @@ function registerObjectNow(id,model,texture,drawDistance)
|
||||||
displayStatus("Loaded model: " ..model.. ", " ..tostring(#objectsToRegister).. " remaining...")
|
displayStatus("Loaded model: " ..model.. ", " ..tostring(#objectsToRegister).. " remaining...")
|
||||||
end
|
end
|
||||||
|
|
||||||
function placeObject(...) -- id,interior,x,y,z,rx,ry,rz,rw,lod
|
function placeObject(...) -- iplIndex,sectionIndex,itemIndex,id,interior,x,y,z,rx,ry,rz,rw,lod
|
||||||
table.insert(objectsToPlace,arg)
|
table.insert(objectsToPlace,arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
function placeObjectNow(id,interior,x,y,z,rx,ry,rz,rw,lod)
|
function placeObjectNow(iplIndex,sectionIndex,itemIndex,id,interior,x,y,z,rx,ry,rz,rw,lod)
|
||||||
if objectRegister[id] == nil then return end
|
if objectRegister[id] == nil then return end
|
||||||
erx,ery,erz = fromQuaternion(rx,ry,rz,rw)
|
erx,ery,erz = fromQuaternion(rx,ry,rz,rw)
|
||||||
obj = createObject(objectRegister[id]["realID"],x,y + 6000,z,erx,ery,erz)
|
obj = createObject(objectRegister[id]["realID"],x,y + 6000,z,erx,ery,erz)
|
||||||
|
|
|
@ -195,6 +195,7 @@ def main():
|
||||||
fileMeta.write('<script src="gta/' +ipl.replace("\\","/")+ '.lua" type="client"/>\n')
|
fileMeta.write('<script src="gta/' +ipl.replace("\\","/")+ '.lua" type="client"/>\n')
|
||||||
|
|
||||||
objectIDs = []
|
objectIDs = []
|
||||||
|
iplIndex = 0
|
||||||
for ipl in data["ipl"]:
|
for ipl in data["ipl"]:
|
||||||
pathIpl = p(pathOut,"gta",ipl.replace("\\",os.path.sep) + ".lua")
|
pathIpl = p(pathOut,"gta",ipl.replace("\\",os.path.sep) + ".lua")
|
||||||
try:
|
try:
|
||||||
|
@ -202,12 +203,17 @@ def main():
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
with open(pathIpl,"w") as fileIpl:
|
with open(pathIpl,"w") as fileIpl:
|
||||||
|
sectionIndex = 0
|
||||||
for section in data["ipl"][ipl]:
|
for section in data["ipl"][ipl]:
|
||||||
|
itemIndex = 0
|
||||||
if section == "inst":
|
if section == "inst":
|
||||||
for element in data["ipl"][ipl][section]:
|
for element in data["ipl"][ipl][section]:
|
||||||
if not element["id"] in objectIDs:
|
if not element["id"] in objectIDs:
|
||||||
objectIDs.append(element["id"])
|
objectIDs.append(element["id"])
|
||||||
fileIpl.write('placeObject(' +element["id"]+ ',' +element["interior"]+ ',' +element["position"][0]+ ',' +element["position"][1]+ ',' +element["position"][2]+ ',' +element["rotation"][0]+ ',' +element["rotation"][1]+ ',' +element["rotation"][2]+ ',' +element["rotation"][3]+ ',' +element["lod"]+ ')\n')
|
fileIpl.write('placeObject(' +str(iplIndex)+ ',' +str(sectionIndex)+ ',' +str(itemIndex)+ ',' +element["id"]+ ',' +element["interior"]+ ',' +element["position"][0]+ ',' +element["position"][1]+ ',' +element["position"][2]+ ',' +element["rotation"][0]+ ',' +element["rotation"][1]+ ',' +element["rotation"][2]+ ',' +element["rotation"][3]+ ',' +element["lod"]+ ')\n')
|
||||||
|
itemIndex += 1
|
||||||
|
sectionIndex += 1
|
||||||
|
iplIndex += 1
|
||||||
|
|
||||||
modelNames = []
|
modelNames = []
|
||||||
textureNames = []
|
textureNames = []
|
||||||
|
|
Loading…
Reference in New Issue