Pretty much this, as I need to test a mod and I want to reliably acess a specific mercenary without using a concrete civ with a concrete card.
Outlaws are based on map while mercenaries are the random ones.
You can make the avaible per map when you mod the " map specific techs" file
bonjour
it’s actually easier than modding the mapspecifictechs… you can manage this simply by editing a map script
rmDisableDefaultMercs(true);
rmDisableCivTypeMercRestriction(true);
rmEnableOutlaw("insertprotounitnamehere");
rmEnableMerc("insertmercPUhere", -1);
But, if they want to do such action for every map ?
Couldn’t they go by grouping in Theorie
I thought the OP was asking about testing specific changes to a specific merc… but yeah if it’s desired across multiple maps you could do it that way I suppose.
This is extremely helpful. Mapspecifictechmods is bugged and doesn’t work for custom maps so it was a massive pain to add custom outlaws.
Is there a command that only disables the default outlaws? That way I wouldn’t have to add another step within the map for picking random mercs. Or is there a command that would do that too?
Also is there a command for enabling techs? Or is that only done with triggers?
For outlaws, the first command should do that. I know it says mercs but I believe it does both.
The second command is for static outlaws like TAR and TWC civs.
I think what you’re asking about regarding techs requires a trigger.
So nothing that disables just outlaws and leaves the mercs? Ideally I’d like to not change anything about mercs while setting my own outlaws (and I’m not altering the static ones). Using rmDisableDefaultMercs(true);
means I’ve got to put the random merc selection back into the map which is doable but slightly tedious.
tedious yeah… welcome to RMS! 21
unfortunately i think that’s how you’d have to do it
here’s an example of how to do some RNG for 2 outlaws (easily changed for 3 mercs or whatever number of outlaws/mercs you want)
int outlawCount = 2;
for(n = 0; < outlawCount) // picks 2 outlaws
{
rmEchoInfo("choosing outlaws"+n);
if (rmRandInt(1,5) == 1 && crabatOutlaw != 1)
{
rmEnableOutlaw("deSaloonCrabat");
crabatOutlaw = 1;
rmEchoInfo("outlaw is crabat");
}
else if (rmRandInt(1,4) == 1 && hajdukOutlaw != 1)
{
rmEnableOutlaw("deSaloonHajduk");
hajdukOutlaw = 1;
rmEchoInfo("outlaw is hajduk");
}
else if (rmRandInt(1,3) == 1 && highwayOutlaw != 1)
{
rmEnableOutlaw("deSaloonHighwaymanRider");
highwayOutlaw = 1;
rmEchoInfo("outlaw is highwayman");
}
else if (rmRandInt(1,2) == 1 && inquisitorOutlaw != 1)
{
rmEnableOutlaw("deSaloonInquisitor");
inquisitorOutlaw = 1;
rmEchoInfo("outlaw is inquisitor");
}
else if (cossackOutlaw != 1)
{
rmEnableOutlaw("deSaloonOutlawCossackRider");
cossackOutlaw = 1;
rmEchoInfo("outlaw is cossack");
}
else
{
outlawCount++; // ensures 2 are always chosen
}
}
and ofc you need ot make sure everything is defined
Is it possible to use an array in RMS? If so, something like this should work:
int merc1=1;
int merc2=1;
int merc3=1;
while(((merc1==merc2)||(merc1==merc3))||(merc2==merc3)){
merc1=rmRandInt(0,30);
merc2=rmRandInt(0,30);
merc3=rmRandInt(0,30);
}
string MercList[]={"SaloonBlackRider","SaloonCorsair","SaloonElmeti","SaloonMameluke","SaloonManchu","SaloonNinja","deSaloonHarquebusier","SaloonHighlander","SaloonLandsknecht","SaloonStradiot","SaloonJaeger","SaloonSwissPikeman","SaloonFusilier","ypSaloonArsonist","SaloonGreatCannon","DESaloonNapoleonGun","DESaloonZouave","DESaloonSudaneseRider","DESaloonCannoneer","DESaloonAskari","DESaloonAmazon","DESaloonZenata","DESaloonGatlingCamel","DESaloonKanuri","deSaloonGrenadier","deSaloonPandour","deSaloonRoyalHorseman","deSaloonPistoleer","deSaloonBrigadier","deSaloonMountedRifleman","deSaloonBosniak"};
rmEnableMerc(MercList[merc1], -1);
rmEnableMerc(MercList[merc2], -1);
rmEnableMerc(MercList[merc3], -1);
I haven’t been successful with it yet, but I’m not sure if that’s due to an error I’m making or if it isn’t supported.
Also, what does the -1 in the function below define? Is it player number?
rmEnableMerc("insertmercPUhere", -1);
I’m not that smart tbh
I tried using arrays before, but they not seem to be compatible or have an specific way to be declared.
The scenario scripting language used for Age of Empires III is not based on C or any other mainstream programming language. It’s a domain-specific language (DSL) designed specifically for creating scenarios and maps within the game. While it may borrow some syntax conventions from languages like C or Java, its functionality and purpose are entirely focused on manipulating the game environment and assets rather than general-purpose programming tasks.
So we may need some help from advance programmers to see all the libraries and confirm if arrays are compatible.
I found a forum discussion with someone describing how to do it. I’ll give it a try and see if it works.
https://aoe3.heavengames.com/cgi-bin/forums/display.cgi?action=ct&f=12,32865,930,all
I’ll try to teach an old dog new tricks then.
I gave it a try and this method does actually work. Still a bit clunky since I’m setting each array value one at a time but it seems to be a slight improvement on vividly’s method. Maybe there’s an easier way to populate the array without calling xsArraySetString
each time.
rmDisableDefaultMercs(true);
rmEnableOutlaw("SaloonPirate");
rmEnableOutlaw("SaloonOutlawRifleman");
int merc1=1;
int merc2=1;
int merc3=1;
while(((merc1==merc2)||(merc1==merc3))||(merc2==merc3)){
merc1=rmRandInt(0,30);
merc2=rmRandInt(0,30);
merc3=rmRandInt(0,30);
}
int MercList = xsArrayCreateString(31, "", "merc list");
xsArraySetString(MercList, 0, "MercBlackRider");
xsArraySetString(MercList, 1, "MercBarbaryCorsair");
xsArraySetString(MercList, 2, "MercElmeti");
xsArraySetString(MercList, 3, "MercMameluke");
xsArraySetString(MercList, 4, "MercManchu");
xsArraySetString(MercList, 5, "MercNinja");
xsArraySetString(MercList, 6, "deMercHarquebusier");
xsArraySetString(MercList, 7, "MercHighlander");
xsArraySetString(MercList, 8, "MercLandsknecht");
xsArraySetString(MercList, 9, "MercStradiot");
xsArraySetString(MercList, 10, "MercJaeger");
xsArraySetString(MercList, 11, "MercSwissPikeman");
xsArraySetString(MercList, 12, "MercFusilier");
xsArraySetString(MercList, 13, "ypMercArsonist");
xsArraySetString(MercList, 14, "MercGreatCannon");
xsArraySetString(MercList, 15, "DEMercNapoleonGun");
xsArraySetString(MercList, 16, "DEMercZouave");
xsArraySetString(MercList, 17, "DEMercSudaneseRider");
xsArraySetString(MercList, 18, "DEMercCannoneer");
xsArraySetString(MercList, 19, "DEMercAskari");
xsArraySetString(MercList, 20, "DEMercAmazon");
xsArraySetString(MercList, 21, "DEMercZenata");
xsArraySetString(MercList, 22, "DEMercGatlingCamel");
xsArraySetString(MercList, 23, "DEMercKanuri");
xsArraySetString(MercList, 24, "deMercGrenadier");
xsArraySetString(MercList, 25, "deMercPandour");
xsArraySetString(MercList, 26, "deMercRoyalHorseman");
xsArraySetString(MercList, 27, "deMercPistoleer");
xsArraySetString(MercList, 28, "deMercBrigadier");
xsArraySetString(MercList, 29, "deMercMountedRifleman");
xsArraySetString(MercList, 30, "deMercBosniak");
rmEnableMerc(xsArrayGetString(MercList, merc1), -1);
rmEnableMerc(xsArrayGetString(MercList, merc2), -1);
rmEnableMerc(xsArrayGetString(MercList, merc3), -1);
pftq is a wizard
I’m not a willing student but I appreciate the enthusiasm haha