Here you can post about your scenario's, mods, custom maps and YouTube channels!
User avatar
Romania mandosrex
Musketeer
Posts: 52

12 Sep 2016, 16:33

Gentlemen, those who are into map making, I require assistance.

I wanted to fill a map with grass so I went and took the grass codes from Great Plains. Problem is, the grass on GP only spams on the middle of the map, while I want the grass the be on the entire map (except maybe the small pond in the middle).

I tried everything with the codes, changed every value, nothing. I get patches of grass all around the map but they are random and... they are not everywhere!

If someone could help me out it would be highly appreciated.

Here are the grass codes:

Code: Select all

   // Build grassy areas everywhere.  Whee!
   numTries=6*cNumberNonGaiaPlayers;
   failCount=0;
   for (i=0; <numTries)
   {   
      int grassyArea=rmCreateArea("grassyArea"+i);
      rmSetAreaWarnFailure(grassyArea, false);
      rmSetAreaSize(grassyArea, rmAreaTilesToFraction(1000), rmAreaTilesToFraction(1000));
      rmSetAreaForestType(grassyArea, "Great Plains grass");
      rmSetAreaForestDensity(grassyArea, 0.3);
      rmSetAreaForestClumpiness(grassyArea, 0.1);
      rmAddAreaConstraint(grassyArea, avoidHills);
      rmAddAreaConstraint(grassyArea, avoidTradeRoute);
      rmAddAreaConstraint(grassyArea, avoidSocket);
      rmAddAreaConstraint(grassyArea, avoidNatives);
      rmAddAreaConstraint(grassyArea, avoidStartingUnits);
      rmAddAreaConstraint(grassyArea, avoidNuggetSmall);
      if(rmBuildArea(grassyArea)==false)
      {
         // Stop trying once we fail 5 times in a row.
         failCount++;
         if(failCount==5)
            break;
      }
      else
         failCount=0;
   }


(posted on NE's forum as well)
User avatar
United States of America HeatitUP_
Lancer
Posts: 642

12 Sep 2016, 17:19

The buffalo would get fatter and have more food in them =]
All of the women on The Apprentice flirted with me - consciously or unconsciously. That's to be expected. - Donald Trump
User avatar
France Rikikipu
ESOC Dev Team
Posts: 1539
ESO: p-of
Location: In your base

12 Sep 2016, 17:36

Increase numTries by x10000 and delete all the "avoidHills" line
User avatar
Romania mandosrex
Musketeer
Posts: 52

12 Sep 2016, 17:39

The map has no buffalo, it's a Savannah map. And it also has no hills.

I will try to increase numTries, funny enough it's the only one I didn't change...

:D
User avatar
Italy Garja
ESOC Maps Team
Donator 02
Posts: 6294
ESO: Garja

12 Sep 2016, 18:11

EDIT: nvm

Ye just get rid of the avoidHills constraint.
User avatar
United States of America Durokan
ESOC Maps Team
Posts: 902
ESO: Durokan

12 Sep 2016, 18:55

Code: Select all

// Build grassy areas everywhere.  Whee!
   int numTries=2*cNumberNonGaiaPlayers;
   for (i=0; <numTries){   
      int grassyArea=rmCreateArea("grassyArea"+i);
      rmSetAreaSize(grassyArea, .2, .2);
      rmSetAreaForestType(grassyArea, "Great Plains grass");
      rmSetAreaForestDensity(grassyArea, .5);
      rmSetAreaForestClumpiness(grassyArea, 0.01);
      rmBuildArea(grassyArea);
   }


this is what i've used in the past.
it's used on my savanna grass map and to some extent highveld if you've ever made it over to my workshop

it gives this kind of distribution across the whole map

Image

if you want more grass increase the density.

Note: place this before all of your other items (hunts, tc, trees, gold, etc) on the map as the grass will be placed over the top of and "break" all of the other items and you will have a grassy map with nothing else on it. You want things placed on top of the grass which will not break it for the most part
Check out my Custom Map Workshop here!
viewtopic.php?p=98718#top
User avatar
Romania mandosrex
Musketeer
Posts: 52

