thasdasdas
Would you like to react to this message? Create an account in a few clicks or log in to continue.

AOE_Fan's RMS Command Tutorial

4 posters

Go down

AOE_Fan's RMS Command Tutorial Empty AOE_Fan's RMS Command Tutorial

Post by AOE_Fan Sat 31 Dec 2011 - 3:24

I have wanted to do a tutorial about RMS commands, and finally I had time for it. Firstly, there are few things you should know:

1. This tutorial doesn't teach you how to make Random Maps, you still need time to learn it!
2. This tutorial only tells about different functions in Random Maps, you still need to look at different maps to see how they are actually made!
3. I really recommend you to read Monty_Python's RMS Tutorial before looking at this thread, it explains many basic things you need to know!

1. General Commands

Spoiler:

This tutorial has been paused for some time.
AOE_Fan
AOE_Fan
K&B Leader
K&B Leader

Posts : 3615
Join date : 2011-05-27

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by checanos Fri 4 Apr 2014 - 8:18

This is useful. Thanks! I currently am having problems with natives, sometimes they show up and sometimes they don't. Any ideas on why that happens?
checanos
checanos
Peasant
Peasant

Age : 26
Posts : 15
Join date : 2012-06-02

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by AOE_Fan Fri 4 Apr 2014 - 23:25

There can be several issues:
1. Obvious coding errors. However because the natives show up sometimes, this is not the case.
2. Randomization. Are you sure there is no designed randomness factor with the natives like showing up only 50% of times?
3. Too heavy constraints. You may have set the native settlements to avoid players or other settlements too much and they simply haven't got enough possible places.
4. Not enough space. I ALWAYS place the native settlements (and trading posts) before forests, mines or animals, so that there is enough space for them. You also have to make sure these other things then avoid the settlements!
5. Wrong place/position. Native settlements cannot be placed on water or on unbuildable terrains, make sure you have proper constraints (but again, not too much).
AOE_Fan
AOE_Fan
K&B Leader
K&B Leader

Posts : 3615
Join date : 2011-05-27

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by checanos Sat 5 Apr 2014 - 11:05

It probably does not help that I modified an existing map. I'm still a newbie when it comes to RMS. It Should not be a problem because I just changed the names of the Natives, not their positions. It could be because originally in Ozarks, there are three native choices, I only have two.

Ozarks


My Map
checanos
checanos
Peasant
Peasant

Age : 26
Posts : 15
Join date : 2012-06-02

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by AOE_Fan Sat 5 Apr 2014 - 21:33

I see the problem but instead of only posting a fixed script, I'll go through it so you can understand it better. Smile

The script has a randomized integer whichNative with random value of 1-6.
In the original script
- If whichNative is below 3, both of the natives are Comanche.
- If whichNative is 3, both of the natives are Cheyenne.
- If whichNative is something else (4, 5 or 6), both of the natives are Cherokee.

In your script
- If whichNative is below 3, both of the natives are Woodsmen.
- If whichNative is 3, both of the natives are Beornings.
- If whichNative is something else (4, 5 or 6), no natives are defined = no natives appear.

Basically you should edit the allowed values of whichNative integer. If you just want 2 possibilities, values of 1 and 2 should be fine. And also, original Aoe3 RMs have crappy and messy coding...
AOE_Fan
AOE_Fan
K&B Leader
K&B Leader

Posts : 3615
Join date : 2011-05-27

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by Pepp Sat 5 Apr 2014 - 23:33

And pretty creepy...
Pepp
Pepp
Moderator
Moderator

Age : 28
Posts : 5277
Join date : 2011-04-29

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by checanos Mon 7 Apr 2014 - 1:23

And for the Map to show up in skirmish, do I just have to keep the xml and xs files in the RM3 foldor?
checanos
checanos
Peasant
Peasant

Age : 26
Posts : 15
Join date : 2012-06-02

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by dietermoreno Mon 7 Apr 2014 - 18:43

Remember you should have a back up for both ozark.xml and ozark.xs before modifying them.

Then yes you put the modified ozark.xml and ozark.xs in the RM3 folder...if you have TAD installed.

RM: vanilla

RM2: TWC

RM3: TAD

Quick pointers that you may be stuck on (I was in the past):

(1) Remember that you must put the ozark.xml and ozark.xs files in BOTH the C:/.../Documents/My Games/Age of Empires III/RM3/ AND the C:/.../Microsoft Games/Age of Empires III/RM3/, or else the map won't load.

(2) Remember that you must click "Custom Maps" in the skirmish screen for your map to be available to click on in the drop-down menu.



To help you with your editing, here is the minimum possible map script for a map to load:
Code:

void main() {
rmSetMapSize(100, 100);
rmTerrainInitialize();
for (i=1;<cNumberPlayers) {
   rmPlacePlayer(i, .5, .5);
   int id = rmCreateArea("p"+i);
   rmSetPlayerArea(i, id);
   int start = rmCreateObjectDef("s"+i);
   rmAddObjectDefItem(start, "explorer", 1, 50.0);
   rmPlaceObjectDefAtLoc(start, i, .5, .5);
}
}


