About Store Forum Documentation Contact
Donations:
364$/mo



Post Reply 
Custom Parameters for a Terrain class object?
Author Message
3DRaddict Offline
Member

Post: #1
Custom Parameters for a Terrain class object?
I've placed a mesh object (no Phys body) in my World. I see that it defaults to a Terrain class when I examine the Param tab for it. I needed to add some custom parameters for this mesh, which I did... using the Param tab. I need some assistance on how to access these parameters in my code.
By examining "Sample 09: Custom Parameters" I've figured out how its done for OBJ_ITEM class objects... but I do not want my mesh object to be an Item (as Items appear to need a Phys body), and my mesh must be able to be placed anywhere in the 3D space (not ground based). I'm finding this very confusing, so some example code would help me greatly, please.
05-04-2015 06:26 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Custom Parameters for a Terrain class object?
Hi,

Terrain class is a special case and it does not support custom parameters.

You just need to create a new Object Class OBJ_MY_CLASS or something.
You can base it on Game::Static game object class.
https://github.com/Esenthel/EsenthelEngi...Static.cpp
05-04-2015 07:13 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #3
RE: Custom Parameters for a Terrain class object?
Thanks, Greg... that's now working as I want.

I do have one more query concerning this particular mesh object...
I want to hide this mesh when running the code, but "Game.World.draw()" causes every World object to be drawn. How do I prevent this mesh object from being drawn?
I think it might be something to do with "SetDrawMask()", but I'm not too sure how to use it in this context.
05-04-2015 09:35 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Pherael Offline
Silver Supporter

Post: #4
RE: Custom Parameters for a Terrain class object?
I think the best way would be create your own class inherit from Game.Static and then overwite drawPrepare() and drawShadow() funtions.

SetDrawMask() is used when you want draw only a part of mesh. You need first set draws group in "Groups" tab in Object Editor. There is tutorial how to use it 13-Mesh/Mesh Part Draws Groups
(This post was last modified: 05-04-2015 09:49 AM by Pherael.)
05-04-2015 09:47 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: Custom Parameters for a Terrain class object?
Yes overriding draw methods is the way to go.
Then you can use SetDrawMask, but that's only for certain parts, if you don't want to draw the object at all, then just don't call super.draw*
05-04-2015 10:08 AM
Find all posts by this user Quote this message in a reply
3DRaddict Offline
Member

Post: #6
RE: Custom Parameters for a Terrain class object?
Just watched an excellent set of video tutorials (here) on Esenthel Game Objects by an Aussie called ScarletThread. These clear up a number of questions I had on the coding of custom Game Objects and their Parameters (which can be very mind-boggling at a first glance). I thoroughly recommend watching them if you have reached this stage as an Esenthel noobie!
05-04-2015 04:08 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Pixel Perfect Offline
Member

Post: #7
RE: Custom Parameters for a Terrain class object?
I couldn't agree more! Scarlet's video were a major source of inspiration and information in my early days with Esenthel. He did a first class job with those.
05-05-2015 02:25 PM
Find all posts by this user Quote this message in a reply
Post Reply