• 🏆 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!

Wrong trigger triggers and building jumps around

Status
Not open for further replies.
Level 3
Joined
Feb 27, 2011
Messages
39
I hope the title didnt scare you off :)
Ive made a spellbook with 2 spells which have the point of creating an item through 2 triggers and given it to a building. The problems are the following:
1) the building jumps around when the triggers happen.
2) the actions of one trigger seem to take place regardless of which spell is cast.
3) After casting the first ability (pine spear) the other ability becomes disabled (no idea why this is) the first ability thus casts mahogany pine mahogany and continues mahogany (second ability).
I have attached a map with the problem parts.
Here's an example of 1 of the 2 triggers:

  • Create pine spear
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Craft Pine spear
    • Actions
      • Set Currentlumber = ((Owner of (Triggering unit)) Current lumber)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Currentlumber Greater than or equal to 20
        • Then - Actions
          • Item - Create Pine spear at (Position of (Triggering unit))
          • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) - 20)
        • Else - Actions
          • Game - Display to Player Group - Player 1 (Red) the text: Not enough lumber
 

Attachments

  • Create item test map.w3x
    14.4 KB · Views: 28
Level 3
Joined
Feb 27, 2011
Messages
39
Thanks for answering, its functionally ok now :)
change the base ability of your wind walk coz it will conflict one another
change the 'Data - Minimum spell to 2'
I fixed that, based it off of battle roar and divine shield. The problem is if i base them off the same ability it will create BOTH the items when only one ability button is clicked.
You dont need this..."Set Currentlumber = ((Owner of (Triggering unit)) Current lumber)"
I need it to stop the spears from creating when there is no wood.

How do i fix the leak?
 
Level 29
Joined
Mar 10, 2009
Messages
5,016
Fix leak...

  • set loc = position of triggering unit
  • Item - Create Pine spear at loc
  • Player - Set (Owner of (Triggering unit)) Current lumber to (((Owner of (Triggering unit)) Current lumber) - 20)
  • custom script - call RemoveLocation(udg_loc)
you already have a condition "Currentlumber Greater than or equal to 20",
so it will not create anything unless it meets the condition...

you cant base them as same ability coz that will conflict...
you may base your spell on channel and change the base order...
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
The way WC3 handles orders is it gives an order ID and a unit ID and a target (point, none or a widget). With 2 abilities based on the same ability (and thus same order in most cases), it is impossible for the game engine to separate the 2 abilities and as such it has no choice to cast 1 or both of them.

View it as a sort of key conflict in the ability to order mapping part of the engine. This is why each ability should have a unique order (impossible in WC3 but thankfully added in SC2).
 
Level 3
Joined
Feb 27, 2011
Messages
39
Thanks for the leak fix.

@DR Super Good Thanks for the insight.

you already have a condition "Currentlumber Greater than or equal to 20",
That is not "current lumber", it is the variable which i set earlier.

you cant base them as same ability coz that will conflict...
you may base your spell on channel and change the base order...
I read about channel, however when i add an ability based on channel into my spellbook it simply doesnt show up and also makes 1 of the other spells in the spellbook disappear....what am I doing wrong?
 
Status
Not open for further replies.
Top