You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by MosheLevi, Mister SCP

Hop to:    
Welcome! You are not logged in. Please Login or Register.735 replies, Sticky
Age of Empires III Heaven » Forums » Scenario Design » The RMS question Thread
Bottom
Topic Subject:The RMS question Thread
« Previous Page  1 2 3 ··· 10 ··· 20 ··· 30  Next Page »
RF_Gandalf
Skirmisher
posted 04-27-06 06:09 AM EDT (US)         
This thread is intended for discussion of questions regarding Random Map Scripting for AOE3. Instead of posting questions separately in the forum, use this thread which will serve as a collection of (?)wisdom for those looking for information. I will be checking this thread at least several times per week, and I hope that the other experienced scripters will join in to add their wisdom.

For those seeking some basic starting help, try these links to some helpful information:
The Age of Wiki has a useful section on Random Map Scripting.

An AOE3RMS Tutorial by MOnTy PyThOn is a pretty complete guide to help you understand the various commands.

Finally, try downloading some of the map scripts at the Age of Empires IIIHeaven RMS Download section and open the map scripts in a text editor and check them out to see how it is done. You could also open the map scripts that came with the game to study their commands; these will be found in the directory: Program Files\Microsoft Games\Age of Empires III\rm.

So post any RMS questions here, we will try to help!

AuthorReplies:
CheddarCheese
Skirmisher
posted 04-27-06 08:42 AM EDT (US)     1 / 735       
Great idea Gandalf =)

Will be nice to see if this will be a sticky.


btw, could you quick explain how you put out water? i would like to have a pool in the middle and som other pools spread out.

I have readn the guide by monthy...but still i'm confused, it says something about , areas, or pools or what it was called, i would be very glad if you Can explain this =)


Through the gates of Insanity, to the edge of Humanity...-The Rasmus
RF_Gandalf
Skirmisher
posted 04-27-06 10:13 AM EDT (US)     2 / 735       
This would make a central lake using the bayou water terrain(of course any other terrain could be substituted):

int smalllakeID=rmCreateArea("small lake");
rmSetAreaLocation(smalllakeID, 0.5, 0.5);
rmSetAreaWaterType(smalllakeID, "bayou");
rmSetAreaSize(smalllakeID, rmAreaTilesToFraction(1000), rmAreaTilesToFraction(1500));
rmSetAreaMinBlobs(smalllakeID, 3);
rmSetAreaMaxBlobs(smalllakeID, 8);
rmSetAreaMinBlobDistance(smalllakeID, 24.0);
rmSetAreaMaxBlobDistance(smalllakeID, 36.0);
rmSetAreaCoherence(smalllakeID, rmRandFloat(0.2,0.3));
rmAddAreaToClass(smalllakeID, lakeClass);
rmAddAreaConstraint(smalllakeID, playerConstraint);
rmAddAreaConstraint(smalllakeID, avoidTradeRoute);
rmAddAreaConstraint(smalllakeID, avoidSocket);
rmSetAreaWarnFailure(smalllakeID, false);
rmBuildArea(smalllakeID);

This would add 6 other pretty small ponds per player that avoid the central lake and each other:

