• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Questions: Double production, Minimum attack distance,Eat tree clashes with gather...

Status
Not open for further replies.
Level 29
Joined
Mar 9, 2012
Messages
1,557
1. Player researches a tech called Skeletal Mastery and gets one Skeleton Warrior for free whenever one is trained.
The question i have is how would the trigger be turned on for only the researching player and not globally ?

  • upgrade checker
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Skeletal Mastery
    • Actions
      • Trigger - Turn on free skeleton <gen>
  • free skeleton
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Skeleton Warrior
    • Actions
      • Unit - Create 1 Skeleton Warrior for (Triggering player) at (Position of (Trained unit)) facing (Rally-Point of (Triggering unit) as a point)
      • Unit - Order (Last created unit) to Move To (Rally-Point of (Triggering unit) as a point)
--------------------------------------
2. setting a value in
Combat - Minimum Attack Range
seems to be effecting both attacks of an unit.

I want the unit to throw fireballs(it's attack1) at 550-250 distance and engage in melee(it's attack2) when target comes nearer than 250 if target is an ground unit.
Is there any way to set min attack distance seperately for each attack ?
-------------------------------------
3. Ive given an unit 'Eat Tree' ability and Harvest (Goblin Shredder), whenever i want it to gather lumber it goes up and eats the tree instead of gathering wood.
How can i prevent this from happening ? It has to use Harvest by default and Eat Tree only when ordered to.
 
Level 11
Joined
Jan 23, 2015
Messages
788
Set Triggering Unit = AffectedUnit in the first trigger and use that later, if there's more units, add the Triggering Unit to a Unit Group.
In the second trigger, use Owner of Triggering Unit instead of Triggering Player, cause Triggering Player is equal to nothing.
 
Level 12
Joined
May 22, 2015
Messages
1,051
1. Player researches a tech called Skeletal Mastery and gets one Skeleton Warrior for free whenever one is trained.
The question i have is how would the trigger be turned on for only the researching player and not globally ?

  • upgrade checker
    • Events
      • Unit - A unit Finishes research
    • Conditions
      • (Researched tech-type) Equal to Skeletal Mastery
    • Actions
      • Trigger - Turn on free skeleton <gen>
  • free skeleton
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Skeleton Warrior
    • Actions
      • Unit - Create 1 Skeleton Warrior for (Triggering player) at (Position of (Trained unit)) facing (Rally-Point of (Triggering unit) as a point)
      • Unit - Order (Last created unit) to Move To (Rally-Point of (Triggering unit) as a point)
--------------------------------------

Delete the first trigger and modify the second to be like this:
  • free skeleton
    • Events
      • Unit - A unit Finishes training a unit
    • Conditions
      • (Unit-type of (Trained unit)) Equal to Skeleton Warrior
      • (Research level of (Skeletal Mastery) for (Owner of (Triggering unit))) Equal to 1
    • Actions
      • Unit - Create 1 Skeleton Warrior for (Triggering player) at (Position of (Trained unit)) facing (Rally-Point of (Triggering unit) as a point)
      • Unit - Order (Last created unit) to Move To (Rally-Point of (Triggering unit) as a point)
Just add the extra condition to check if the player has the research.
 
Level 11
Joined
Aug 24, 2012
Messages
429
2. setting a value in
Combat - Minimum Attack Range
seems to be effecting both attacks of an unit.

I want the unit to throw fireballs(it's attack1) at 550-250 distance and engage in melee(it's attack2) when target comes nearer than 250 if target is an ground unit.
Is there any way to set min attack distance seperately for each attack ?

There is no way to do this in the World Editor, I'm afraid it's hardcoded in this way :( The minimum attack distance is the same for both attacks. The best you can achieve without triggers is having the fireballs used for anti-air attacks only or making the fireballs an automatic ability.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
The question i have is how would the trigger be turned on for only the researching player and not globally ?
Use a player group (force) which you add the researching player to before turning on the other trigger. In the second trigger you then check if the owner of the triggering unit (or trained unit) is in that player group.

Alternatively use aBoolean array. Set it to true at the player slot index of whoever researches the technology. Then in the "free skeleton" trigger you check if the boolean is true at the index of the owner of the triggering unit (or the constructed unit).

SAUS solution also works but likely adds more overhead (you generally train more units than you research upgrades).

Set Triggering Unit = AffectedUnit in the first trigger and use that later, if there's more units, add the Triggering Unit to a Unit Group.
In the second trigger, use Owner of Triggering Unit instead of Triggering Player, cause Triggering Player is equal to nothing.
This makes no sense. Research is global per player so he can only research it once and it has to affect all buildings of that player.
 
Status
Not open for further replies.
Top