Grass - House Blend

Posted By: nifty

Grass - House Blend - 06/17/06 21:57

You're probably asking "why make another grass script?" Well, I couldn't find one that addressed all of my needs. So, I made this one. It took me over a week to accomplish, and I am happy with it. Since there may be others that need it, I thought I'd share it. The features in this one include:
*Grass on an MDL terrain.
*Grass on hilly terrain.
*Grass only plants on terrain, and not on top of other objects.
*Grass created automatically on level start. No need to model in WED.
*Use a colormap to define where grass can/cannot be planted.
*You can tweak the script a little to improve framerate performance.
*The grass fades in smoothly. No pop ups.

The limitations are:
*Works with only 1 terrain. You have to reprogram if for multi terrains.
*Not tested with HMPs. I've never used HMPs before.

Info from the script:
//GRASS SCRIPT - HOUSE BLEND. Works with A6.40.5 and above.
//This is a script for placing grass models on an MDL terrain. It has not been tested on an HMP.
//It only works with a single terrain. You must modify the script if using multiple terrains.
//The MDL terrain uses JCL's multitexture shader from the wiki.
//A color map is used to specify the areas where grass can/cannot be placed.
//This script was created by nifty, using many different scripts and resources from 3DGS community, thus the
//term house blend. I have added some secret ingredients of my own
//to make it a complete solution for most projects.
//The author wishes to thank the following people for their contributions:
//JCL, Matt Aufderheide, Loopix, Sourcerer, Lolek, and George. Long live AUM!
//You may use this script in commercial games without restrictions.

Instructions are in the grass.wdl file.

DOWNLOAD

SCREENSHOT:
Note - The white box is to show that the grass will not plant on top of other objects.

Posted By: Nicolas_B

Re: Grass - House Blend - 06/18/06 05:23

Wow. Its very nice. Good lod.
Thanks for the good Contribut.

GG Nicolas
Posted By: DEX

Re: Grass - House Blend - 06/18/06 05:29

Demo looks great. Could you make it to work for HMP terrains? I could send you one terrain with same shader from wiki.
Posted By: cartoon_baboon

Re: Grass - House Blend - 06/18/06 08:31

Man, this is really cool!!! seems to be exactly what I was looking for.
Posted By: Josh_Arldt

Re: Grass - House Blend - 06/18/06 10:36

Do you think you could post the script here so that we don't have to download it from rapidshare?
Thanks a bunch man.
Posted By: Salva

Re: Grass - House Blend - 06/18/06 10:55

Yes is really excellent! also I looked for this script from so much time
But I must ask a thing: if it is possible use this code, but without use the terrainmultitexturing shader, because I don't want to change the texture that my terrain has. I have created the texture with freeworld3d. however thank you for the contribution!

salva
Posted By: broozar

Re: Grass - House Blend - 06/18/06 13:44

why will it work only with 6.4 and above? what did you put in that it doesn't run with 6.3?
however, well done!
Posted By: nifty

Re: Grass - House Blend - 06/18/06 18:04

Glad it's useful to some.
If you want to know whether or not it will work with your particular model or hmp, my advice is to copy and paste the grass stuff into your terrain action. The grass script is at the top of the terrain action. I kept it separate from JCLs script. Then follow the instructions and let the grass script do its thing.

Although I don't like rapidshare myself, I can't just post the script here. You'll need the grass models too. You may need the terrain and colormap to see how the script works, and adapt it to your game. If anyone can host the file, feel free to do so. It's over 5MB.

I see no reason why it should not work with 6.3, but since I don't have it, I make no guarantees.
Posted By: frazzle

Re: Grass - House Blend - 06/18/06 18:22

Could you make it work with more than one terrain (hmp).
But for the rest it's really amazing job in only one week.
Congratz

Cheers

Frazzle
Posted By: Lion_Ts

Re: Grass - House Blend - 06/18/06 23:25

Cool thing, nifty!
You did great script. Thank you, man.
Posted By: JetpackMonkey

Re: Grass - House Blend - 06/19/06 00:16

wow that rapidshare site is annoying but who cares, this script rocks!

Has anyone attempted to modify this to work on multiple MDL terrains yet?

Thanks so much for sharing this awesome piece of work!
Posted By: Loopix

Re: Grass - House Blend - 06/19/06 17:23

