How to create an array depended on number of playing user players?

Sayiain

You can change this now in User CP.
Reaction score
0
My aim is to replace a unit owned by a human player with new bought unit.
For example I have a swordman, go to the barracs, buy knight and the swordsman is deleted and the knight is created(in the same place and facing directory if you would be so kind :))
And I need to store that unit in a variable to do something with it later. Array or not.

Anyone has any idea?
 

Sayiain

You can change this now in User CP.
Reaction score
0
I did it like this:

First I made an Array of unit type and 11 fields.
Then following trigger:
Trigger:
  • Grupa graczy - Pick every player in (All players controlled by a U??ytkownik player) and do (Actions)
    • PÄ™tla - Akcje
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Je?›li - Warunki
          • ((Picked player) slot status) R??wna siÄ™ Gra
        • To - Akcje
          • Jednostka - Create 1 Piechur for (Picked player) at ((Picked player) start location) facing Domy?›lna orientacja budynku degrees
          • Set Heroes[(Player number of (Picked player))] = (Last created unit)
          • Efekt specjalny - Create a special effect at (Position of (Last created unit)) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
        • Albo - Akcje

And this:
Trigger:
  • Hero Replacement
    • Wydarzenia
      • Jednostka - Strenght 0013 <gen> Sprzedaje jednostkÄ™
      • Jednostka - Agility Melee 0010 <gen> Sprzedaje jednostkÄ™
      • Jednostka - Agility Ranged 0009 <gen> Sprzedaje jednostkÄ™
      • Jednostka - Intelligence 0015 <gen> Sprzedaje jednostkÄ™
    • Warunki
    • Akcje
      • Jednostka - Remove Heroes[(Player number of (Owner of (Sold unit)))] from the game
      • Set Heroes[(Player number of (Owner of (Sold unit)))] = (Sold unit)
      • Kamera - Pan camera for (Owner of (Sold unit)) to (Position of (Sold unit)) over 1.00 seconds


I made 2 points of start locations. Left for 1st team, Right for 2nd.
The problem is that while testing Player 1(Red, Left Team) is spawned in the start location of Right Team.
WTF??? I can't do anything about it!!
What am I doing wrong?
 

TheOverWhelm

Member
Reaction score
16
-Looks at the GUI stuff-
I now know Akcje is Actions.

Try setting the Start Location in a variable array near init. Otherwise, I, personally, do not know what's wrong.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top