Random start position

Epos

Chieftain
Joined
Mar 31, 2002
Messages
11
Location
Copenhagen
I have made a map with good start position for every player. Placed random start position, but every time i start the scenario, it places the human player on the same start position. And i would like to be 'placed' random.
 
I have made a map with good start position for every player. Placed random start position, but every time i start the scenario, it places the human player on the same start position. And i would like to be 'placed' random.
Unfortunately, it never seems to actually place the human player randomly. It will look at all of the available starting points and assign the "best" one (as determined by the game) to the human player.
 
Ok. Thats bad, but then again, now i 'just' have to make all the starting point equal.. Thank you for the rapid answer.
 
Ok. Thats bad, but then again, now i 'just' have to make all the starting point equal.. Thank you for the rapid answer.
I still don't know that doing so would work. I suspect that the human player will always get the same starting point on any given map which has pre-defined starting locations; this would be easy to test on custom maps, though (just make two locations that are exactly identical for the whole 3-ring city radius, and test it a few times to see if you ever get the opposite starting location).
 
I started looking into this the other night, as I would prefer this ability as well. As best I can tell, the logic for placing based on an already-existing starting location is not exposed, but I *think* a work around can be done.

In the loading screen lua file (Loadscreen.lua, I think?), it controls when the splash/background is displayed. Toward the end of that file, once everything has finished loading, it will hide the background. My thinking, and what I started to work on the other night (but didn't finish), is at the point before the background is hidden (revealing the map), the human player and a random AI player swap their locations. Basically you would need to:

1. Identify the location of all of the human player units.
2. Identify the AI player you're swapping with (I don't know yet if it's worthwhile to limit this to major civs or not), identify all of the AI player units.
3. Place the human player units in a holding area not near any other player's units (I don't know if having proximity to another player's units at this time would trigger the "meet player" logic yet.) - basically a temp location.
4. Delete existing human player units.
5. Place AI player units at former human player location. "Unreveal" map for previous AI player location (not sure if this can be done either...)
6. Place Human player at old AI player location. Unreveal map at previous location.

The easy part, the random - basically find number of civs, grab whatever time it shows on the second hand of the clock, and divide that number by the #civs. If it's 0, no swap. If it's anything else, swap with that AI player. If I get it functioning, I'll upload it to the mods area.
 
ok. Thank you. Another puzzle i have. When you add players in worldbuilder, is there a way to make the player random?
 
ok. Thank you. Another puzzle i have. When you add players in worldbuilder, is there a way to make the player random?

Well...

If you are just doing a map (no scenario), then yes. Just add another "Random Player" starting point.

If you are doing a scenario that has some specific civilizations already added, then not really; if you have any specific civs selected, my experience has been that you must have all major civs that will be used selected. As I recall, though, you can work around this by including all major civs.
 
It is a scenario, so i will try to make it contain almost all the major civs.

off-topic:
Join Date: Mar 2002
Posts: 10

Man, thats a long time, and a few posts :) Not much of a poster, but been a huge lurker. Thank you all for a great forum here at Civfanatics.
 
you win the lurker award - my 29 posts didn't start until civ5 came out - lurking since '06 :)

I managed to get a basic version of the unit swap working - where i will swap start positions with another AI player, but havent' figured out how to properly:
1. keep all of the old points on the map hidden (I can use the SetReveal function but it doesn't change what's on the mini-map)
2. keep the AI player that I swapped with from contacting me (prob has to do with #1)
 
Back
Top Bottom