Entity scenenode (aka the do-nothing-SceneNode )

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
bull
Posts: 36
Joined: Wed Sep 12, 2007 8:49 am
Location: s1Ng4p0R3

Entity scenenode (aka the do-nothing-SceneNode )

Post by bull »

I love IrrEdit, and I know many of you also. But one thing I hate about it is that I can't add a custom attribute(monster's hp, game object class ...) . To a game ,such informations mean much more than the scene node itself. I tried to solve the problem by jamming informations into the node name but it's too inconvenient. So I created a scene node and a plugin to solve this problem:

Screen shot: What's the point? My scene node doesn't even render itself,duh!!

Small update:
-Fix a very stupid bug in iteration.
-Since the scene node is only seen in design-time, not run-time, it now draws its bounding box.
-Removed the "constructor parameter"
New link: http://www.zshare.net/download/54562497f9bc0f/

Old link: http://www.zshare.net/download/4070918ea3f5d0/

The zip file contained source code and the plugin.

Installation and usage:

Copy the EntitySceneNode.dll into the plugins folder of irredit and the scenenode_entitySceneNode.bmp into the resource folder.

When you start irredit. You will see a blank space in the plugin toolbar. That's my custom sceneNode. Click it and a scene node is created.
In the node specific section there are these fields:

PropertyCount: accept number only. This is the number of the custom properties.

Property1
Property2
Property3
....
Propertyn: custom string, the number of them depends on PropertyCount.

Remarks:
Since the scene node is invisible, i suggest you should make it the child of another node.

This scene node supports cloning

That's all for the plugin.

About the scene node:
It has 2 methods:

Code: Select all

const s32 getPropertyCount(); //return the number of property
const c8* getProperty(s32 propertyNumber) const;//return the (n+1)-th property (the first is 0)
That's it. Now you can use IrrEdit as a level editor.Your game will then load the .irr file, run through the scene graph, catchs the entity scene node, get its properties, create your logic objects and game on!!

One more thing: credit is appreciated. Please don't change the button icon, i love it. The scene node does nothing and it will be used in my game engine(called Illusion3d) so it deserves nothingness :wink:
Last edited by bull on Sat Dec 08, 2007 2:00 am, edited 1 time in total.
fmx

Post by fmx »

lol, cool nothingness...

this is great!
now IrrEdit can be used to add things like spawn-points, which usually have to be done manually, or in a custom editor.

thanks bull!

:D
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

I can't seem to see the use of your scene node. How would it be useful?
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

MasterGod wrote:I can't seem to see the use of your scene node. How would it be useful?
It sounds like it can be used in-game to set triggers, things that will be like logic for the game (spawn here, gain health here, reload here, open door here, etc.).

Very nice work!
FlyingIsFun1217
bull
Posts: 36
Joined: Wed Sep 12, 2007 8:49 am
Location: s1Ng4p0R3

Post by bull »

I can't seem to see the use of your scene node. How would it be useful?
It is used to attach game specific information to a scene node in IrrEdit.

Imagine you are using irredit to create a level for a rpg game. There is a box with some items inside. Where will you store those informations? A mesh scene node only gives you id and name to edit. You can not write all items' names in the name field or the id field.
You can write them to a file and set the node's name to the path of the file but you will get confused when there are more and more boxes in your level. You will also have to alt-tab between irredit and the text/xml editor.

Or you can just add my scene node as the child of the box and set it's properties to the items' name inside the box.
It sounds like it can be used in-game to set triggers, things that will be like logic for the game (spawn here, gain health here, reload here, open door here, etc.).
Actually, it is supposed to be used in design time with irredit or your custom editor, not run time.
My name is bull, for we are many ...
neoIxen
Posts: 13
Joined: Fri Mar 16, 2007 3:39 pm

Post by neoIxen »

Nice!

I also wanted to create something like this but a bit more complex like in the quake-engine's entities.
There you have a name for every property like "target" and a value like "door". The engine then knows if you trigger that entity the target "door" is activated or rather opened.

So my node would have two arrays
One for the property's name and one for it's value.
imo that's much more flexible.

But your's has also it's advantages ;)
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

@bull && FlyingIsFun1217: This is very interesting, so you say it can be used as a property (by text) for every scene node?

:idea:
Maybe like neoIxen said, add the functionality to add more then just Title properties :roll:

PS: Is it v1.4 compatible?
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Excellent work! This looks thoroughly useful. Thanks for sharing.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
TheGameMaker
Posts: 275
Joined: Fri May 12, 2006 6:37 pm
Location: Germany

Post by TheGameMaker »

Great Work!!
I always wanted to do something like this!! No you've done it!
THX
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

interesting. it could be useful. thanks.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Thanks Bull, this will be very useful.
Post Reply