for (i=0;
{
int smallPondID=rmCreateArea("small pond"+i);
rmSetAreaSize(smallPondID, rmAreaTilesToFraction(180), rmAreaTilesToFraction(240));
rmSetAreaWaterType(smallPondID, "bayou");
rmSetAreaMinBlobs(smallPondID, 2);
rmSetAreaMaxBlobs(smallPondID, 4);
rmSetAreaMinBlobDistance(smallPondID, 6.0);
rmSetAreaMaxBlobDistance(smallPondID, 12.0);
rmAddAreaToClass(smallPondID, lakeClass);
rmAddAreaConstraint(smallPondID, avoidLakes);
rmAddAreaConstraint(smallPondID, avoidNativesShort);
rmAddAreaConstraint(smallPondID, playerConstraint);
rmAddAreaConstraint(smallPondID, avoidTradeRoute);
rmAddAreaConstraint(smallPondID, avoidSocket);
rmAddAreaConstraint(smallPondID, avoidAll);
rmSetAreaCoherence(smallPondID, rmRandFloat(0.2,0.6));
rmSetAreaWarnFailure(smallPondID, false);
rmBuildArea(smallPondID);
}

Note you would need constraint statements defining each of the area constraints used, like these:

int playerConstraint=rmCreateClassDistanceConstraint("stay away from players", classPlayer, 45.0);

int avoidLakes=rmCreateClassDistanceConstraint("stuff vs.lakes", rmClassID("lake"), 12.0);

int avoidAll=rmCreateTypeDistanceConstraint("avoid all", "all", 6.0);

int avoidTradeRoute = rmCreateTradeRouteDistanceConstraint("trade route", 8.0);

int avoidSocket=rmCreateClassDistanceConstraint("avoid sockets", rmClassID("socketClass"), 12.0);

int avoidNativesShort=rmCreateClassDistanceConstraint("stuff avoids natives shorter", rmClassID("natives"), 15.0);

And you would need these definitions of the lakeClass, sockets, natives and players:
int lakeClass=rmDefineClass("lake");
rmDefineClass("socketClass");
int classPlayer=rmDefineClass("player");
rmDefineClass("natives");

All of the above definitions would have to come before the lakes can be made, and the class definitions should come before the constraint statements.


These could be adjusted in size, coherence, number of blobs etc to give different appearances. Any questions on this?

[This message has been edited by RF_Gandalf (edited 04-27-2006 @ 10:17 AM).]

Takk
Skirmisher
(id: Luke_Feanor)
posted 04-27-06 10:59 AM EDT (US)     3 / 735       
Lovely, seeing as RMS will get bigger without any custom scenario support, this will be a (hopefully) useful and active thread.

I'll sticky this for now, but I really need to do something about the organising the number of stickies in this forum. :/


Lucas is boss.

[This message has been edited by Luke M (edited 04-27-2006 @ 11:01 AM).]

CheddarCheese
Skirmisher
posted 04-27-06 03:25 PM EDT (US)     4 / 735       
lol,

Thank you really much gandalf =), how do you come up with these scripts?


Through the gates of Insanity, to the edge of Humanity...-The Rasmus
Jugit
Skirmisher
posted 05-01-06 04:11 PM EDT (US)     5 / 735       
This question is just to keep things moving. Can anyone tell me why choosing "tropical" as a map type causes the difficulty for nuggets not to work? I originally used "caribbean" and the nuggets worked as they should with easy ones near the players and more difficult ones further out. I was playing with the map types and inadvertently left "tropical" as the choice. Not realizing this, I then made other changes and spent a long time figuring out what happened. I notice that some map types seem to be okay and others seem to not work the same way. I searched but could not find this documented anywhere.
Alex
(VIP) Reverie World Studios
(id: pEpsIdUDe_123)
posted 05-01-06 04:14 PM EDT (US)     6 / 735       

Quote:

but I really need to do something about the organising the number of stickies in this forum.


May I suggest taking down Custer and Reinfire's designing guides and just put links to them in FD2's sticky? Or perhaps this thread belongs in the modding forum?

[This message has been edited by Pepsidude_123 (edited 05-01-2006 @ 04:15 PM).]

Takk
Skirmisher
(id: Luke_Feanor)
posted 05-01-06 04:20 PM EDT (US)     7 / 735       
RMS belongs with SD.

I'm working on an arrangment to get rid of half the sticky threads and make everything easier to access. It's on its way, along with several other small SD things that are in the pipeline.


Lucas is boss.
Alex
(VIP) Reverie World Studios
(id: pEpsIdUDe_123)
posted 05-01-06 04:38 PM EDT (US)     8 / 735       
Ok, I'm just used to AOMH where RMS and AI scripting are part of the modding forum.

