• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Vote for the theme of Hive's HD Modeling Contest #7! Click here to vote! - Please only vote if you plan on participating❗️

Player Start Positions

Status
Not open for further replies.
Level 3
Joined
Jul 13, 2008
Messages
38
When i run this function in my game it will not see player 1 red as red, instead it treats the start position of player Blue as red. Does anyone know what might be going on? I even tested moving start positions around and still thinks blue is red. Also Should i instead just use regions? The only problem i have with this is, this map is very player oriented, so if the problem i am having here reoccurs in other triggers I’m going to have a big mess to sort though later.

  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • If ((((Picked player) controller) Equal to User) and (((Picked player) slot status) Equal to Is playing)) then do (Unit - Create 1 Head Quarters Lv.1 for (Picked player) at ((Picked player) start location) facing Default building facing degrees) else do (Do nothing)
      • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across (Playable map area)
      • Player - Set (Picked player) Current gold to 250
      • Player - Set (Picked player) Current lumber to 1
      • Camera - Pan camera for (Picked player) to ((Picked player) start location) over 0.00 seconds
 
Level 16
Joined
Jun 25, 2008
Messages
1,043
when you convert players to numbers, red is actually 0, blue is 1, etc.
That might be your problem. Gimme a minute and I'll try to figure out a fix for you.

edit:
  • Actions
    • For each (Integer A) from 0 to 16, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Player((Integer A))) controller) Equal to User
            • ((Player((Integer A))) slot status) Equal to Is playing
          • Then - Actions
            • Unit - Create 1 Footman for (Player((Integer A))) at ((Player((Integer A))) start location) facing Default building facing degrees
            • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
            • Visibility - Enable (Last created visibility modifier)
            • Player - Set (Player((Integer A))) Current gold to 250
            • Player - Set (Player((Integer A))) Current lumber to 1
            • Camera - Pan camera for (Player((Integer A))) to ((Player((Integer A))) start location) over 0.00 seconds
          • Else - Actions
Try this, it should work.
 
Level 3
Joined
Jul 13, 2008
Messages
38
I actually knew a bit about that, but i didn't think that would actually be how it is here. I think there is a auto conversation that WE does for people like me who are not so well informed on basic coding lol. But thanks for checking into it, I’m running though a few ideas also nothing seems to be working.

  • For each (Integer A) from 1 to 16, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) controller) Equal to User
          • ((Player((Integer A))) slot status) Equal to Is playing
        • Then - Actions
          • Unit - Create 1 Head Quarters Lv.1 for (Player((Integer A))) at ((Player((Integer A))) start location) facing Default building facing degrees
          • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
          • Visibility - Enable (Last created visibility modifier)
          • Player - Set (Player((Integer A))) Current gold to 250
          • Player - Set (Player((Integer A))) Current lumber to 1
          • Camera - Pan camera for (Player((Integer A))) to ((Player((Integer A))) start location) over 0.00 seconds
        • Else - Actions
Word for word, and still thinks i am blue =/

Could there been a setting some were i might have enabled? And all players are human.
 
Level 16
Joined
Jun 25, 2008
Messages
1,043
hmm, for some reason my stuff gives a fatal error while testing oO
I'll look into it.


edit: okay
  • For each (Integer A) from 0 - 16
should be
  • For each (Integer A) from 1 - 16
:p

I tested it and it properly gives every player a footman at their default start location and gives everyone the set amount of lumber/gold.

so this proves my theory wrong, but hey, my system works and yours doesn't :p
Don't ask me why ^^
 
Level 3
Joined
Jul 13, 2008
Messages
38
I did a test run by saving then loading the game up like a real map though wc3. Instead of thinking i was blue, it set my home base as pink lol. I seriously have no idea what is going on. Maybe player start positions are just not something wc3 likes to work with.
 
Level 16
Joined
Jun 25, 2008
Messages
1,043
Uh that's Really weird :s
Try adding this to your trigger:
  • Set StartLoc[(Integer A)] = ((Player((Integer A))) start location)
  • Unit - Create 1 Footman for (Player((Integer A))) at StartLoc[(Integer A)] facing Default building facing degrees

ofc you'd need to add this to the end of the loop aswell: Custom script: call RemoveLocation(udg_StartLoc[forLoopindexA])
 
Level 3
Joined
Jul 13, 2008
Messages
38
Ok i went ahead and took all we did and threw it togather this is what the trigger now looks like and STILL it thinks blue is red >_<

  • For each (Integer A) from 1 to 16, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Player((Integer A))) controller) Equal to User
          • ((Player((Integer A))) slot status) Equal to Is playing
        • Then - Actions
          • Set Temp_Point = ((Player((Integer A))) start location)
          • Unit - Create 1 Footman for (Player((Integer A))) at Temp_Point facing Default building facing degrees
          • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
          • Visibility - Enable (Last created visibility modifier)
          • Player - Set (Player((Integer A))) Current gold to 250
          • Player - Set (Player((Integer A))) Current lumber to 1
          • Camera - Pan camera for (Player((Integer A))) to ((Player((Integer A))) start location) over 0.00 seconds
          • Custom script: call RemoveLocation (udg_Temp_Point)
        • Else - Actions
EDIT: I removed the conditions and all other players had there buildings in the right place. But red was on blues place and blue was below red. So it has to do with something with how this trigger is made for me i guess. I am thinking it is something im doing wrong.
 
Level 3
Joined
Jul 13, 2008
Messages
38
There is a force one and a force 2, Could that have done something? Anyways here is the final code it works like it should. It was only player one, and it bothers me cause im sure this problem will show up later lol.

  • Player HQ Spawn
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Temp_Point = (Center of Player1 Base <gen>)
      • Unit - Create 1 Head Quarters Lv.1 for (Player(1)) at Temp_Point facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • For each (Integer A) from 2 to 16, do (Actions)
        • Loop - Actions
          • Set Temp_Point = ((Player((Integer A))) start location)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
            • Then - Actions
              • Unit - Create 1 Head Quarters Lv.1 for (Player((Integer A))) at Temp_Point facing Default building facing degrees
              • Visibility - Create an initially Enabled visibility modifier for (Player((Integer A))) emitting Visibility across (Playable map area)
              • Visibility - Enable (Last created visibility modifier)
              • Player - Set (Player((Integer A))) Current gold to 250
              • Player - Set (Player((Integer A))) Current lumber to 1
              • Camera - Pan camera for (Player((Integer A))) to ((Player((Integer A))) start location) over 0.00 seconds
            • Else - Actions
          • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: call DestroyTrigger( GetTriggeringTrigger() )
 
Status
Not open for further replies.
Top