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

Modding Discussions
Moderated by Alexastor, MosheLevi, Mister SCP

Hop to:    
Welcome! You are not logged in. Please Login or Register.No replies
Age of Empires III Heaven » Forums » Modding Discussions » RMS Spawn Randomization
Bottom
Topic Subject:RMS Spawn Randomization
blazinammo604
Skirmisher
posted 05-03-20 09:00 PM EDT (US)         
Hi,

I'm trying to create a randomized spawn system for a map where players spawn on the following coordinates:

rmPlacePlayer(1, 0.12, 0.22);
rmPlacePlayer(2, 0.31, 0.21);
rmPlacePlayer(3, 0.45, 0.25);
rmPlacePlayer(4, 0.5, 0.35);
rmPlacePlayer(5, 0.17, 0.17);
rmPlacePlayer(6, 0.23, 0.28);
rmPlacePlayer(7, 0.53, 0.17);
rmPlacePlayer(8, 0.6, 0.2);

Currently, in order to ensure that players always spawn in different locations, I have had to repeat the above code but change the player numbers, so that it looks like this:

if ( FFARandomizer == 1 )
{
rmPlacePlayer(1, 0.12, 0.22);
rmPlacePlayer(2, 0.31, 0.21);
rmPlacePlayer(3, 0.45, 0.25);
rmPlacePlayer(4, 0.5, 0.35);
rmPlacePlayer(5, 0.17, 0.17);
rmPlacePlayer(6, 0.23, 0.28);
rmPlacePlayer(7, 0.53, 0.17);
rmPlacePlayer(8, 0.6, 0.2);
}
if ( FFARandomizer == 2 )
{
rmPlacePlayer(8, 0.12, 0.22);
rmPlacePlayer(7, 0.17, 0.17);
rmPlacePlayer(6, 0.235, 0.14);
rmPlacePlayer(5, 0.3, 0.1);
rmPlacePlayer(4, 0.35, 0.05);
rmPlacePlayer(3, 0.4, 0.05);
rmPlacePlayer(2, 0.53, 0.17);
rmPlacePlayer(1, 0.6, 0.2);

I was wondering if there was any way to make this more efficient and more "random"--if there were a way in which I could swap out the player numbers for a variable that would always be an integer of 1-8 and would only ever exist as one of those numbers, so that all players are accounted for.

Below is an example of the desired effect:

rmPlacePlayer(1 or 2 or 3 etc.., 0.12,0.22);

Is there any way to achieve what I'm looking for? Any help would be greatly appreciated. Thanks!
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Empires III Heaven | HeavenGames