LATEST VERSION: 1.0.3
KNOWN BUGS
- ...
CHANGELOG
1.0.3:
- You no longer have to add the original object at LoD level 0. (Caused by update 1.0.2)
1.0.2:
- Fixed OC_StartFrom, now works correctly.
- The random crashes in the LoD system are fixed.
1.0.1:
- added OC_StartFrom so you can change the location of the Dark.Occlusion file.
- added OC_ObjectAdded and OC_ObjectLimbAdded to check if an object/limb was added to the system.
- Dark Occlusion now checks if there already is a copy running at startup.
- Bounds are now created correctly if the object was moved before creating.
- msvcp71.dll and msvcr71.dll are included in Editor/Dark Occlusion/.
- OC_End now correctly ends the program and Dark Occlusion.
- All variable names now have OC_VAR in front of them to prevent conflicts with your code or other plugins.
- Updated the examples with correct comments.
- Updated the help files with the new commands.
- Automatic framerate balancing is now off by default.
- Added a default setting for auto balancing the framerate. (Dark Occlusion/Settings.dba)
- OC_ForceObjectVisible now works correctly.
- LoD now keeps updating when an object is forced to be visible with OC_ForceObjectVisible.
- Dark Occlusion now works correctly when objects and limbs are both used.
3DWS Converter
There is a converter available to convert your 3DWS maps so they can be used with Dark Occlusion.
Download:
https://forumfiles.thegamecreators.com/download/2312420
To load your map use the following snippet:
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
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$