sufjanfan
Skirmisher
posted 08-07-10 04:49 PM
EDT (US)
476 / 736
I'm running into a little bug while adding triggers into a random map I am making. The triggers work fine, but they add one extra condition and one extra effect, the default ones ("Always" and "SetIdleProcessing"). I assume there is a quick solution to this I am missing...any ideas?
sufjanfan
Skirmisher
posted 08-09-10 06:29 PM
EDT (US)
482 / 736
In RM scripting, if 'i' is a variable (for example 1), "Move"+i would be "Move1". Are you saying if you create a trigger using this it will lock the trigger up?
sufjanfan
Skirmisher
posted 08-10-10 09:29 AM
EDT (US)
484 / 736
I needed a move trigger for each player, and because you can't know that, I had to have a loop define the triggers. Since Mister SCP hinted that that causes problems, I'm just doing this at the beginning of my trigger section.
rmCreateTrigger("Move1");
rmCreateTrigger("Move2");
rmCreateTrigger("Move3");
rmCreateTrigger("Move4");
rmCreateTrigger("Move5");
rmCreateTrigger("Move6");
rmCreateTrigger("Move7");
rmCreateTrigger("Move8");
DalEk
Skirmisher
posted 08-19-10 04:20 AM
EDT (US)
489 / 736
Hello
I am very new to RMS scripting and have just read M0nTy_PyTh0n's RMS tutorial. I do, however have some questions.
Is there anywhere I can find a full list of all rm functions/variables? Also, while looking through the ES maps, I found many lines of script I did not understand.
e.g:// rmSetMapElevationParameters(long type, float minFrequency, long numberOctaves, float persistence, float heightVariation) What is this and how does it affect my map's elevation?
What are classes?
What is a nugget?
What are sockets and how can I place them?
Why do many commands contain ".........."+i. What value does i have?
Sorry if my questions sound so simple, but I cannot find answers anywhere else, and would be very grateful if you answered my questions.
Thanks
RF_Gandalf
Skirmisher
posted 08-20-10 01:15 PM
EDT (US)
492 / 736
DalEk
The elevation command you asked about:
rmSetMapElevationParameters(long type, float minFrequency, long numberOctaves, float persistence, float heightVariation)
This is a way to randomly vary the elevation on the map - it tells the map generator to put some variability into the height of the map. I think you only want to use this on non-water maps. ES never explained the functions but I have played around with it, looked at the way elevation appears in various ES maps, and figured out how to use it.
Here is the elevation parameter statement from Deccan:
rmSetMapElevationParameters(cElevTurbulence, 0.06, 1, 0.4, 3.0);
The first number, the minFrequency, seems to refer to how often the variability is repeated, The numberOctaves exact meaning is unclear. The persistance seems to refer to how big an area stays at a given elevation, and the heightVariation refers to the number of tiles a height can vary from the base height of the map - I think both above and below the base elevation.
To my eye, the 1st, 3rd and 4th of the variables seem to affect the appearance more than the 2nd number. For most maps you could really just use one of these lines from a standard ES map, or leave it out for a flat map.
Play around with a map script and try varying things. You can make a map look really odd by making big changes in the heightVariation.
DalEk
Skirmisher
posted 08-21-10 02:06 AM
EDT (US)
493 / 736
Thanks RiverWalker and RF_Gandalf.
That answers all the questions I have for now.
camo90
Skirmisher
posted 08-23-10 11:39 AM
EDT (US)
494 / 736
On a california style map, I want each player to start with a Mango Grove (ypGroveBuilding). The map loads, but the mango grove doesn't appear. Here is the script I typed, what is missing?
int avoidypGroveBuilding=rmCreateTypeDistanceConstraint("mango groves avoid mango groves", "ypGroveBuilding", 35.0);
----------------------------------------
int startingMangoGroveID=rmCreateObjectDef("Starting Mango Grove");
rmAddObjectDefItem(startingMangoGroveID, "ypGroveBuilding", 1, 0.0);
rmSetObjectDefMinDistance(startingMangoGroveID, 20.0);
rmSetObjectDefMaxDistance(startingMangoGroveID, 22.0);
rmAddObjectDefToClass(startingMangoGroveID, rmClassID("importantItem"));
rmAddObjectDefConstraint(startingMangoGroveID, avoidypGroveBuilding);
rmAddObjectDefConstraint(startingMangoGroveID, avoidTradeRoute);
rmAddObjectDefConstraint(startingMangoGroveID, avoidImportantItem);
rmAddObjectDefConstraint(startingMangoGroveID, avoidAll);
rmAddObjectDefConstraint(startingMangoGroveID, avoidCliff);
rmAddObjectDefConstraint(startingMangoGroveID, avoidImpassableLand);
rmAddObjectDefConstraint(startingMangoGroveID, avoidTownCenter);
rmAddObjectDefConstraint(startingMangoGroveID, playerEdgeConstraint);
rmAddObjectDefConstraint(startingMangoGroveID, longAvoidImpassableLand);
rmPlaceObjectDefAtLoc(startingMangoGroveID, 0, rmXMetersToFraction(xsVectorGetX(TCLoc)), rmZMetersToFraction(xsVectorGetZ(TCLoc)));
camo90
Skirmisher
posted 08-23-10 01:54 PM
EDT (US)
496 / 736
Unfortunately, it didn't work...
RF_Gandalf
Skirmisher
posted 08-24-10 08:24 PM
EDT (US)
499 / 736
camo90 -
Well, your statements:
rmAddObjectDefItem(goldID, "minegold", 2, 0.0);
rmAddObjectDefItem(goldID, "minegold", 5, 0.0);
will not add more gold. What you tried to do with those lines was to put more mines in a group(adding objects to a group), but the 0.0 is the diameter of the group so only a single one places. If your statement said:
rmAddObjectDefItem(goldID, "minegold", 5, 12.0);
you would get 5 mines in a diameter of 12 tiles.
Anyway, you need additional statements that actually place the mines. What is the placement statement you are using for the mines? After defining your 'goldID', I would try:
rmPlaceObjectDefPerPlayer(goldID, false, 1); to get one mine per player. Or use that line twice to get 2 mines per player. or use the line:
rmPlaceObjectDefPerPlayer(goldID, false, 2);
to place 2 mines per player. The concern is that your constraints, such as having mines avoid players and other mines, eventually cause some to be dropped.
You might want to define more than one set of mines (like a farGoldID and a medGoldID) with differing distances from the players and other objects or areas or terrain.
You could, if you desired, place them all at a long, minimum distance from the sea using a constraint vs water.
Another way to place the mines would be to place them in a defined location using the map coordinates. This command would place 1 defined 'extraMineID' at the map center:
rmPlaceObjectDefAtLoc(extraMineID, 0, 0.5, 0.5, 1);
The last suggestion would be to place them in a defined area. For example if you wanted to place objects in an area far from the water, create an area (say, called interiorID) with a long constraint from water, then place them in that area with the statement:
rmPlaceObjectDefInArea(goldID, 0, rmAreaID("interiorID"), 3);
to place 3 mines in the area. You would have to experiment with the size, distances, constraints etc for the area as well as the mine objects.
Sorry, I would like to help further but I will not have time to specifically look at your map script.
camo90
Skirmisher
posted 08-25-10 09:10 AM
EDT (US)
500 / 736
Ok ok you don't have to, I solved the problems myself: I incremented the gold mines as you suggested, then I succeeded in eliminating the overpopulation of huntable by changing from:
{
rmPlaceObjectDefAtLoc(deerID, 0, 0.5, 0.5, 4*cNumberNonGaiaPlayers);
rmPlaceObjectDefAtLoc(elkID, 0, 0.5, 0.5, 5*cNumberNonGaiaPlayers);
}
to
{
rmPlaceObjectDefAtLoc(deerID, 0, 0.5, 0.5, 2.5*cNumberNonGaiaPlayers);
rmPlaceObjectDefAtLoc(elkID, 0, 0.5, 0.5, 2*cNumberNonGaiaPlayers);
}
I'm not sure of what that number means, maybe how many herds should be per player?
And finally I adjusted the forest reducing the range of its size variation.