• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

WIP Making use of different grass types

I have just reset the grass in my game to the PotC default again.
We can play around with that CoAS one later.
 
Code:
bool LocLoadGrass(aref loc, string sat)
{
    string grs = loc.(sat);
    string tex = "";
    sat = sat + ".texture";
    if(CheckAttribute(loc, sat) != 0)
    {
        tex = loc.(sat);
    }
    return SendMessage(loc, "lss", MSG_LOCATION_SET_GRS_PATCH, grs, tex);
}

This is from location_loader.c
I believe this is where the texture is set.
This is where it's called:

Code:
    aref st, at, lit, lit1;
    string sat;
    makearef(st, loc.models.always);
    int num = GetAttributesNum(st);
    for(i = 0; i < num; i++)
    {
        at = GetAttributeN(st, i);
        sat = GetAttributeName(at);
        if(sat != "grassPatch")
        {
            sat = "models.always." + sat;
            res = LocLoadModel(loc, sat, "");
            if(res == 0)
            {
                traceif("LocationLoader: not loaded model location." + sat + ", id = " + loc.id);
                traceif("Unload location.");
                UnloadLocation(loc);
                return false;
            }
        }else{
            LocLoadGrass(loc, "models.always." + sat);
        }
    }

So from what I can see if you have a line like this in the location init file:
Code:
Locations[n].models.always.grassPatch = "JUNGLE06_g";

You can add the :
Code:
Locations[n].models.always.grassPatch.texture = "texturename";
line to set a specific texture for it. So it seems we do have the functionality already. So I'd say we use the old grass as default and change the texture in the init files where we think it's needed.


Just tested this.
Adding this line of code for an specific location:
Code:
Locations[n].models.always.grasspatch.texture = "Grass\grass_flower.tga";
seemed to work.
I renamed the coas grass to grass_flower.tga.tx
and placed the old grass texture back
When the line isn't there the normal grass texture is used, else this one is used.
 
Very cool, @Levis! Then somebody would just need to decide which locations should get that CoAS one.
 
maybe @ANSEL wants to make a list of the locations which deserve it?
if you run this in the console:

trace("LOCATION ID: "+loadedLocation.id);
and press f12 on every location you think it should be there it will print the id in the console.log
If you post these id's here we can very easily add this (or you can do yourself by just copying in that line under the grasspatch line in the location init file).

In this file the textures are already set up right:
Needs Testing - Leveling: Sudden Huge Amounts of XP Gained | Page 20 | PiratesAhoy!

For kralendijk_port it's also set up to use the the texture. so you can use this one as an example
 
maybe @ANSEL wants to make a list of the locations which deserve it?
Well I really don't want that coas grass! If it is here to stay, I think it only fit to towns, and at a low foliage it must bee.;)
Looks like garden flowers, I belive. :rolleyes:
 
Well I really don't want that coas grass! If it is here to stay, I think it only fit to towns, and at a low foliage it must bee.;)
Looks like garden flowers, I belive. :rolleyes:
why not? What is so wrong about it? I think in some towns it would fit nicely dont you think?

We could for example also make a bit darker variant of the normal potc grass which can be used in some jungles also to make them feel a bit more unique
 
We could for example also make a bit darker variant of the normal potc grass which can be used in some jungles also to make them feel a bit more unique
I do like having some jungles different from the others as there is a LOT of copy-pasting there. :cheeky
 
Here is an darker grass texture.
Compare
Stock potc grass:



Darker grass:



Can be applied the same way as the other one :)
 

Attachments

  • grass_dark.tga.zip
    147.5 KB · Views: 84
I just found another COAS grass texture that I like even better as it is more colorful. It is also twice the size of the other COAS texture so should really kill some machines, but has no effect at all on mine.
You can see in the 2nd screenie that looking to sea hurts fps more than the grass.
POTC4 2015-10-15 11-39-42-44.jpg POTC4 2015-10-15 11-39-49-82.jpg POTC4 2015-10-15 11-41-03-66.jpg
 
I just found another COAS grass texture that I like even better as it is more colorful. It is also twice the size of the other COAS texture so should really kill some machines, but has no effect at all on mine.
You can see in the 2nd screenie that looking to sea hurts fps more than the grass.
View attachment 23278 View attachment 23279 View attachment 23280
Feel free to upload it here (we could use the whole coas grass folder I think).
We can just pick some area's where it might fit and add it there.
 
I think in some towns it would fit nicely dont you think?
I agree about towns, it will look nice at towns, But I still mean the foliage is set to high.
In jungles I not so sure what to think about it. Pieter is right all to much copy-paste.
 
I agree about towns, it will look nice at towns, But I still mean the foliage is set to high.
In jungles I not so sure what to think about it.
Like I said we can set it per location :)
 
There's this tool called "work" which has a GrassGenerator.exe. Never got that to work when
importing locations from VCO.
 
There's this tool called "work" which has a GrassGenerator.exe. Never got that to work when
importing locations from VCO.
was looking at that already.
From what I can see you first need to run the PatchCreator
Code:
    patchcreator.exe filename_patch.gm
      when filename_patch.gm model of patch.
Batch processing: *.gm or other files filter

Create patch for sea location:
    patchcreator.exe -s filename_patch.gm

Create patch whith log for bad files:
    patchcreator.exe -l filename_patch.gm
After that you run the grassgenerator I think
Code:
    grassgenerator.exe filename_patch.gm
      when filename_patch.gm model of patch whith bsp.

incase you are wondering where this info comes from just put the .exe files in say C and try to run them trough the commandprompt
 
Maybe @Armada may have a clue on generating grass patches?
There may also be something in the Help Files we got from seaward.ru and are available from the PotC Modding forum.
 
Back
Top