Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Using Plant Maps

Author
Message
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 1st Aug 2006 21:42 Edited at: 1st Aug 2006 21:44
Following is the better and easier to use version which i posted in DBPro forum. You will find it useful believe me.

USE ATTACHED MEDIA



Notes:
Any 64x64 map will do which has green colors, in this case green(255) is the color for grass.
you can easily add more colors for different items and make up a full eco-system like VUE5 has in no time.
It doesnt have to be plain objects, it can be any 3d object with a little tweaking of the code.

Play with this value vegetationUpdate(400) like 100 or 500 to see what effect it does.

Change the height value in here vegetationCreate("1", oTerrain, 100, 32, 255, 0, 1) to 20 or 150 to see what effect it does.

I ask for full credits and an e-mail notification to tamer(@)eskisehirli.net (without ()) if any part of the code is used.

Attachments

Login to view attachments
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 2nd Aug 2006 02:18
um. i get "cannot load image at line 115" . -.-'. i have alll the media set up in the right spot. please check your code

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 2nd Aug 2006 10:07
you have to make a new project, and paste the above code.
Then you have to unzip the attachment into the project folder.
so your folder could contain these files:
1- your project file.dbpro
2- your project file.dba
3- the compiled exe.(after you compile it)
4- a folder called "1"

Folder "1" should contain these:
1- a folder called grass
2- color.bmp
3- detail.tga
4- height.bmp
5- plant.bmp
Marvey
22
Years of Service
User Offline
Joined: 15th Oct 2002
Location:
Posted: 2nd Aug 2006 16:20
variable "random" name is not valid at line 49
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 2nd Aug 2006 16:46
Following is the better and easier to use version which i posted in DBPro forum. You will find it useful believe me.

USE ATTACHED MEDIA



Notes:
Any 64x64 map will do which has green colors, in this case green(255) is the color for grass.
you can easily add more colors for different items and make up a full eco-system like VUE5 has in no time.
It doesnt have to be plain objects, it can be any 3d object with a little tweaking of the code.

Play with this value vegetationUpdate(400) like 100 or 500 to see what effect it does.

Change the height value in here vegetationCreate(\"1\", oTerrain, 100, 32, 255, 0, 1) to 20 or 150 to see what effect it does.

EDIT: CODE UPDATE
This is how you will add WIND to your grass without any loss of FPS.(maybe 1 or 2 fps though depends on your hardware)


I ask for full credits and an e-mail notification to tamer(@)eskisehirli.net (without ()) if any part of the code is used.
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 2nd Aug 2006 16:48
Marvey:
You need upgrade u6.2b

but if you still get the same error, just change the random variable into somethin like "randomm" you have to change 2 of them both in the beinning of the function and in the middle of the function.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 3rd Aug 2006 16:01
It doesn't like it when you use a "/" outside of a string. Why do people do this?!

CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 3rd Aug 2006 19:15
uhmm..its a forum bug, people dont put those "/" on purpose there.
Wolf Dreamer
19
Years of Service
User Offline
Joined: 13th Sep 2005
Location: the land of chaotic dreams
Posted: 9th Aug 2006 22:16 Edited at: 9th Aug 2006 22:20
After erasing the many / and then a few [b][/b] even, it ran.

Unfortunately the world is upside down. I see it there, but the grass grows downward.

Odd bug.

Is everything rightside up for everyone else?

---edit---
I ran it again and everything was fine. Weird.

The wind effect is cool. Just needs differant timing perhaps. Having them all move back and forth like that, all at once, looks more like dancing of a hynotic bowing cult, waving back and forth like that.

Maybe if it was just in one direction, instead of back and forth, unless the wind changed direction. Or just have it move as you rush by might be a cool effect to have.

The last sane human being in a world gone mad.
If you were a cockroach, what type of cockroach would you be?
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 10th Aug 2006 01:07
Please attach the code next time into the archive

But it's really great - nice job dude.

sadsack
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 10th Aug 2006 02:54 Edited at: 10th Aug 2006 02:55
I must not have a dll i need. it say can not read this:
oTerrain = terrainCreate("1", 2.0, 0.0, 0.0, 0.0)
entomophobiac
22
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 13th Aug 2006 09:30
Interesting stuff, most definitely. Saves the level designer a lot of work, I suppose.
CuCuMBeR
21
Years of Service
User Offline
Joined: 11th Jan 2003
Location: Turkey
Posted: 15th Aug 2006 17:59
Sadsack: you only need "advanced terrain.dll" and its already a part of the original dbpro.. so it should work.
Probably you have not deleted the "/" which the buggy forum puts randomly around.
Alquerian
18
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 15th Aug 2006 21:09
Really well done CuCuMBeR, the wind was a nice touch. I have been working on something similar, I appreciate the post.

"We are what we repeatedly do. Excellence, therefore, is not an act, but a habit." - Aristotle

Login to post a reply

Server time is: 2024-11-23 03:38:49
Your offset time is: 2024-11-23 03:38:49