I don't recommend custom map scripting from scratch for now, because I have made no progress on it so far and no one who has cares to share how they did it.

Maybe I will figure it out eventually and be teaching everyone how to do it.




I tried to make my own command tutorial, and I didn't get past an introduction before I gave up.  Maybe I will get to part I eventually.

Summer comming soon and me buying a new hard drive so I have room to mod AoE3 is a good sign for my learning of the commands.


What particularly draws me to RMS is that I don't really need a teacher like with modeling because to get results you just try typing in different codes for hours until something works.



Hhm, I've never played Ozarks and now I never will after seeing the natives in that code AoE Fan posted. At least I won't play on Ozarks until I can make the natives more historically accurate. Souix on the Ozarks is just E.S. not even trying.
dietermoreno
dietermoreno
Enemy of the Realm
Enemy of the Realm

Age : 32
Posts : 121
Join date : 2012-12-29

https://www.youtube.com/dietermoreno

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by Pepp Tue 8 Apr 2014 - 2:04

Lel, you don't even have made one.
Pepp
Pepp
Moderator
Moderator

Age : 28
Posts : 5277
Join date : 2011-04-29

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by AOE_Fan Tue 8 Apr 2014 - 7:07

And also, this is incorrect... RTFM 
(1) Remember that you must put the ozark.xml and ozark.xs files in BOTH the C:/.../Documents/My Games/Age of Empires III/RM3/ AND the C:/.../Microsoft Games/Age of Empires III/RM3/, or else the map won't load.
You definitely don't need to place the map into two folders.
AOE_Fan
AOE_Fan
K&B Leader
K&B Leader

Posts : 3615
Join date : 2011-05-27

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by checanos Thu 10 Apr 2014 - 10:32

Hello it's me again with another problem. (Tell me if this bothers you, then I will stop)

I'm trying to insert herdables into a map, but it crashes. I put the constraints and then I put the placement. The placement causes it to crash. Is there a reason? Or does the RM overlord just not like me...

Code:
  //herdable1
  int herdable1ID=rmCreateObjectDef("herdable1");
  rmAddObjectDefItem(herdable1ID, herdable1, 2, 3.0);
  rmSetObjectDefMinDistance(herdable1ID, 0.0);
  rmSetObjectDefMaxDistance(herdable1ID, rmXFractionToMeters(0.5));
  rmAddObjectDefConstraint(huntable2ID, avoidHuntable2);
  rmAddObjectDefConstraint(huntable2ID, avoidHuntable1);
  rmAddObjectDefConstraint(herdable1ID, avoidHerdable1);
  rmAddObjectDefConstraint(herdable1ID, avoidAll);
  rmAddObjectDefConstraint(herdable1ID, avoidSocket);
  rmAddObjectDefConstraint(herdable1ID, avoidTradeRoute);
  rmAddObjectDefConstraint(herdable1ID, avoidImpassableLand);
  rmAddObjectDefConstraint(herdable1ID, longPlayerConstraint);
  rmPlaceObjectDefAtLoc(herdable1ID, 0, 0.5, 0.5, cNumberNonGaiaPlayers*2);
checanos
checanos
Peasant
Peasant

Age : 26
Posts : 15
Join date : 2012-06-02

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by Pepp Sun 13 Apr 2014 - 23:26

There is something funny, but might not be the problem:
rmAddObjectDefConstraint(huntable2ID, avoidHuntable2);
rmAddObjectDefConstraint(huntable2ID, avoidHuntable1);

I don't really remember what is wrong... I haven't script a map for years.
Pepp
Pepp
Moderator
Moderator

Age : 28
Posts : 5277
Join date : 2011-04-29

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by dietermoreno Thu 22 May 2014 - 7:37

Can musketeer please reupload his RMS tutorial somewhere?  The link on the tutorial database for his tutorial doesn't work anymore.



Edit: Never mind, I found it here in a "web archive". http://web.archive.org/web/20100421112530/http://hyenastudios.mugamo.com/aoe3rmstutorial.htm

But I'm not sure if the web archive is viewable on other sites. Well I don't know how web archives work. The link on the Wotta tutorial database doesn't work and the tutorial is no longer included in the AoE3H tutorial database.
dietermoreno
dietermoreno
Enemy of the Realm
Enemy of the Realm

Age : 32
Posts : 121
Join date : 2012-12-29

https://www.youtube.com/dietermoreno

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by checanos Tue 29 Jul 2014 - 8:12

Hello it is me again. I have encountered another problem with natives. I have a modified version of Deccan. I am trying to change the natives but I don't know what to change. I have tried by changing the names but then an error comes up.

