• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!

Randomized Starting Locations

Status
Not open for further replies.
Level 2
Joined
Oct 17, 2007
Messages
20
What is the best way to randomize which users get assigned to which starting positions?

With triggers, I would give each user control of a random, unassigned set of units, and move the user's view to the appropriate starting location.

Is there a simpler way to implement this? I have unchecked "Fixed Start Location" in Scenario Properties, but that doesn't seem to have an effect. What does that do?
 
Level 4
Joined
Sep 19, 2007
Messages
78
im not sure if this will work but create some triggers that spawn group of units in center of region, then set some triggers that randomize the start location for player 1 red (im not exactly sure how to do this) then set a few variables like x y and z (if you have 3 regions for example) then set some triggers that say if X is true then player 1 red receives all units in region 1(which is X in the eg.) and if x is false and y is true the red receives all units in region 2(which is Y in the eg.) and so forth... im not quite sure how to do a bit of this but i think it will work you just gotta find the appropriate triggers... hope this helped
Turok.:infl_thumbs_up:
 
Level 9
Joined
Aug 15, 2007
Messages
261
  • spawn
  • Events
  • Mapinitialization
  • Conditions
  • Actions
  • Unit - Crate 1 DH HERO for player 1 red at random point in region1 (playeblemap erea)
  • Unit - Crate 1 DH HERO for player 2 blue at random point in region2 (playeblemap erea)
the start location's doesnt matter if you make the camera to be fixed on the hero
whit playble map area I meen that you can make the region to be over the whole map
that's the easyest way so if you are not interested of it I can think of something else (harder)
:infl_thumbs_up:
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Saio, that trigger would mess up the entire game. You don't want your hero to spawn in the middle of the worst creep of the map.

What he wants is some sort of unit spawn at a random starting location.

Volty, I don't know what you need this for, but by default the starting units will be created at a RANDOM starting location (like in melee games). What you could do is remove all "worker" units and replace the town hall by your hero...
 
Level 2
Joined
Oct 17, 2007
Messages
20
Thank you all for your responses. What confused me was that you could make player's starting locations "unfixed" but that wouldn't effect who owns what units at the start of the game. That is, if you have a base that belongs to player 1, and another base that belongs to player 2, and you have them both with unfixed starting locations, then you just end up with a chance that your players' cameras end up in the wrong bases at game start. What I needed to do is either swap control of the bases according to who starts where, or spawn the bases for each player following game start. Since in my case, the "base" is a single unit, the latter was the easier approach:

1) In Scenario Properties -> Players, have Fixed Start Location unchecked for everyone I want to have a random start.
2) Run a trigger of
Event
Map initialization
Action
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Unit - Create 1 Fortress for (Picked player) at ((Picked player) start location) facing Default building facing degrees

The game handles the randomization of player starting locations, and you can reference the location of the starting location (for spawning the desired starting units) like I did above. Starting location also controls where the camera starts for each player, so that is taken care of without any additional work.
 
Level 9
Joined
Aug 15, 2007
Messages
261
1) In Scenario Properties -> Players, have Fixed Start Location unchecked for everyone I want to have a random start.
2) Run a trigger of
  • Event
    • Map initialization
  • Action
    • Player Group - Pick every player in (All players) and do (Actions)
      • Loop - Actions
        • Unit - Create 1 Fortress for (Picked player) at ((Picked player) start location) facing Default building facing degrees
  • [COLOR="Red"]camera - move camera to posiotin of last crated unit[/COLOR]
whit red i selected what I fixed hope that work's and about geting firest man that's not a game I just wanna help
 
Status
Not open for further replies.
Top