• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Sometimes item is dropping on the ground

Status
Not open for further replies.
Level 18
Joined
Jun 2, 2009
Messages
1,205
  • Real Image
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Real Image
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Real Image for (Casting unit)) Equal to 1
        • Then - Actions
          • Unit - Create 1 Dummy Unit JFA for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Hero - Create Real Image Item 1 and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Item carried by (Last created unit) of type Real Image Item 1) on (Target unit of ability being cast)
          • Item - Remove (Last created item)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Real Image for (Casting unit)) Equal to 2
        • Then - Actions
          • Unit - Create 1 Dummy Unit JFA for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Hero - Create Real Image Item 2 and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Item carried by (Last created unit) of type Real Image Item 2) on (Target unit of ability being cast)
          • Item - Remove (Last created item)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Real Image for (Casting unit)) Equal to 3
        • Then - Actions
          • Unit - Create 1 Dummy Unit JFA for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Hero - Create Real Image Item 3 and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Item carried by (Last created unit) of type Real Image Item 3) on (Target unit of ability being cast)
          • Item - Remove (Last created item)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Real Image for (Casting unit)) Equal to 4
        • Then - Actions
          • Unit - Create 1 Dummy Unit JFA for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Hero - Create Real Image Item 4 and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Item carried by (Last created unit) of type Real Image Item 4) on (Target unit of ability being cast)
          • Item - Remove (Last created item)
        • Else - Actions
For a 2 days i can't find the problem. Real Image Item sometimes dropping on the ground :vw_wtf:
 
Never use casting unit use triggering unit. Casting unit is slower than triggering unit and has other problems associated with using it.
Anything used twice or more should be stored into a variable and the variable should be used.
You can also get rid of all the ITEs and run one set of actions based on the level using an item type array.

You should take a look at my tutorial Things You Should Know When Using Triggers / GUI.


  • Real Image
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Real Image
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Real Image for (Casting unit)) Equal to 1
        • Then - Actions
          • Unit - Create 1 Dummy Unit JFA for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Hero - Create Real Image Item 1 and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Item carried by (Last created unit) of type Real Image Item 1) on (Target unit of ability being cast)
          • Item - Remove (Last created item)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Real Image for (Casting unit)) Equal to 2
        • Then - Actions
          • Unit - Create 1 Dummy Unit JFA for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Hero - Create Real Image Item 2 and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Item carried by (Last created unit) of type Real Image Item 2) on (Target unit of ability being cast)
          • Item - Remove (Last created item)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Real Image for (Casting unit)) Equal to 3
        • Then - Actions
          • Unit - Create 1 Dummy Unit JFA for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Hero - Create Real Image Item 3 and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Item carried by (Last created unit) of type Real Image Item 3) on (Target unit of ability being cast)
          • Item - Remove (Last created item)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Real Image for (Casting unit)) Equal to 4
        • Then - Actions
          • Unit - Create 1 Dummy Unit JFA for (Owner of (Casting unit)) at (Position of (Target unit of ability being cast)) facing Default building facing degrees
          • Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
          • Hero - Create Real Image Item 4 and give it to (Last created unit)
          • Hero - Order (Last created unit) to use (Item carried by (Last created unit) of type Real Image Item 4) on (Target unit of ability being cast)
          • Item - Remove (Last created item)
        • Else - Actions
To This.
This first portion should be placed in a trigger that fires at 0.00 time ( not periodic) or at map initialization.
  • Set RealImageItemType[1] = Real Image Item 1
  • Set RealImageItemType[2] = Real Image Item 2
  • Set RealImageItemType[3] = Real Image Item 3
  • Set RealImageItemType[4] = Real Image Item 4
This is you above trigger with all ITEs remove. More efficient methods and cleaning of leaks.
  • Real Image
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Real Image
    • Actions
      • Set tempPoint = (Position of (Target unit of ability being cast))
      • Set tempInt = (Level of Real Image for (Triggering unit)
      • Unit - Create 1 Dummy Unit JFA for (Owner of (Triggering unit)) at tempPoint facing Default building facing degrees
      • Set tempUnit = (Last created unit)
      • Unit - Add a 3.00 second Generic expiration timer to tempUnit
      • Hero - Create RealImageItemType[tempInt] and give it to tempUnit
      • Hero - Order tempUnit to use (Item carried by tempUnit of type RealImageItemType[tempInt]) on (Target unit of ability being cast)
      • Item - Remove tempUnit
      • Custom script: call RemoveLocation(udg_tempPoint)
 
Status
Not open for further replies.
Top