About Store Forum Documentation Contact



Post Reply 
World Editor Object Window Question
Author Message
kfrench16 Offline
Member

Post: #1
World Editor Object Window Question
I am wondering if this is possible in the trial/personal license version of the engine.

I want to create a spawner object to use in the world editor to place copies around an area and set various parameters for each copy. Once in game, the spawner objects are responsible for spawning a mob dynamically from a list set during world creation.

I can spawn a mob dynamically within the dynamic object tutorial. I just spawn a skeleton when I press the M key.

Finally, if this is possible, is there a tutorial/video tutorial on how to add your new object from your new class? I looked over the wiki and what I found there was using the object window to create new objects based on the "pre-isntalled" objects such as items, characters, etc. I am trying to figure out how to add a new choice to that list.

Thanks
04-26-2011 03:16 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #2
RE: World Editor Object Window Question
All (26) tutorials in this folder are the most useful for starting a game: "EsenthelEngineSDK\Tutorials\Source\Advanced\4 - Demos, Game Basics\Game Basics".

A good place for you would be "03 - World with Character". At line 101:

Code:
// create the world
   Game::World.init()
              .setObjType(Statics,OBJ_STATIC)
              .setObjType(Players,OBJ_PLAYER) // please note that here we'll use 'Players' memory container for 'OBJ_PLAYER' objects
              .setObjType(Items  ,OBJ_ITEM  )
              .New("world/sample.world");

OBJ_STATIC, OBJ_PLAYER, and OBJ_ITEM are defined in "Data/Enum/obj_type.enum.h".

Add your own to the file, for instance, OBJ_SPAWNER, assign this to an object in your world, and load them to a custom class.

Code:
// create the world
   Game::World.init()
              .setObjType(Statics,OBJ_STATIC)
              .setObjType(Players,OBJ_PLAYER) // please note that here we'll use 'Players' memory container for 'OBJ_PLAYER' objects
              .setObjType(Items  ,OBJ_ITEM  )
              .setObjType(Spawners, OBJ_SPAWNER) // <== load objects of type OBJ_SPAWNER to Spawners
              .New("world/sample.world");

Have that class spawn mobs whenever they need to.
(This post was last modified: 04-28-2011 08:54 AM by Driklyn.)
04-28-2011 08:49 AM
Find all posts by this user Quote this message in a reply
Post Reply