I have a problem with triggers

nardretor

New Member
Reaction score
6
I have a trouble with this trigger.

Trigger:
  • Warriors Creation
    • Events
      • Time - Elapsed game time is 4.00 seconds
    • Conditions
    • Actions
      • Set Temp_PsyTroop = (All allies of Player 11 (Dark Green))
      • Set Temp_VarTroop = (All enemies of Player 11 (Dark Green))
      • Neutral Building - Add Varhamor Warrior to Barracks 0091 <gen> with 3 in stock and a max stock of 3
      • Neutral Building - Add Varhamor Rifleman to Barracks 0091 <gen> with 3 in stock and a max stock of 3
      • Neutral Building - Add Varhamor Flying Rider to House of Birds 0088 <gen> with 3 in stock and a max stock of 3
      • Neutral Building - Add Varhamor Mage to Magic Academy 0226 <gen> with 3 in stock and a max stock of 3
      • Neutral Building - Add Siege Tank (Varhamor) to Workshop 0086 <gen> with 3 in stock and a max stock of 3
      • Neutral Building - Add Psyrexian Swordsman to Barracks 0028 <gen> with 3 in stock and a max stock of 3
      • Neutral Building - Add Psyrexian Archer to Barracks 0028 <gen> with 3 in stock and a max stock of 3
      • Neutral Building - Add Psyrexian Flying Warrior to House of Birds 0030 <gen> with 3 in stock and a max stock of 3
      • Neutral Building - Add Psyrexian Mage to Magic Academy 0029 <gen> with 3 in stock and a max stock of 3
      • Neutral Building - Add Siege Tank to Workshop 0031 <gen> with 3 in stock and a max stock of 3
      • Wait 2.00 seconds
      • Player Group - Pick every player in Temp_PsyTroop and do (Actions)
        • Loop - Actions
          • Player - Make Varhamor Warrior Unavailable for training/construction by (Picked player)
          • Player - Make Varhamor Rifleman Unavailable for training/construction by (Picked player)
          • Player - Make Varhamor Flying Rider Unavailable for training/construction by (Picked player)
          • Player - Make Varhamor Mage Unavailable for training/construction by (Picked player)
          • Player - Make Siege Tank (Varhamor) Unavailable for training/construction by (Picked player)
      • Player Group - Pick every player in Temp_VarTroop and do (Actions)
        • Loop - Actions
          • Player - Make Psyrexian Swordsman Unavailable for training/construction by (Picked player)
          • Player - Make Psyrexian Archer Unavailable for training/construction by (Picked player)
          • Player - Make Psyrexian Flying Warrior Unavailable for training/construction by (Picked player)
          • Player - Make Psyrexian Mage Unavailable for training/construction by (Picked player)
          • Player - Make Siege Tank Unavailable for training/construction by (Picked player)
      • Custom script: call DestroyForce (udg_Temp_VarTroop)
      • Custom script: call DestroyForce (udg_Temp_PsyTroop)


The Varhamor units should not be available for the Psyrexian players... and Psyrexian units should not be available for the Varhamor players but... they are still available...

Thanks for those who will try to help..
 

afisakov

You can change this now in User CP.
Reaction score
37
I suggest making a techtree requirement to control who gets which units. For all the "psy" troops make them require a psy builder, or main building or whatever you are using, and make all the var troops require a var builder etc. Then players cannot choose units outside their race.
 

Yoshii

New Member
Reaction score
74
Lets say you have 2 race ORC and Human
The orc can only get shaman and tauren chieftain from the shop and the human can only get priest and knight.The two player probably start with different unit since they are of different race.Example ORc start with peon and human with peasant.

In the object editor of the unit Shaman and tauren chieftain you change the "Techtree requirement list" and add the unit Peon.

you do same thing with knight and priest but this time you add Peasant instead

this will make it unable for orc player to train priest and knight because he do not own a peasant and never will.

edit: i would personally make the techtree requirement list a building instead of a unit as if all unit dies you cannot train it anymore most likely
 

nardretor

New Member
Reaction score
6
Well... it didnt work.. i made a unit hidden somewhere, and try to buy from the enemy. Still i can buy units. I added the unit in the techtree requirements.
 

afisakov

You can change this now in User CP.
Reaction score
37
Well, I can still think of one rather indirect way of getting the desired result. Assuming that you have shops designated for each team and you aren't particularly worried about players spamming one particular unit type...
Instead of having the unit shops sell units you can have them train them. and then include triggers of this type for each shop (this will require that you have a circle of power with a region inside it outside each shop)

Code:
workshop ownership
    Events
        Unit - A unit enters workshop <gen>
    Conditions
        ((Triggering unit) belongs to an ally of Player 11 (Dark Green)) Equal to True
    Actions
        Unit - Change ownership of Workshop 0338 <gen> to (Owner of (Triggering unit)) and Change color

If you use this trigger for every shop that sells psy units and one with an "enemy" condition for all shops with var units then players will be able to take over only their allied shops and since they will now be training units instead of buying them the techtree requirements should hold, not to mention that you can't train anything in an enemy-owned shop.
Of course to make this workable you will have to put a region outside every shop and make the build time of all units 1 second (so players don't fight allies for control of shop). See if this works for you.
 
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