Rms randomised placement.

Here you can post about your scenario's, mods, custom maps and YouTube channels!
Netherlands HappySmurf
Crossbow
Posts: 5
Joined: Nov 21, 2019

Rms randomised placement.

Post by HappySmurf »

Hey guys,
Together with some other guys in working on the development of the romans in age of empires online.
Currently im experimenting besides the 3d models on new game modes.
I already have the rms script but cant figure out how to place the units random inside a painted area.
Here the part im reffering to:
var locquestareaC = utilsAH_convertareatotriggerstring("quest_area_C")

Area C is very large and i want it so that the units (which are spawned every 10 sec) are placed spread over the area instead of on 1 central point.
User avatar
Canada dansil92
Retired Contributor
Posts: 2232
Joined: Nov 3, 2018
ESO: dansil92

Re: Rms randomised placement.

Post by dansil92 »

rmPlaceObjectDefInRandomAreaOfClass(ObjectName, 0, rmClassID("classAreaName"), 1);

You'll just have to add a class to the area

OR


rmPlaceObjectDefInArea(objectName, 0, areanName, numberOfObjects);

Be warned non-guardian units placed by rms become invincible and aggressive unless assigned to a player
Image
User avatar
Malaysia Aizamk
Pro Player
ESOC WarChiefs Classic 2017
Posts: 1459
Joined: Feb 26, 2015
Location: ded

Re: Rms randomised placement.

Post by Aizamk »

What he's looking for is trigger-level though (spawns every 10 sec), not RMS level. I see no way about it other than to define your own custom trigger.
oranges.
Netherlands HappySmurf
Crossbow
Posts: 5
Joined: Nov 21, 2019

Re: Rms randomised placement.

Post by HappySmurf »

Nope aizamk,
Its fully rms code. The some parts could have ,as you say, be done with triggers but in this case i need it all in 1 rms file to swap it between different questfiles and scn's.
User avatar
Czech Republic EAGLEMUT
ESOC Dev Team
Donator 05
Posts: 4515
Joined: Mar 31, 2015
ESO: EAGLEMUT
Clan: WPact

Re: Rms randomised placement.

Post by EAGLEMUT »

He means it has to be done through the trigger api provided in RMS. Basically RMS code generates the initial map and that's it, it cannot spawn anything afterwards. However, it can create triggers as part of the initial map, which may then do something after the map is generated. Before AoEO, this was done by functions like rmCreateTrigger, not sure how this api looks like in AoEO, but I'd assume it was ported in some form. The kind of trigger effects needed also depend entirely on what trigger effects are available in AoEO, which I'm not familiar with, so it's hard to say...
Netherlands HappySmurf
Crossbow
Posts: 5
Joined: Nov 21, 2019

Re: Rms randomised placement.

Post by HappySmurf »

aha i get it, thanks Eaglemut, the AOEO rms engine is the same as the AOE3 engine.
Netherlands HappySmurf
Crossbow
Posts: 5
Joined: Nov 21, 2019

Re: Rms randomised placement.

Post by HappySmurf »

Hey Aizamk
Can you explain me how this custom trigger can be made?
Netherlands HappySmurf
Crossbow
Posts: 5
Joined: Nov 21, 2019

Re: Rms randomised placement.

Post by HappySmurf »

```
var locQuestAreaC = UtilsAH_ConvertAreaToTriggerString("Quest_Area_C");
var locQuestAreaD = UtilsAH_ConvertAreaToTriggerString("Quest_Area_D");
```

```UtilsWA_SpawnWaveLoop(
wavesStartDelay, //nDelay
ennemyPlayerIdSpearman, //nPlayer
new List<UnitDataSet>
{
new UnitDataSet("Gr_Inf_Spearman", 1)
}, //UnitData
(int)(wavesMaxTime / (wavesTime*3)), 
(wavesTime*3), //nGroupInterval
new List<string> {locQuestAreaC}, //SpawnLocList
new List<string> {locQuestAreaD}, //TargetLocList
wavesTime, //nWaveLoopInterval
false, //bLoopArmyCheck
-1); //PredefinedArmyID
```
I need it so that during the map all units spawn randomly inside the entire area C. so it plays out that all units come from all places to the centralised area D. Hope you can help me out. 
User avatar
Netherlands edeholland
ESOC Community Team
Donator 01
Posts: 5033
Joined: Feb 11, 2015
ESO: edeholland
GameRanger ID: 4053888
Clan: ESOC

Re: Rms randomised placement.

Post by edeholland »

Code: Select all

You can format code using the "[code]" and "
" blocks.[/code]
User avatar
Czech Republic EAGLEMUT
ESOC Dev Team
Donator 05
Posts: 4515
Joined: Mar 31, 2015
ESO: EAGLEMUT
Clan: WPact

Re: Rms randomised placement.

Post by EAGLEMUT »

HappySmurf wrote:aha i get it, thanks Eaglemut, the AOEO rms engine is the same as the AOE3 engine.
I don't think "same" is the right word, at least not from most perspectives I can think of. AoEO RMS is done in a completely different programming language, and I can tell you that the code snippet you posted above doesn't even resemble anything you could ever see in an AoE3 RM script.

Who is online

Users browsing this forum: No registered users and 2 guests

Which top 10 players do you wish to see listed?

All-time

Active last two weeks

Active last month

Supremacy

Treaty

Official

ESOC Patch

Treaty Patch

1v1 Elo

2v2 Elo

3v3 Elo

Power Rating

Which streams do you wish to see listed?

Twitch

Age of Empires III

Age of Empires IV