RF_Gandalf
Skirmisher
posted 05-02-06 06:08 AM EDT (US)     9 / 735       
Jugit - there seem to be a couple layers of 'MapType'. The first, and most obvious, is a type named for each of the maps of the game(Hispanola shares "Caribbean"). I do not know for sure everything that controls in the RMS and Scenario generation - I have not experimented with it enough. I do know that this 'MapType' gives some of the birds that automatically fly over a game, and I do know that this 'MapType' changes the treasures and guardians. If you do not specify a map name 'MapType', then the treasures will be somewhat haphazard - different types (polar bears in the jungle, for example). I noted in your dogleg islands map that the treasures would be jumbled up, for instance, and the lack of this kind of 'MapType' is the cause. It would be nice if we could define our own maptype to control these features.

The second 'MapType' is a description of the terrain - snow for Yukon and Great Lakes winter version, tropical for Amazon and Yucatan, and grass for all others. I have not really experimented with this in the ScenEd or in RMS to see what it controls, but I now try to put it into all of my maps.

The 3rd 'MapType' is "water" which is placed on those maps with significant water including those like New England, Great Lakes, Yucatan, Saguenay, Patagonia with water on part of the map. My assumption was that this was a clue to the AI to consider building ships, or it could describe something about the water waves on the map, I am not sure - I have not really tested this out.

All of the ES maps have the first two kinds of 'MapType". and the water maps list 3 kinds of 'MapType'.

[This message has been edited by RF_Gandalf (edited 05-02-2006 @ 06:11 AM).]

Jugit
Skirmisher
posted 05-02-06 10:03 AM EDT (US)     10 / 735       
RF_gandalf - Thanks! That explains it. Guess I need to update Dogleg Islands.
M0nTy PyTh0n
Skirmisher
posted 05-12-06 10:41 PM EDT (US)     11 / 735       
Hello all,
hello RF_Gandalf.

Thanks for adding my link to your topic. Sorry, I have not read the complete conversations in this thread yet, because of missing time.

Since the last 5 months I have not created much for AOE3, because I am fully involved in a big movie projects, which already runs with full power for more than 14 months now ... and it will still take some more months.

BTW, you do a very good job with new RM scripts for AOE3 .

Regards,
M0nTy_PyTh0n.


M0nTy_PyTh0n
RM Scripter - Utility Programmer - Music/Sound Composer/Creator
HYENA STUDIOS
Also on YouTube and MySpace
Partner of Tsunami Studios - Sound and Music Composer
All rights reserved.
Orca
Skirmisher
posted 05-17-06 11:56 AM EDT (US)     12 / 735       
Is there a way to change the loading screen picture and substitute it with a new grafic (I dont want to change to a grafic of one of the existing maps) ?
RF_Gandalf
Skirmisher
posted 05-17-06 09:08 PM EDT (US)     13 / 735       
I assume that there is.

The graphics used are found in the art/ui/random map folder of your game folder. They have a .ddt file extension. I did a brief search during the demo period for a reader or file converter for that format, and unfortunately I don't recall what I found, but somehow I converted a couple of the .ddt files to .tga files that I could view, but as I recall I could not convert other files to the .ddt format (?proprietary format?). I quit fooling around with that afterward, and it has been 8 mos and I cannot seem to locate whatever program I used to do this. Sorry I can't give more info.

If you did get a graphic to work and you planned to upload these with a map file, you would have to be careful that players got them into the right folders (ES did not do so when they released the Hipaniola map initially in a patch, and the graphic section was black until you put the file into the proper place)

[This message has been edited by RF_Gandalf (edited 05-17-2006 @ 09:09 PM).]

Orca
Skirmisher
posted 05-18-06 06:49 AM EDT (US)     14 / 735       
I managed to convert the ddt files at this location with the AOMed tool : http://aom.heavengames.com/scendesign/modding/tutorial

Looking at the converted files it seems those are only the map overview files (where the region is located among other regions).
I cant figure out where the screenshotfiles are (located at the bottom left while a map is loading). They should be there too because the path in xml file is something like :
ui\random_map\new_england\new_england_ss_01
However I cant find them anywhere in my AoE3 installation