Code:
  // Natives
  
  int randomNative1 = rmRandInt(1,3);
  int randomNative2 = rmRandInt(1,3);
  
  string nativeString1 = "native udasi village ";
  string nativeString2 = "native bhakti village ";
  string nativeString3 = "native sufi mosque deccan ";
  
  string stringNative1 = "";
  string stringNative2 = "";
  
  if(randomNative1 == 1)
    stringNative1 = nativeString1;
  
  else if (randomNative1 == 2)
    stringNative1 = nativeString2;
  
  else
    stringNative1 = nativeString3;
    
  if(randomNative2 == 1)
    stringNative2 = nativeString1;
  
  else if (randomNative2 == 2)
    stringNative2 = nativeString2;
  
  else
    stringNative2 = nativeString3;
  
  
  if (subCiv0 == rmGetCivID("Udasi")) {  
    int udasiVillageAID = -1;
    int udasiVillageType = rmRandInt(1,5);
    udasiVillageAID = rmCreateGrouping("Udasi village A", stringNative1+udasiVillageType);
    rmSetGroupingMinDistance(udasiVillageAID, 0.0);
    rmSetGroupingMaxDistance(udasiVillageAID, 10.0);
    rmAddGroupingConstraint(udasiVillageAID, avoidImpassableLandFar);
    rmAddGroupingConstraint(udasiVillageAID, playerConstraint);
    rmAddGroupingConstraint(udasiVillageAID, avoidImportantItemFar);
    rmAddGroupingToClass(udasiVillageAID, rmClassID("importantItem"));
    
    if(cNumberTeams > 2) {
      if(whichVersion == 1)
        rmPlaceGroupingAtLoc(udasiVillageAID, 0, 0.2, 0.8);
    
      else
        rmPlaceGroupingAtLoc(udasiVillageAID, 0, 0.8, 0.8);
    }
    
    else {
      //~ rmPlaceGroupingInArea(udasiVillageAID, 0, startingCliff1, 1);
      rmPlaceGroupingAtLoc(udasiVillageAID, 0, 0.5, 0.6);
    }
  }
    
  if (subCiv1 == rmGetCivID("Bhakti")) {  
      int bhaktiVillageAID = -1;
      int bhaktiVillageType = rmRandInt(1,5);
      bhaktiVillageAID = rmCreateGrouping("Bhakti village A", stringNative2+bhaktiVillageType);
      rmSetGroupingMinDistance(bhaktiVillageAID, 0.0);
      rmSetGroupingMaxDistance(bhaktiVillageAID, 10.0);
      rmAddGroupingConstraint(bhaktiVillageAID, avoidImpassableLandFar);
      rmAddGroupingToClass(bhaktiVillageAID, rmClassID("importantItem"));
      rmAddGroupingConstraint(bhaktiVillageAID, playerConstraint);
      rmAddGroupingConstraint(bhaktiVillageAID, avoidImportantItemFar);
      
    if(cNumberTeams > 2) {
      if(whichVersion == 1)
        rmPlaceGroupingAtLoc(bhaktiVillageAID, 0, 0.8, 0.2);  
      
      else
        rmPlaceGroupingAtLoc(bhaktiVillageAID, 0, 0.2, 0.2);
     }
    
    else {
      //~ rmPlaceGroupingInArea(bhaktiVillageAID, 0, startingCliff1, 1);
      rmPlaceGroupingAtLoc(bhaktiVillageAID, 0, 0.5, 0.4);
    }
  }

Does anyone know what I am supposed to change?

Is there an easier way to implement natives that doesn't involve changing existing code. Are there simpler lines of code?
checanos
checanos
Peasant
Peasant

Age : 26
Posts : 15
Join date : 2012-06-02

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by Pepp Tue 29 Jul 2014 - 12:42

The grouping is what you have to change. Here:
Code:
    udasiVillageAID = rmCreateGrouping("Udasi village A", stringNative1+udasiVillageType);

Compare it with another map's code, so you'll know what will change the grouping.
Pepp
Pepp
Moderator
Moderator

Age : 28
Posts : 5277
Join date : 2011-04-29

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by AOE_Fan Tue 29 Jul 2014 - 20:27

I try to avoid using external integers that TAD developers clearly loved very much. By doing this, you can compress your script a tiny bit. This is what I'd do:
Code:
   if (randomNative1 == 1)
       udasiVillageAID = rmCreateGrouping("Udasi village A", "native udasi village "+udasiVillageType);
    else if (randomNative1 == 2)
       udasiVillageAID = rmCreateGrouping("Bhakti village A", "native bhakti village "+udasiVillageType);
    else
       udasiVillageAID = rmCreateGrouping("Sufi village A", "native sufi mosque deccan "+udasiVillageType);
AOE_Fan
AOE_Fan
K&B Leader
K&B Leader

Posts : 3615
Join date : 2011-05-27

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by checanos Wed 30 Jul 2014 - 0:10

Well I tried that and it crashes :/ But I also don't need a random native since there will be only one type.

EDIT: I got it working Smile after a lot of trail and error. Thanks for helping @Pepp @AOE_Fan.
checanos
checanos
Peasant
Peasant

Age : 26
Posts : 15
Join date : 2012-06-02

Back to top Go down

AOE_Fan's RMS Command Tutorial Empty Re: AOE_Fan's RMS Command Tutorial

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum