Jump to content

Compound Entity


Flexman
 Share

Recommended Posts

In our project we're currently creating city blocks and rural compounds, as there are lots of these compounds dotted around the landscape I tried making a 'template' by building one in the editor (at the origin), removed the terrain, default lights, environment. Saved it as a scene, "template_compound_01.sbx".

 

 

Using the old "info_playerstart" entity as a startpoint, called it "Compound01" ,I gave it an icon and used the following short LUA script...

require("scripts/class")

local class=CreateClass(...)


function class:CreateObject(model)

local object=self.super:CreateObject(model)

object.scene = LoadScene("abstract::template_compound_01.sbx")
if object.scene~=nil then
  object.scene:SetParent(object.model);
end

end

 

Restarted the editor (to refresh the abstract file system and the object browser) and dragged "Compound01" into the scene it worked perfectly. Dragging all the buildings and walls around. Makes dressing complex maps a bit easier. Quite fitting that it's called a compound entity.

 

I wondered if there might be any problems using this? Or benefit to adding an AABB box for Octree culling? Entities in SBX files have IDs, is there any chance or issue around duplicated IDs from using this method?

 

*** EDIT ***

Well I found one problem, it doesn't work in a compiled BMX program, crashes at LoadScene.bmx line 417 in the engine source.

Edited by Flexman

6600 2.4G / GTX 460 280.26 / 4GB Windows 7

Author: GROME Terrain Modeling for Unity, UDK, Ogre3D from PackT

Tricubic Studios Ltd. ~ Combat Helo

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...