• 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.

Little Help.

Status
Not open for further replies.
just do this. it loops through the item slots and drops each item that unit has

  • drop item when enter region
    • Events
      • Unit - A unit enters No region
    • Conditions
    • Actions
      • Set tempUnit = (Triggering unit)
      • For each (Integer tempInt) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Drop the item from slot tempInt of tempUnit
got rid of the array since its not needed.
 
Last edited:
Level 15
Joined
Oct 29, 2012
Messages
1,474
Use this : [EDITED (removed leaks)]
  • Events
    • Unit - A Unit enters Region1 <gen>
  • Actions
    • Set Carrier = (Triggering unit)
    • Set DropPoint = (Center of Region2 <gen>)
    • For each (Integer A) from 1 to 6, do (Actions)
      • Hero - Drop the item from slot [(Integer A)] of (Triggering unit)
      • Set Item = (Last Dropped Item)
      • Item - Move [U]Item[/U] to [U]DropPoint[/U]
    • call RemoveLocation(udg_DropPoint)
    • Set Carrier = No unit
It's like this
  • Events
    • Unit - A Unit enters Region1 <gen>
  • Actions
    • Set Carrier = (Triggering unit)
    • Set DropPoint = ( Center OF Region 2 <gen>)
    • Hero - Drop the item from slot [U]1[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]2[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]3[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]4[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]5[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]6[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Set Carrier = No unit
    • Custom script: call RemoveLocation(udg_DropPoint)
 
Last edited:
Use this :
  • Events
    • Unit - A Unit enters Region1 <gen>
  • Actions
    • For each (Integer A) from 1 to 6, do (Actions)
      • Hero - Drop the item from slot [(Integer A)] of (Triggering unit)
      • Item - Move ( Last Dropped Item ) to ( Center Of Region 2 <gen> )
It's like this
  • Events
    • Unit - A Unit enters Region1 <gen>
  • Actions
    • Hero - Drop the item from slot [U]1[/U] of (Triggering unit)
    • Item - Move (Last Dropped Item) to ( Center Of Region 2 <gen>)
    • Hero - Drop the item from slot [U]2[/U] of (Triggering unit)
    • Item - Move (Last Dropped Item) to ( Center Of Region 2 <gen>)
    • Hero - Drop the item from slot [U]3[/U] of (Triggering unit)
    • Item - Move (Last Dropped Item) to ( Center Of Region 2 <gen>)
    • Hero - Drop the item from slot [U]4[/U] of (Triggering unit)
    • Item - Move (Last Dropped Item) to ( Center Of Region 2 <gen>)
    • Hero - Drop the item from slot [U]5[/U] of (Triggering unit)
    • Item - Move (Last Dropped Item) to ( Center Of Region 2 <gen>)
    • Hero - Drop the item from slot [U]6[/U] of (Triggering unit)
    • Item - Move (Last Dropped Item) to ( Center Of Region 2 <gen>)


no dont use that. u leak a ton of locations. u do the same as i do but much less efficiently. integer A / B should not be used they are slow and inefficient.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
no dont use that. u leak a ton of locations. u do the same as i do but much less efficiently. integer A / B should not be used they are slow and inefficient.

1- I'm the leaks Lord ( I always forget to remove leaks )
2- For Loop Integer A is better Because :
Using an array index as a counter in a for loop will not be any faster than using the standard "for loop integer A.." style loop. Resolving indexes is not free and probably far slower than the extra few characters that need to be hashed with loop A/B.

He says the opposite . Now what do I miss here :
Use this : [EDITED (removed leaks)]
  • Events
    • Unit - A Unit enters Region1 <gen>
  • Actions
    • Set Carrier = (Triggering unit)
    • Set DropPoint = (Center of Region2 <gen>)
    • For each (Integer A) from 1 to 6, do (Actions)
      • Hero - Drop the item from slot [(Integer A)] of (Triggering unit)
      • Set Item = (Last Dropped Item)
      • Item - Move [U]Item[/U] to [U]DropPoint[/U]
    • call RemoveLocation(udg_DropPoint)
    • Set Carrier = No unit
It's like this
  • Events
    • Unit - A Unit enters Region1 <gen>
  • Actions
    • Set Carrier = (Triggering unit)
    • Set DropPoint = ( Center OF Region 2 <gen>)
    • Hero - Drop the item from slot [U]1[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]2[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]3[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]4[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]5[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Hero - Drop the item from slot [U]6[/U] of (Triggering unit)
    • Set Item = (Last Dropped Item)
    • Item - Move Item to DropPoint
    • Set Carrier = No unit
    • Custom script: call RemoveLocation(udg_DropPoint)
 
for each integer A/B is not faster. i had an arrayed temp integer which may be slower but no1 ik did a test to see. either way i switched it to a non arrayed integer so as not to confuse the TO.

my tutorial explains y integer A / B is slower.

and like i said use the one i posted its a lot more efficient. u really cant get more efficient than that unless u get rid of the loop. but thats such a small amount its unnecessary and pointless.

if u want to fix urs then u store triggering unit which is good but u never use the variable. ur other problem is u use integer A.
last problem is u move the item but the TO only asked for the item to be dropped when unit enters region.
 
Status
Not open for further replies.
Top