• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Item Drop System(With Respawn Trigger)

Level 6
Joined
Jun 1, 2009
Messages
38
Diffuculty-3/10

Hello all again its Kronos21 bringing you more Triggers.
This trigger tutorial is very easy to be surprised.So here it is

Variables-
RandomItemDrop(Integer 0 Array)

  • Events
  • Unit - A unit Dies
  • Conditions
  • (Owner of(Dying unit)) equal to Neutral Hostile
  • (Unit-type of (Dying unit)) equal to NPC here
  • Actions
  • Set RandomItemDrop = (Random Integer number between 1 and #)
  • If (RandomItemDrop Equal to 1) then do (Item - Create Itemhere at position of Dying unit) else (Do nothing)


  • |Set RandomItemDrop = (Random Integer number between 1 and #)|
The # part of this trigger is how many items will drop(RECOMENDATION:add 1 or 2 spaces blank so that players have a small chance to loot it)





  • |If (RandomItemDrop Equal to 1) then do (Item - Create Itemhere at position of Dying unit) else (Do nothing)|
This MUST be done multiple times depending on how many loot you might get view the explanation above to know what i mean


Respawn
(Hint:This is really easy)Diffuculty -1/10


  • Events
  • Unit - A Unit dies
  • Conditions
  • (Owner of(Dying unit)) Equal to Neutral Hostile
  • Actions
  • Unit - Create 1 (Unit-type or (Dying unit) for Neutral Hostile at (Random Point in (Region where units spawn) facing Default building facing degrees




















And thats it people look for more of my tutorials later on for Triggers,Help,etc.


By-:spell_breaker:Kronos21:spell_breaker:
 
Level 31
Joined
May 3, 2008
Messages
3,155
Disapprove.

1) Too simple.
2) Contain memory leak.
3) Ineffective code, it could be done much better because

- You don't need 2 condition, just 1 would be enough.
-Instead of dying, you could have use triggering cause it was instant.
-As for the respawn, it could be done by using object editor (If my memory serves me right).

  • Item Drop
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Set LeakDestroy = (Position of (Triggering unit))
      • Set Random = (Random integer number between 1 and 3)
      • Item - Create Item[Random] at LeakDestroy
      • Set Random = 0
      • Custom script: call RemoveLocation(udg_LeakDestroy)
  • Item
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Item[1] = Claws of Attack +15
      • Set Item[2] = Potion of Omniscience
      • Set Item[3] = Gerard's Lost Ledger
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I agree with what Septimus said (apart from spawning units with the object editor, or did I miss something there?)

On top of that: it is a very bad idea to make units spawn where they died, this will result in a very buggy overall map: the units will be stacked together, half the area is empty, creeps can leave their area.
Try making them spawn at the place where they initially stood, I guess that's a challenge for you =D
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
well is there a item-drop system thats easier? and i have tested it it works fine >.>
Perhaps a late response, but here it is:
No easier item-drop system comes to mind, but this doesn't work "fine". It works, but nothing more than that.

With your system, if you lead all creeps to the same spot and then kill them, you've got one hell of a creep camp since all creeps will spawn there.
If you're good enough, you can just minimize the game for a while and come back later, then you'll notice you're max level and there are some extremely rare artifacts lying on the ground.


Why is this Item Drop System anyway?
Because it drops a random item on death (you can't even choose which item per unit type, unless you spend a lot of time CnP'ing if/then/else-structs).
 
Because it drops a random item on death (you can't even choose which item per unit type, unless you spend a lot of time CnP'ing if/then/else-structs).

I know that but that means that I can make at least 10 systems only from my Vampire Clan Wars map! :xxd:

Each custom spell can be system, you use triggers and random numbers to make chance for some action... :con:

I know what you mean man, I just write my opinion!
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
I know that but that means that I can make at least 10 systems only from my Vampire Clan Wars map! :xxd:

Each custom spell can be system, you use triggers and random numbers to make chance for some action... :con:

I know what you mean man, I just write my opinion!
Well, umm... spells are actually systems, but we like to keep them apart because otherwise we'd confuse them with eachother :D
Spells are systems that give an advantage/disadvantage in combat (this can be healing, damaging as well as providing extra armor/attack, ...).
They're also defined by a button (even if it's hidden) and can be manually activated or activate themself (when a spell activates itself, it's a 'passive spell' ^^).

Systems on the other hand, can be basically anything to affect the gameplay, or just as an additional feature (like a calculator, hero selection, or item drop system).

I hope you enjoyed this lecture >.>
 
Well, umm... spells are actually systems, but we like to keep them apart because otherwise we'd confuse them with eachother :D
Spells are systems that give an advantage/disadvantage in combat (this can be healing, damaging as well as providing extra armor/attack, ...).
They're also defined by a button (even if it's hidden) and can be manually activated or activate themself (when a spell activates itself, it's a 'passive spell' ^^).

Systems on the other hand, can be basically anything to affect the gameplay, or just as an additional feature (like a calculator, hero selection, or item drop system).

I hope you enjoyed this lecture >.>

I was thinking that way :cute:
Thanks for lecture :thumbs_up:
 
Level 3
Joined
Oct 18, 2009
Messages
51
how do you make the = -item type-
  • Item
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Item[1] = Claws of Attack +15
      • Set Item[2] = Potion of Omniscience
      • Set Item[3] = Gerard's Lost Ledger
lol... i just wrote the answer.. omg.. i got it :)
i did the type of variable = item and not = item type.. :)
 
Last edited:
Sorry, this tutorial is a tad too short. You didn't explain it enough. ;)

People will look at this and be confused, you have to mention the triggers/explain what the lines do and consider a few different cases. I suggest actually expanding this for random spawns/random items/proc abilities etc. since they all follow the same technique. At its current state, I can't approve. Sorry. =\

Please notify me that you will update it or just update it in general within a week else it will be graveyarded.

EDIT:

No updates have been made within a week. Please notify me if you are willing to update again/if I have made a mistake.
~Graveyarded.
 
Last edited:
Top