Edit : Still havent found those files but you can create your own screenshots convert them to ddts and use them by linking them in your xml file. Since this is maybe of general interest I copypaste the lines in the xml you have to change to the according directory to make things clearer :

loadBackground="ui\random_map\butterfly\bf_location">
loadss ui\random_map\butterfly\bf_screen loadss

where bf_location and bf_screen are my ddt files.


[This message has been edited by Orca (edited 05-24-2006 @ 05:16 AM).]

Buz
Skirmisher
posted 05-20-06 06:19 PM EDT (US)     15 / 735       
Hi Gandalf,
I looked at the dogleg islands script and it might just as well have been in Latin! However, one more question, how do you place herdables on a map like Amazonia for example which does'nt have any..

Thanx
Bob

RF_Gandalf
Skirmisher
posted 05-20-06 07:02 PM EDT (US)     16 / 735       
simple reply - copy and paste from a map that has them! Quicker than doing it from scratch.

Be sure that you have in your new script any class definitions and constraints that are used in the creation of the sheep/cows/llamas. Be sure that the created object has a unique identifier.

You can edit the statements to change the type, the number, the distance from the players, whatever. Studying other maps is basically the best way to learn how to do something, then try it and then change to get what you want.

Buz
Skirmisher
posted 05-20-06 07:22 PM EDT (US)     17 / 735       
Hi again...
Sorry to appear a complete tit, but I tried copy and paste and it threw an error! I placed cows below the pronghorn on the great plains map as below -

// pronghorn
int pronghornID=rmCreateObjectDef("pronghorn herd");
rmAddObjectDefItem(pronghornID, "pronghorn", rmRandInt(6,9), 10.0);
rmSetObjectDefMinDistance(pronghornID, 0.0);
rmSetObjectDefMaxDistance(pronghornID, rmXFractionToMeters(0.5));
rmAddObjectDefConstraint(pronghornID, avoidBison);
rmAddObjectDefConstraint(pronghornID, avoidPronghorn);
rmAddObjectDefConstraint(pronghornID, avoidAll);
rmAddObjectDefConstraint(pronghornID, avoidImpassableLand);
rmAddObjectDefConstraint(pronghornID, avoidTradeRoute);
rmAddObjectDefConstraint(pronghornID, avoidSocket);
rmAddObjectDefConstraint(pronghornID, avoidStartingUnits);
rmAddObjectDefConstraint(pronghornID, avoidNuggetSmall);
rmSetObjectDefCreateHerd(pronghornID, true);
rmPlaceObjectDefAtLoc(pronghornID, 0, 0.5, 0.5, cNumberNonGaiaPlayers*2);

int cowID=rmCreateObjectDef("cow");
rmAddObjectDefItem(cowID, "cow", 2, 4.0);
rmSetObjectDefMinDistance(cowID, 0.0);
rmSetObjectDefMaxDistance(cowID, rmXFractionToMeters(0.5));
rmAddObjectDefConstraint(cowID, avoidCow);
rmAddObjectDefConstraint(cowID, avoidAll);
rmAddObjectDefConstraint(cowID, playerConstraint);
rmAddObjectDefConstraint(cowID, avoidCliffs);
rmAddObjectDefConstraint(cowID, avoidImpassableLand);
rmPlaceObjectDefAtLoc(cowID, 0, 0.5, 0.5, cNumberNonGaiaPlayers*3);

Did'nt work.. is it in the wrong place? or have I missed something out elsewhere?

Felix Hermansson
Skirmisher
posted 05-21-06 01:48 AM EDT (US)     18 / 735       
Did you check if all constraints are defined? That's often a problem when you copy code from one script to another, I'd look there first.
Buz
Skirmisher
posted 05-21-06 08:10 AM EDT (US)     19 / 735       
Hi Felix,
I'm at the end of my tether...I've been looking at the difference between the scripts for so long now, It's getting to the point where I don't know what I'm looking at anymore!!! If you could please do me a favour if you have the time, could you place herdables (sheep, llamas any sort) on the Bayou map for me and e-mail the .xs to rjsbuz@yahoo.com
It would stop me from slashing my wrists!!! I could then compare what you have placed to the original...
Many, many thanx
Bob
Orca
Skirmisher
posted 05-21-06 08:53 AM EDT (US)     20 / 735       