12 Sep 2016, 20:01

Oh, so many map scripters!

And here I was thinking no one will respond on this forum.
Apologies. :(


Back to business then, so by just editing numTries or removing the avoid codes, it didn't work. Same uneven placement.

I also tried using the codes Durokan posted but then the map breaks and fails to load, no matter where I put them.
Help.
User avatar
France Rikikipu
ESOC Dev Team
Posts: 1539
ESO: p-of
Location: In your base

12 Sep 2016, 20:44

mandosrex wrote:Oh, so many map scripters!

And here I was thinking no one will respond on this forum.
Apologies. :(


Back to business then, so by just editing numTries or removing the avoid codes, it didn't work. Same uneven placement.

I also tried using the codes Durokan posted but then the map breaks and fails to load, no matter where I put them.
Help.



Code: Select all

// Build grassy areas everywhere.  Whee!
   int numTries=2*cNumberNonGaiaPlayers;
   for (i=0; <numTries){   
      int grassyArea=rmCreateArea("grassyArea"+i);
      rmSetAreaSize(grassyArea, .2, .2);
      rmSetAreaForestType(grassyArea, "Great Plains grass");
      rmSetAreaForestDensity(grassyArea, .5);
      rmSetAreaForestClumpiness(grassyArea, 0.01);
      rmBuildArea(grassyArea);
   }


in Durokan code, replace int numtries for numtries only
So you'll have this and the map won't crash :

Code: Select all

// Build grassy areas everywhere.  Whee!
   numTries=2*cNumberNonGaiaPlayers;
   for (i=0; <numTries){   
      int grassyArea=rmCreateArea("grassy_Area"+i);
      rmSetAreaSize(grassyArea, .2, .2);
      rmSetAreaForestType(grassyArea, "Great Plains grass");
      rmSetAreaForestDensity(grassyArea, .5);
      rmSetAreaForestClumpiness(grassyArea, 0.01);
      rmBuildArea(grassyArea);
   }
User avatar
United States of America musketeer925
Retired Contributor
Donator 01
Posts: 1772
ESO: musketeer925
GameRanger ID: 451878

12 Sep 2016, 20:52

Oh hey Mandos. There are a lot of map scripters here, yes.
User avatar
United States of America _H2O
Retired Contributor
Donator 06
Posts: 3225

12 Sep 2016, 22:56

We have a whole team dedicated to it!
User avatar
Romania mandosrex
Musketeer
Posts: 52

12 Sep 2016, 23:51

So many awesome guys here!

H2O and Garja, I am honored, I am familiar with your work and it's awesome.

Agh, I keep getting distracted. Ok, so, the grass, it spawns correctly now but only if I put it at the end of the file (which is not good beause everything else gets erased).
I tried putting it in many places before everything else spawns but it keeps crashing the map.

I tried placing it before "// Define and place lake in middle", it crashes; tried placing it before "// Place players in FFA and team games", it crashes; tried placing them before and after "// Define and place players' areas", it crashes; tried placing it before "// Define starting objects and resources", it crashes; tried placing it before "// Define and place forests", it crashes...

I don't know what to try anymore.
I am such a noob...
User avatar
United States of America Durokan
ESOC Maps Team
Posts: 902
ESO: Durokan

13 Sep 2016, 00:01

mandosrex wrote:So many awesome guys here!

H2O and Garja, I am honored, I am familiar with your work and it's awesome.

Agh, I keep getting distracted. Ok, so, the grass, it spawns correctly now but only if I put it at the end of the file (which is not good beause everything else gets erased).
I tried putting it in many places before everything else spawns but it keeps crashing the map.

I tried placing it before "// Define and place lake in middle", it crashes; tried placing it before "// Place players in FFA and team games", it crashes; tried placing them before and after "// Define and place players' areas", it crashes; tried placing it before "// Define starting objects and resources", it crashes; tried placing it before "// Define and place forests", it crashes...

I don't know what to try anymore.
I am such a noob...


If you upload the map I'd be willing to look through it and see if I can help you out. Before you do that, go ahead and read and check the following.

The one think I can think of off of the top of my head is that due to how the code was crashing is that "numtries" is defined as an integer somewhere else in the code. (It was not in mine)
So if my theory is correct, the grass will only place after that definition. If you place it before the definition, it will crash.

To fix this I would suggest finding where "int numtries" is defined.

If you can't seem to find where numtries is or you want a new variable name, use the following.
(numtries was changed to a unique, uncommon variable name with the same meaning to avoid conflict with variables of the numtries name)

Code: Select all

// Build grassy areas everywhere.  Whee!
   int numberTries=2*cNumberNonGaiaPlayers;
   for (i=0; <numberTries){   
      int grassyArea=rmCreateArea("grassyArea"+i);
      rmSetAreaSize(grassyArea, .2, .2);
      rmSetAreaForestType(grassyArea, "Great Plains grass");
      rmSetAreaForestDensity(grassyArea, .5);
      rmSetAreaForestClumpiness(grassyArea, 0.01);
      rmBuildArea(grassyArea);
   }
Check out my Custom Map Workshop here!
viewtopic.php?p=98718#top
User avatar
Romania mandosrex
Musketeer
Posts: 52

13 Sep 2016, 00:15

Huh, this is really weird.
So, the first place where it's mentioned is for trees, "// Define and place forests":

Code: Select all

   int numTries=20*cNumberNonGaiaPlayers;
   int failCount=0;
   for (i=0; <numTries)
   {   
      int forest=rmCreateArea("forest"+i);

etc


If I put it after this it works, but it's still not good as it erases everything above.
Now, my logic told me that if I just put back "int" before "numTries" for the grass codes then it will work, but it didn't.
So I really don't know how to fix this. Why is not defining that "int" thing for the first time in the grass codes working?


Oh, you changed your message as I was writing mine, trying now.
User avatar
United States of America Durokan
ESOC Maps Team
Posts: 902
ESO: Durokan

13 Sep 2016, 00:29

mandosrex wrote:Huh, this is really weird.
So, the first place where it's mentioned is for trees, "// Define and place forests":

Code: Select all

   int numTries=20*cNumberNonGaiaPlayers;
   int failCount=0;
   for (i=0; <numTries)
   {   
      int forest=rmCreateArea("forest"+i);

etc


If I put it after this it works, but it's still not good as it erases everything above.
Now, my logic told me that if I just put back "int" before "numTries" for the grass codes then it will work, but it didn't.
So I really don't know how to fix this. Why is not defining that "int" thing for the first time in the grass codes working?


Oh, you changed your message as I was writing mine, trying now.


Yeah, variable names are unique and the game will throw an error if you define the same variable twice. Variables can only be used after they are defined as this is a top down language. Generally, to avoid issues like this, good coding practice is to "initialize" all of the variables at the top of the code. For example, you might define a few things at the top of the map such as:

Code: Select all

//Example code
//To be changed later
int numTries = 0;
int someOtherVariable = 0;
float aDecimalVariable = 0.0;
//and so on

//the rest of your map's code

//hey we found a use for numTries, let's change it here!
numTries = 2 * cNumNonGaiaPlayers;
 for (i=0; <numberTries){
//and so on
}

When the variables are then later used, it is best to then do it as riki corrected. The error is partially my fault, but I also didn't know you would have the same variable used already. I guess it was code I modified from great plains or something so it was not a unique name (like I would normally use)
Check out my Custom Map Workshop here!
viewtopic.php?p=98718#top
User avatar
Romania mandosrex
Musketeer
Posts: 52

13 Sep 2016, 00:46

So, everything seems to work now except for the northern part of the map which always lacks grass with 8 players for some reason. Can I tweak the codes for a better coverage?

Sadly, it now also suddenly started to lag. I mean, I was expecting this but so far it didn't lag.

How would a set of codes to spawn rocks and other ambiental stuff go (like the stuff from Great Plains or Texas)? The same as with grass?
I know I saw something similar on a map but forgot which.


Anyway, Durokan, I just saw your maps workshop and I have to ask if you allow their usage in mods? With full credit given of course.
And do the maps that don't have 1v1 or 2v2 in their names support all 8 players?
Thank you for your help!
User avatar
United States of America Durokan
ESOC Maps Team
Posts: 902
ESO: Durokan

13 Sep 2016, 01:14

mandosrex wrote:So, everything seems to work now except for the northern part of the map which always lacks grass with 8 players for some reason. Can I tweak the codes for a better coverage?

Sadly, it now also suddenly started to lag. I mean, I was expecting this but so far it didn't lag.

How would a set of codes to spawn rocks and other ambiental stuff go (like the stuff from Great Plains or Texas)? The same as with grass?
I know I saw something similar on a map but forgot which.


Anyway, Durokan, I just saw your maps workshop and I have to ask if you allow their usage in mods? With full credit given of course.
And do the maps that don't have 1v1 or 2v2 in their names support all 8 players?
Thank you for your help!


Yeah, the code should be editable.

To my knowledge, the grass is a forest type object. I doubt the ambiental stuff is classified as a forest, so they are most likely placed in a similar manner to any other object such as a gold mine, hunt, etc.

Code: Select all

      
   //this code places 8 lions per player randomly around the map per player and it obeys a defined constraint.
   //you can use something like this but instead of "ypLion" use "whateverTheRockNameIs" or "ambientTreeLogThingy"
   int variableName = rmCreateObjectDef("some string that tells you what it does");
        rmAddObjectDefItem(variableName, "ypLion", 1, 10.0);
        rmSetObjectDefMinDistance(variableName, 0);
   rmSetObjectDefMaxDistance(variableName, rmXFractionToMeters(0.5));
   rmAddObjectDefConstraint(variableName, constraintName);
   rmPlaceObjectDefAtLoc(variableName, 0, 0.5, 0.5, cNumberNonGaiaPlayers*8);


This is what I have said about using my maps in the past.
viewtopic.php?f=33&t=4748&start=100#post_content108084
Check out my Custom Map Workshop here!
viewtopic.php?p=98718#top
User avatar
Romania mandosrex
Musketeer
Posts: 52

13 Sep 2016, 01:28

Awesome!
This is so exiting! I saw you also had a Savannah map so I tried yours and it's so much full of stuff, it's awesome!

But I saw that it had no loading screen so I fixed that by adding the loading bar codes. I also tweaked the look of the map and added zebras and fitting treasures with lions and rhinos and whatnot.

I want to add African maps in my mod and I will see what other maps for 8 players you have which can be converted into African maps.

I will give you full credit in the loading screen, immersion breaking or not. Your work is awesome.
Thank you!
User avatar
United States of America Durokan
ESOC Maps Team
Posts: 902
ESO: Durokan

13 Sep 2016, 02:42

mandosrex wrote:Awesome!
This is so exiting! I saw you also had a Savannah map so I tried yours and it's so much full of stuff, it's awesome!

But I saw that it had no loading screen so I fixed that by adding the loading bar codes. I also tweaked the look of the map and added zebras and fitting treasures with lions and rhinos and whatnot.

I want to add African maps in my mod and I will see what other maps for 8 players you have which can be converted into African maps.

I will give you full credit in the loading screen, immersion breaking or not. Your work is awesome.
Thank you!


Jebel Musa is the african side of the strait of gibaltrar if that interests you at all. It was the map that made me want to start RMS in the first place.

Your mod work sounds pretty cool, feel free to share screenshots whenever you are comfortable sharing :)
Check out my Custom Map Workshop here!
viewtopic.php?p=98718#top
No Flag adderbrain5
Lancer
Posts: 874

13 Sep 2016, 03:00

Durokan wrote:
mandosrex wrote:Awesome!
This is so exiting! I saw you also had a Savannah map so I tried yours and it's so much full of stuff, it's awesome!

But I saw that it had no loading screen so I fixed that by adding the loading bar codes. I also tweaked the look of the map and added zebras and fitting treasures with lions and rhinos and whatnot.

I want to add African maps in my mod and I will see what other maps for 8 players you have which can be converted into African maps.

I will give you full credit in the loading screen, immersion breaking or not. Your work is awesome.
Thank you!


Jebel Musa is the african side of the strait of gibaltrar if that interests you at all. It was the map that made me want to start RMS in the first place.

Your mod work sounds pretty cool, feel free to share screenshots whenever you are comfortable sharing :)

Jabal Musa is the quranic arabic name for "mount sinai" it literally means "Mount Moses"...EDIT which is not anywhere near gibraltar, but in the sinai peninsula between modern egypt and israel
User avatar
Romania mandosrex
Musketeer
Posts: 52

13 Sep 2016, 08:28

While I don't know how to make maps, I do know how to change their aspect, so any map can become an African map.

I could share screenshots, no problem!

Image

Image
User avatar
France iNcog
Gendarme
Posts: 9238
ESO: status = SAVED!!1²
Location: LOCATION LOCATION LOCATION

13 Sep 2016, 09:58

Cool map you have there. ^^
Fear is freedom! Subjugation is liberation! Contradiction is truth!
User avatar
United States of America Durokan
ESOC Maps Team
Posts: 902
ESO: Durokan

13 Sep 2016, 12:34

adderbrain5 wrote:Jabal Musa is the quranic arabic name for "mount sinai" it literally means "Mount Moses"...EDIT which is not anywhere near gibraltar, but in the sinai peninsula between modern egypt and israel


Thanks for the help but thats the wrong Jebel Musa.

Im sure alexandria usa is the same place as alexandria greece xD (both named after alex the G)

Anyways ill explain the arabic.
Jebel means "mountain [range]" and the musa part comes from the name "Musa bin Nusayr", who some geographer named it in honor of. So yes, while mount moses is in fact a place in egypt this happens to be a different mount moses in morocco...

For reference

https://en.m.wikipedia.org/wiki/Jebel_Musa_(Morocco)
Check out my Custom Map Workshop here!
viewtopic.php?p=98718#top
No Flag adderbrain5
Lancer
Posts: 874

14 Sep 2016, 04:41

Durokan wrote:
adderbrain5 wrote:Jabal Musa is the quranic arabic name for "mount sinai" it literally means "Mount Moses"...EDIT which is not anywhere near gibraltar, but in the sinai peninsula between modern egypt and israel


Thanks for the help but thats the wrong Jebel Musa.

Im sure alexandria usa is the same place as alexandria greece xD (both named after alex the G)

Anyways ill explain the arabic.
Jebel means "mountain [range]" and the musa part comes from the name "Musa bin Nusayr", who some geographer named it in honor of. So yes, while mount moses is in fact a place in egypt this happens to be a different mount moses in morocco...

For reference

https://en.m.wikipedia.org/wiki/Jebel_Musa_(Morocco)

touché
User avatar
Romania mandosrex
Musketeer
Posts: 52

14 Sep 2016, 14:41

Durokan, I have to ask something.
For your Savannah map, you made a little island in the middle which holds a Jesuit camp, which is awesome, religious groups would often make settlements on islands, but I wonder if you could add something. Could you add like a shallow for units to be able to walk to the island, because no one is going to build a dock and a ship to go to that island only for the Jesuits, and so a shallow would be perfect!

(if a shallow is not possible then even a dry ground bridge could work, anything for easier access)

You could leave the codes here and I could add them to the map.
Thanks for your awesome work.
User avatar
United States of America Durokan
ESOC Maps Team
Posts: 902
ESO: Durokan

14 Sep 2016, 16:20

can do this in a bit, working on an essay right now sry deadlines hurt
Check out my Custom Map Workshop here!
viewtopic.php?p=98718#top

Forum Info

Return to “User-created Content”



Who is online

Users browsing this forum: No registered users and 1 guest