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

Item Drop problem

Status
Not open for further replies.
Level 3
Joined
Jun 18, 2007
Messages
72
Hey guys im pretty new to the world of map-making and im pretty much learning as i go. Anyhoo one problem i cant seem to find a solution for is i have a tower that upgrades to a tower with an increased Inventory, my problem being that the second the tower is finished upgrading it drops all items currently in its inventory. Can anyone help me with this? Thanx in Advance! :infl_thumbs_up:
 
Level 5
Joined
May 27, 2007
Messages
132
I don't think this can be fixed. You can try making a variable that adds all the items dropped by a tower to a group, then order it to pick them up immitiadtly.

Also, what are this items for? If they are bonus tower upgrades, you can make them abilities you can purchase/gain instead.
 
Sure it can be fixed. Just needs a trigger.
  • Events
    • Unit - A unit Finishes an Upgrade
  • Conditions
    • (Unit type of (Triggering Unit)) = YourTowerWithTheIncreasedInventory
  • Actions
    • Item - Pick every item within 100 of (Triggering Unit) and do Actions
      • Order (Triggering Unit) to Right-click (Picked Item)
I think...
 
Level 3
Joined
Jun 18, 2007
Messages
72
Thanx Codexx.....i spent a couple hours tryin to make some kind of variable but i pretty much gave up as i have no clue wtf im doing lol. :grin: Also thanx Pyritie im going to try that trigger in a couple hours (taking care of neice and nephew argh lol) once i do ill try it out and let yall know if it works right. Its gonna be some time but once im finished with my map ill post it here for you guys to check out. Thanx again for your help! (the map is a bit of a secret......iono why i guess im just weird that way lol :infl_thumbs_up:)
 
Level 3
Joined
Jun 18, 2007
Messages
72
Argh!!!! lol i need a we bit more help, the Action you have set-up.........i cant seem to find it anywhere in the action triggers, if maybe your using some tool or extra could you please let me know!
 
Argh!!!! lol i need a we bit more help, the Action you have set-up.........i cant seem to find it anywhere in the action triggers, if maybe your using some tool or extra could you please let me know!

Actually I just made that up, guessing that there was a Pick Every Item... action. Oh well, here's another trigger. You need 5 item variables called Item1, Item2, etc. You also need a unit variable called Tower.

Just so you know, the custom script with the locals at the beginning is to make sure that the trigger does not get all wierd if you upgrade two towers at once.

If the tower with the smaller inventory has less than 5 inventory slots, then don't do those actions. For example if it has 3 slots, then ignore things that say "Item5" and such.

Also, if someone could please tell me how to do local arrays that would be very helpful!

  • Item Transfer (Initially off)
  • Events
    • Unit - A unit starts an upgrade
  • Conditions
    • (Unit type of (Triggering Unit)) = YourTowerWithTheSmallerInventory
  • Actions
    • Custom script: local item udg_Item1
    • Custom script: local item udg_Item2
    • Custom script: local item udg_Item3
    • Custom script: local item udg_Item4
    • Custom script: local item udg_Item5
    • Custom script: local unit udg_Tower
    • -------- Get the locals out of the way --------
    • Set Tower = (Triggering Unit)
    • Set Item1 = (Item carried by Tower in slot 1)
    • Set Item2 = (Item carried by Tower in slot 2)
    • Set Item3 = (Item carried by Tower in slot 3)
    • Set Item4 = (Item carried by Tower in slot 4)
    • Set Item5 = (Item carried by Tower in slot 5)
    • Wait until (Unit type of Tower is Equal to YourTowerWithTheBiggerInventory), checking every 1.00 seconds
    • -------- It waits until the tower is finished upgrading --------
    • Hero - Create (Item type of Item1) and give it to Tower
    • Hero - Create (Item type of Item2) and give it to Tower
    • Hero - Create (Item type of Item3) and give it to Tower
    • Hero - Create (Item type of Item4) and give it to Tower
    • Hero - Create (Item type of Item5) and give it to Tower
    • Item - Remove Item1
    • Item - Remove Item2
    • Item - Remove Item3
    • Item - Remove Item4
    • Item - Remove Item5
    • -------- and then we "null" the variables to prevent leaks --------
    • Custom script: set udg_Item1 = null
    • Custom script: set udg_Item2 = null
    • Custom script: set udg_Item3 = null
    • Custom script: set udg_Item4 = null
    • Custom script: set udg_Item5 = null
    • Custom script: set udg_Tower = null

