HomePortalFAQSearchMemberlistUsergroupsRegisterLog in
Making threads to link to banned members content grants an automatic ban
Meet the new KITO admins & hear their plans here.
You can use google search to find threads and posts here now. Example

Share | 
 

 Trees.cfg question - Make it rest slightly below the terrain rather than on it?

View previous topic View next topic Go down 
AuthorMessage
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 21
Location : Australia

PostSubject: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Tue Nov 24, 2015 9:26 am

Hey

How do I go about making the objects in a MapNameTrees.cfg file rest just below the terrain rather than on it? Usually it doesn't matter, but on hills and such part of the trunk of trees appears to be floating so I want to make it so the tree goes... say -10Y from the terrain.

I'm assuming it's something in the compile however I'm no coder and have no idea how to change it from checking the terrain height and going with that, and checking the terrain height and going 10 below it, anyone point me in the right direction please?
Back to top Go down
Hamilton

avatar

Game username : Hamilton
Server : Myatar Legends // Dragon's Den
Female Posts : 355
Join date : 2011-10-20
Age : 31
Location : everywhere

PostSubject: Re: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Tue Nov 24, 2015 5:04 pm

One method would be to use the FloatingObjects files instead and put the height in manually. (same with using the [object] code in the world file)

Or (and i'm not entirely sure if this is a lazy method or not...it was for me lol) you could re-import the models in blender and use the edit function to physically lower the entire mesh (or just those specific vertices, doesn't matter) so that the bottom of the mesh is a considerable amount lower than the grid floor. extend it far enough down and it won't matter how steep the hill is (unless it's a cliff....). lol
Back to top Go down
Hyper
Admin
avatar

Game username : Hyper
Server : Azoptaos
Male Posts : 455
Join date : 2014-02-09
Age : 19

PostSubject: Re: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Tue Nov 24, 2015 9:48 pm

haven't tested it, but looks like it may be these in MagixWorld

Code:
largeTreeLoader->setHeightFunction(&HeightFunction::getTerrainHeight);

Code:
position.y = HeightFunction::getTerrainHeight(position.x, position.z);

or try this under //Positioned trees

Code:
position = Vector3(p.x, 0, p.y);

anything that gets the height/sets a y position under the tree loader is my best guess

________________________________
i can code you things
Back to top Go down
http://azoptaos.boards.net/ Online
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 21
Location : Australia

PostSubject: Re: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Wed Nov 25, 2015 7:38 am

@Hamilton: I was going to try that when I had more time I just thought maybe there was a way to change a code since that was simpler than re-exporting everything.

@Hyper: Yes I was looking around there but, as I said, I'm no coder and have no idea what to add/remove/change in order for it to work.

I will import/export the files I have and try Hammy's idea though, otherwise I'll use FloatingObjects.

Thanks guys Smile
Back to top Go down
lazyzim

™
avatar

Server : Dragon's Den
Male Posts : 719
Join date : 2011-11-27

PostSubject: Re: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Wed Nov 25, 2015 12:08 pm

Sadly my method is to go to each tree/plant/object if I randomly added them with Impressive Gardener and delete the ones in water or on the sides of a hill. Current map I am working on had 6,000 random objects. Currently 4,000 still in the map I have not deleted.
Oh if only we had a map editor.
~LazyZim~
Back to top Go down
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 21
Location : Australia

PostSubject: Re: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Wed Nov 25, 2015 2:09 pm

While that works on flat maps where trees not on hills isn't an issue, a map that has a lot of hills suffers with treeless areas if it is meant to fit a theme.

Everything in this map is hand placed, Impressive Gardener would have them too spaced out and a time waster for the kind of map I am working on.
Back to top Go down
lazyzim

™
avatar

Server : Dragon's Den
Male Posts : 719
Join date : 2011-11-27

PostSubject: Re: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Thu Nov 26, 2015 10:11 am

Quote :
Everything in this map is hand placed, Impressive Gardener would have them too spaced out and a time waster for the kind of map I am working on.

If you are hand placing every item in the map then you can use the world file and that way you can adjust the depth the trees are into the ground.
Back to top Go down
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 21
Location : Australia

PostSubject: Re: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Fri Nov 27, 2015 1:52 pm

The issue with this is I do not want the trees to react with collision in our game (while trunk collision is helpful, branch/leaf collision is not), hence not using .world file. That and I believe using trees.cfg rather than .world enables TreeLoader2D to help with lag. Though, as I have said, I am no coder so I could be wrong.
Back to top Go down
lazyzim

™
avatar

Server : Dragon's Den
Male Posts : 719
Join date : 2011-11-27

PostSubject: Re: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Sat Nov 28, 2015 4:11 am

OH you have collisions. Don't they also work with plants and trees even in the trees.cfg?
This being the reason we have not pursued a collision system.
Back to top Go down
ShadoWolfozo

avatar

Game username : ShadoWolfozo
Server : GROWL: Spirits
Male Posts : 875
Join date : 2012-01-22
Age : 21
Location : Australia

PostSubject: Re: Trees.cfg question - Make it rest slightly below the terrain rather than on it?   Sat Nov 28, 2015 5:53 am

No, the collision system we have only applies to .world objects.

I suppose other systems may affect all .cfg files as well, but ours doesn't. Hence why I am asking about trees.cfg.
Back to top Go down
 
Trees.cfg question - Make it rest slightly below the terrain rather than on it?
View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Keeping I.T. Open :: SUPPORT :: Support-
Jump to: