@MrValentine
You should use this for importing the 3DWS map:
import3DWSmap("megamap.dbo", 1) // fileName, object id
These functions should be somewhere at the bottom of your code (not in a loop):
Function import3DWSmap(file$, objID)
obj = objID
load object file$, obj
limbNR = 0
vertexLimit = 500
while limb exist(obj, limbNR)
properties$ = limb name$(obj, limbNR)
objecttype$ = lower$(KeyValue$(properties$, "objecttype", ""))
classname$ = lower$(KeyValue$(properties$, "classname", ""))
if lower$(KeyValue$(properties$, "DarkOcclusion", ""))="true"
lock vertexdata for limb obj, limbNR
vertices = get vertexdata vertex count()
unlock vertexdata
OC_AddObjectLimb(obj, limbNR)
OC_SetObjectLimbStatic(obj, limbNR)
if vertices <= vertexLimit
_obj = 0
repeat : inc _obj : until object exist(_obj)=0
make object from limb _obj, obj, limbNR
OC_SetObjectLimbBounds(obj, limbNR, -_obj)
delete object _obj
else
OC_SetObjectLimbBounds(obj, limbNR, 1)
endif
endif
select objecttype$
case "brush"
endcase
case "bspwalls"
endcase
case "mesh"
endcase
case "entity"
endcase
// etc.
endselect
inc limbNR
endwhile
endFunction obj
function KeyValue$(properties$,findname$,defaultvalue$)
pos = instr$(lower$(properties$), lower$(findname$), 0)
if pos > 0
endPos = instr$(properties$, chr$(13)+chr$(10), pos)
if endPos = 0 then endPos = len(properties$)
value$ = substr$(properties$, pos + len(findname$)+1, endPos - pos + 1)
exitfunction value$
else
exitfunction defaultvalue$
endif
endfunction defaultvalue$
Function instr$(source$, search$, startPosition)
pos = startPosition
if pos < 1 then pos = 1
length = len(source$)
length2 = len(search$)
firstChar$ = left$(search$, 1)
for i=pos to length
m$ = mid$(source$, i)
if m$ = firstChar$
match = 1
for x=1 to length2
if mid$(source$, i+x-1)<>mid$(search$, x)
match = 0
exit
endif
next x
if match = 1
exitfunction i
endif
endif
next i
endFunction 0
Function substr$(source$, startPosition, length)
newString$ = ""
endPosition = startPosition + length
for i=startPosition to endPosition
newString$ = newString$ + mid$(source$, i)
next i
endFunction newString$
@Arbrakan
You can replace the variable name inside the file, remove the conflicting dll or wait for the next update.
@Todeswalzer
No, Dark Occlusion doesn't use Sparky's and it won't conflict in any way
@Everyone
I'm verry busy with school at the moment, so I am not able to spend a lot of time updating Dark Occlusion. I will try to release an update fixing all the illegal variable names and missing plugins before the end of the week. If there are some big bugs I will fix them, but for the rest I won't do much for the next 2-4 weeks.