Creep Respawn Drops

thomas9999

New Member
Reaction score
0
hey im making map and ive got creep respawn to work
also the creeps have drops
but after i kill the creep once the respawn of that creep wont drop items like the first one that i killed
wats goin on?
pls help thanks
 

takethat

Active Member
Reaction score
12
creep that respawn is same type but not the same creep any more, so u have to trigger the item drop,

a unit dies

dying unit ==

set TemPoint == position of dying unit
create item
Custom script: call RemoveLocation (udg_TempPoint)
 

artix123

New Member
Reaction score
4
the "set TemPoint == Position of (Dying Unit)" is to prevent leaks. Read up on memory leaks in the tutorial repository if you don't know.

Basically when a unit dies, the trigger checks if the dying unit is a creep (I don't know how you'll do that depends on your map itself), then set TemPoint at position of dying unit, creates the item at that position, then destroys the TemPoint to prevent leaks.
 

artix123

New Member
Reaction score
4
If I'm not mistaken, your item drop in the original creep is modified from the Unit Properties. When creep respawns, it will not have the item drop anymore as it is not the original creep unit. Thus you need to use triggers to enable item drop.

First, create a variable in the variable editor called TempPoint. This is a temporary point used to prevent memory leaks. Read more here.

Trigger:
  • Item Drop Trigger
    • Events
      • Unit - A Unit Dies
    • Conditions
      • (Owner of (Dying Unit)) Equal to Neutral Hostile
    • Actions
      • Set TempPoint = Position of (Dying Unit)
      • Item - Create (whatever item you want) at TempPoint
      • Custom script: call RemoveLocation (udg_TempPoint)


This creates an item at the position of the neutral creep which died.
 

thomas9999

New Member
Reaction score
0
its it possible to change the item u want to drop to a number like a chance of gettn heaps of items because i dont want the creep to drop the same thing every time
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
There's plenty of ways to get random item drop tables.

Like this one:

Event:
- A unit owned by Neutral Hostile dies
Conditions:
Actions:
- Set Items[1] = Item 1
- Set Items[2] = Item 1
- Set Items[3] = Item 1
- Set Items[4] = Item 1
- Set Items[5] = Item 2
- Set Items[6] = Item 2
- Set Items[7] = Item 2
- Set Items[8] = Item 3
- Set Items[9] = Item 3
- Set Items[10] = Item 4
- Set Point = Position of (Triggering unit)
- Item - Create 1 Items[Random integer between 1 and 10] at Point
- Custom script: call RemoveLocation( udg_Point )

Items is a variable of type "item type", with a check in "array".
 

wardenblack

Member
Reaction score
1
Hey thanks for the trigger above but I would like to add something else here.

How do you make a trigger that drops a item based on the lvl of the creep. for example:
I need creeps levels 1 to 20 to drop a random percent of lesser healing rune.
Than creeps lvl 20 to 40 to drop a random percent of greater healing rune.

Anyone can help with a MUI/GUI trigger for this?


Thx ,

Mike
 

RibljaCorba

TH.net Regular
Reaction score
5
Try to do this

Event:
- A unit owned by Neutral Hostile dies
Conditions:
Actions:
- Set Items[1] = Item 1
- Set Items[2] = Item 1
- Set Items[3] = Item 1
- Set Items[4] = Item 1
- Set Items[5] = Item 2
- Set Items[6] = Item 2
- Set Items[7] = Item 2
- Set Items[8] = Item 3
- Set Items[9] = Item 3
- Set Items[10] = Item 4
- Set Point = Position of (Triggering unit)
- Item - Create 1 Items[Random integer between 1 and 10] at Point
- Custom script: call RemoveLocation( udg_Point )
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top