Tell me if I missed something.
 
Last edited:
Level 3
Joined
Jun 18, 2007
Messages
72
Thanx ill implement that a.s.a.p and see what happens. Also im having trouble with the enhanced Editor. The WE Unlimited tool, been using that for a few days but for some reason.........not ONE of the "advanced" triggers works. Every time the map loads up (from Test mode in the editor) it does the saving Variables thing, and it sits their for a while and finally tells me that their was an error in the trigger and its been turned off. The Script errors page
appears and lets me know whats up (but i dont understand it whatsoever).
Code:
//===========================================================================
// Trigger: Untitled Trigger 001
//===========================================================================
function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call InitAdvancedTriggers(  )
endfunction

This was just an example that i copied of what it says your supposed to do when using an advanced trigger, which is "Initialize Advanced Triggers" on map initialization. What im trying to make is the WE Unlimited has a trigger: "Rect - Make Rect Unbuildable/Buildable" and i need to use this to make it easier for me setup because i need to make the towers buildable Amphibiously but also ONLY on "Buildable" areas....the problem being that the main alley's and build areas are in Shallow water and i have terrain placed around the enemy spawn to prevent building there, but because shallow water is "unbuildable" if i have the "buildable only" placement pathing then it wont let them build on the water even if "amphibious" is also selected. Thanx in Advance!:infl_thumbs_up:
 
Level 3
Joined
Jun 18, 2007
Messages
72
lol thats probably a good idea lol. I usually dont like to do a whole lot of that cause im just usually more comfortable with actual human feedback lol. But ye thanx again Pyritie your help has been extremely valuable. But it seems like no matter what i do i cant get the tower to keep its items or whatnot. So for now im just gonna leave it alone, maybe after im mostly done with it and am comfortable with releasing it for some testing, you can get a more hands-on approach to the problem, Thanx again:infl_thumbs_up:

ahhhhh!!! a fellow dragon lover, woooot. (saw ur deviantart thing lol)

Well thanx, the areas i needed to block off are now unbuildable (although it still shows it as "green" just the builder doesnt actually build anything, but w/e) Also helped me know how to protect my map, woot lol.
 
Last edited:
Level 3
Joined
Jun 18, 2007
Messages
72
Alrighty well i was able to get it working via one or 2 basic triggers and setting up the inventory to have levels lol, my brother figured it out xD. It was so simple once you actually figure it out lol. But yea thank you all for your help, whether or not it worked it still somehow got us to the answer and thats all i ask for. Peace ^_^ :infl_thumbs_up:
 
Level 3
Joined
Jun 18, 2007
Messages
72
yea no problem EDIT: Woohoo i got it to work, lol didnt know it was that dang simple lol. Thanx for about the billionth time lol
  • Item Drop Problem
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Equipment Tower
          • (Unit-type of (Triggering unit)) Equal to Equipment Tower lvl 2
          • (Unit-type of (Triggering unit)) Equal to Equipment Tower lvl 3
    • Actions
      • Unit - Increase level of Inventory (Equip Tower) for (Triggering unit)
Then i went to my custom inventory ability "Inventory (Equip Tower)" and made it have 3 levels, and for each level i could choose the amount of open slots available. And so far its worked perfectly! ^_^
 
Last edited:
Status
Not open for further replies.
Top