WOAHHH You are definately my hero Nr.1 You did something I always wanted to do, but failed because of being so *%&&*## dumb when it comes to scripting . I'm so happy that I haven't rated you before...50000000 stars for you...and check your pm if you need some trees

Loooong lives nifty
Posted By: BigDaz

Re: Grass - House Blend - 06/19/06 20:32

Thanks
Posted By: Matt_Aufderheide

Re: Grass - House Blend - 06/19/06 21:41

I like this script, nice work.
Posted By: nifty

Re: Grass - House Blend - 06/19/06 21:55

Thanks for the kind words. The script should look familiar to you Matt, since I stole it from you
The grass is from Loopix. I've been his fan since his first contribution many moons ago.
I'm really dumb when it comes to scripting too. I am an artist, and not a programmer. I was about to abandon my project when I couldn't get the script working after a week of effort. I decided to put in one more hour of work, then I got it to run without crashing, heh.
Maybe someone with more smarts can help the other people get it working with multiple HMPs.
Posted By: Matt_Aufderheide

Re: Grass - House Blend - 06/20/06 07:28

Is it really my script? heh.. i didnt look at it.. either way its a nice implementation.

However, I suggest removing that wait(1) in the grass creation loop.. this just makes it take longer and look wierd as it pops in. If you have too many loops, just increase the max loops variable.

About the problem with only one HMP, this is solvable, but really shouldnt be needed, no one should be using multiple HMPs. All those "stiching" programs and such are a bad idea.
Posted By: Grafton

Re: Grass - House Blend - 06/20/06 17:10

Thanks Nifty, very useful, great contribution. Could you post an uncompiled
version with the wmp so it would be easier to study the implimentation?
Posted By: nifty

Re: Grass - House Blend - 06/20/06 18:48

Thanks again. That's an excellent tip, Matt. I didn't know you could do that. Now the grass is instant. That also solves a problem on my next challenge

Josiah, here's a link to the project files: DOWNLOAD
Posted By: Marcio Esper

Re: Grass - House Blend - 06/23/06 06:16

Hi,

Very cool contribuition

BR

Marcio
Posted By: Grafton

Re: Grass - House Blend - 06/23/06 19:50

Thanks for the uncompiled version Nifty, very helpful!
Posted By: Loopix

Re: Grass - House Blend - 06/27/06 20:57

I'm having a hard time to get this to work with hmp terrains. If someone could give me a hint on how to change the script to work with hmp terrain (and not only mdl-terrain), I'd be extremely gratefull!
Posted By: Loopix

Re: Grass - House Blend - 06/28/06 19:58

BUMP! Tralalala...pfff....any one??? Need some trees?

(ehmm...sorry got a bad day )
Posted By: nifty

Re: Grass - House Blend - 06/28/06 23:03

I don't know much about HMPs but I managed to do a test. It's not a precise method, but it seems to work. HMPs seem to act very strange in GS. It's very different from MDLs.

Since everyone's project is different, you'll have to use your scripting skills to adapt it to your level. You'll see what I mean when you run it.

This test is very ugly, because I simplified everything so that you can see how the scripts work together. DOWNLOAD TEST

Hope you have a nice day

EDIT: I forgot to delete this line from the terrain action:
my.polygon = on;
Delete it in your wdl, because it's only needed on MDLs.
Posted By: Matt_Aufderheide

Re: Grass - House Blend - 06/28/06 23:27

I dunno, i dont like HMPs myself, I just use models for terrain..

However, there is no reason it cant be made to work, as HMPs use polygon collision and so forth..
Posted By: Loopix

Re: Grass - House Blend - 06/29/06 06:13

Hey thanks a lot! I will go on and test it
Posted By: Loopix

Re: Grass - House Blend - 06/29/06 12:12

nifty...you 're da man again. Your solution works pretty well...even for huge chunked terrain! Thanks so much for working on this
Posted By: nifty

Re: Grass - House Blend - 06/29/06 21:30

That's good news Loopix. Maybe you can post some tips for other users -if you have any.
Posted By: RaSTaFaRi_87

Re: Grass - House Blend - 08/29/06 02:23

Hello,

could someone upload the demo, that works with HMP?
It was deleted by the server...

mfg

RaSTaFaRi
Posted By: nifty

Re: Grass - House Blend - 08/29/06 06:26

I uploaded them here:

HMP Test

MDL version
© 2024 lite-C Forums