I cant see any syntax fault so should be a missing constraint.

Try outcommenting all constraints, should work then. After that put them in again one by one and see where it fails, after that get the appropriate constraint from the map you have copied the things from, if this still wont work look if the constraint you just copied in needs a class definition and copy that either.

Buz
Skirmisher
posted 05-21-06 08:58 AM EDT (US)     21 / 735       
Thanx Orca,
I will give that a shot.. but I'm as much good at RM scripts as a one-legged man in an ass kicking contest..
Buz
Skirmisher
posted 05-28-06 11:03 AM EDT (US)     22 / 735       
Hi,
Given a map where say the players are placed in a circle round the edge and have a native village close to each player, how can you place maybe 1 or 2 more native villages near the center of the map so regardless of how many players there are the extra ones in the middle will always be there?
Orca
Skirmisher
posted 05-28-06 01:26 PM EDT (US)     23 / 735       
There are different ways to do this, here is one :
Create an area located in the middle, place the Indian Settlements into this area - you are done.
I have done this in one of my maps here is the code :

// GET PLAYER LOCATIONS
x1 = rmPlayerLocXFraction(1);
z1 = rmPlayerLocZFraction(1);
x2 = rmPlayerLocXFraction(2);
z2 = rmPlayerLocZFraction(2);

...

float middlex = (x1+x2+x3+x4+x5+x6+x7+x8) / cNumberNonGaiaPlayers;
float middlez = (z1+z2+z3+z4+z5+z6+z7+z8) / cNumberNonGaiaPlayers;

// INDIANS AT CENTER
int IndianAID=rmCreateArea("Indian A");
rmSetAreaSize(IndianAID, 0.05, 0.05);
rmSetAreaCoherence(IndianAID, 1.0);
rmSetAreaTerrainType(IndianAID, "carolina_grass");
rmSetAreaBaseHeight(IndianAID, 6.0);
rmSetAreaLocation(IndianAID,middlex,middlez);
rmBuildArea(IndianAID);

int comancheVillageAID4 = -1;
int comancheVillageType4 = rmRandInt(1,5);
comancheVillageAID4 = rmCreateGrouping("comanche village A4", "native Comanche village "+comancheVillageType4);
rmAddGroupingConstraint(comancheVillageAID4, avoidTradeRoute);
rmAddGroupingConstraint(comancheVillageAID4, avoidSocket);
rmAddGroupingConstraint(comancheVillageAID4, avoidTC4Plus);
rmAddGroupingConstraint(comancheVillageAID4, circleIndianConstraint);
rmAddGroupingToClass(comancheVillageAID4, rmClassID("natives"));
rmAddGroupingConstraint(comancheVillageAID4, avoidNatives);
rmAddGroupingConstraint(comancheVillageAID4, avoidStartingUnits);
rmPlaceGroupingInArea(comancheVillageAID4, 0, IndianAID);


To simplify things i have removed some code out of the original, should still work I havent tested it though.

[This message has been edited by Orca (edited 05-28-2006 @ 01:40 PM).]

Buz
Skirmisher
posted 05-28-06 01:53 PM EDT (US)     24 / 735       
Thanx, will give that a try..
BTW, which map was that code used and where could I get it to study?

Bob

[This message has been edited by Buz (edited 05-28-2006 @ 01:57 PM).]

Orca
Skirmisher
posted 05-28-06 05:03 PM EDT (US)     25 / 735       
Its not released yet ^^. I will post link.
« Previous Page  1 2 3 ··· 10 ··· 20 ··· 30  Next Page »
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Empires III Heaven | HeavenGames