Page 1 of 1

Rms randomised placement.

Posted: 22 Nov 2019, 16:47
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.

Re: Rms randomised placement.

Posted: 22 Nov 2019, 18:40
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

Re: Rms randomised placement.

Posted: 23 Nov 2019, 05:26
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.

Re: Rms randomised placement.

Posted: 23 Nov 2019, 10:21
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.

Re: Rms randomised placement.

Posted: 23 Nov 2019, 13:33
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...

Re: Rms randomised placement.

Posted: 23 Nov 2019, 14:21
by HappySmurf
aha i get it, thanks Eaglemut, the AOEO rms engine is the same as the AOE3 engine.

Re: Rms randomised placement.

Posted: 27 Nov 2019, 06:36
by HappySmurf
Hey Aizamk
Can you explain me how this custom trigger can be made?

Re: Rms randomised placement.

Posted: 03 Dec 2019, 06:47
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. 

Re: Rms randomised placement.

Posted: 03 Dec 2019, 14:34
by edeholland

Code: Select all

You can format code using the "[code]" and "
" blocks.[/code]

Re: Rms randomised placement.

Posted: 04 Dec 2019, 03:25
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.