How do you setup "If THAT player owns THAT unit then create THAT unit"

IHMJack

New Member
Reaction score
1
How do you setup "If THAT player owns THAT unit then create THAT unit every second for THAT player at THAT unit"

I have found that most of the time the software allows only "triggering unit" or "specific unit", but only rare cases it allows "unit-type owned by that player"

Here is my map

http://epicwar.com/maps/10135/

Im trying to simplify the "free warping units" trigger system in the triggers settings, cuz I want to add up to level 30-40 creeps, but I dont want to manually set the setting for all 12 players one by one. I want a trigger system that you can just do it for "all players"

Help would be appreiated, thanks!!!
 

Exide

I am amazingly focused right now!
Reaction score
448
I would've done it something like this:

Code:
Untitled Trigger 001
    Events
        Unit - A unit owned by Player 1 (Red) Finishes training a unit
    Conditions
        (Unit-type of (Trained unit)) Equal to Footman
    Actions
        Set Check_Red_Special_Unit = 1

Check_Red_Special_Unit is an Integer Variable. You can, of course, name it to whatever you wish. The Footman in Conditions is your special Unit. And the Event is based of if you train the Unit or not (can be changed to whatever you like.)

Code:
Untitled Trigger 002
    Events
        Time - Every 1.00 seconds of game time
    Conditions
        Check_Red_Special_Unit Equal to 1
    Actions
        Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees

Something like that. The second trigger has memory leaks, but it's nothing bad. :p


If a player leaves a game:

Code:
Untitled Trigger 003
    Events
        Player - Player 2 (Blue) leaves the game
    Conditions
    Actions
        Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Unit - Remove (Picked unit) from the game)

But that only works if the Player actually leaves the game.
So if you have any pre-placed units belonging to Player 2 (Blue) and that player slot isn't taken nothing will happen. (For example, if you start the game without anyone playing as Player 2 (Blue)/ leaving in countdown, or whatever.)
I suggest you use the above trigger and this one:

Code:
Untitled Trigger 004
    Events
        Time - Elapsed game time is 10.00 seconds
    Conditions
        (Player 2 (Blue) slot status) Equal to Is unused
    Actions
        Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Unit - Remove (Picked unit) from the game)
        Trigger - Turn off (This trigger)

Something like that.
Also remember to have one trigger for each player.
Hope that helps. :)
 

IHMJack

New Member
Reaction score
1
thanks for the "unit - remove" triggers, I got that to work

But that "unit - create" trigger system still doesnt allow me to save time programing up to level 30-40 units.
 
S

Sunny_D

Guest
hm... dont get your intention completely... what you want the triggers to do? can you give an exact example? f.e.: if player1 has trained 1 footman then create 1 footman for all other players??

if the problem that you want to have the trigger above for all players you can do it that way:

make check_red_special_unit as an array with size of your max amount of players. then:

Code:
Untitled Trigger 001
    Events
        Unit - A unit Finishes training a unit (generic)
    Conditions
        (Unit-type of (Trained unit)) Equal to Footman
    Actions
        Set Check_Red_Special_Unit[Player number of (owner of (trained unit))]= 1
 

IHMJack

New Member
Reaction score
1
here is my map, open it with world editor, go to trigger settings, and look at "free warping units"

http://epicwar.com/maps/10167/

I dont like the current system it takes to long to add creeps up to level 30

I want a "if THAT unit has THAT condition, make a unit for owner of THAT unit"
 
S

Sunny_D

Guest
i think i got a time-saving solution. check the attached map for details and read the trigger comment.

plz have a backup as well, i dont want to be the reason for corrupting your map... i think i didnt make a mistake but you never know... ^^

basically its the idea to load the portals into array-variables to have an easy access to them! ;) for time reasons i didnt check your other triggers, mb you can use that way of creating triggers for them as well... hope i could have helped :)

map attached.
 

IHMJack

New Member
Reaction score
1
LOL, the trigger setup looking hella confusing, but I have to say, damn you are good, I will continue making more levels and hope there is no bugs.

thanks alot for your help
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top