• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Itempools

Status
Not open for further replies.

Ham

Ham

Level 5
Joined
Jan 16, 2009
Messages
132
Is there a way for item pools to drop nothing at all? like 20% an item 20% other, 60% nothing.

and also i'd like to set a porcentage instead of droping an item, it spawn an hostile unit, how would i do so? i was thinking of using triggers with it such, when item is on map remove item - add unit.

any ideas? rep +
 
Level 10
Joined
Apr 13, 2008
Messages
711
Normally I think you would have a trigger to do that, ask somebody else about that but...


When you set a table/drop thingy for a unit. If you put in like 5 items for a 20% for each item. Then remove 3 of them, I think the remaining 2 items only have a 40%/100% of dropping I think. Might be a WE bug that the dialog dosen't update but I suppose you could try it.
 
Level 9
Joined
Aug 1, 2008
Messages
453
If you wanted to do a trigger for the dieing unit you could do this:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to (the unit)
  • Actions
    • Set Set_Point = (Position of (Dying unit))
    • Unit - Create 1 (Spawning Unit) for Neutral Passive at Set_Point facing (Position of (Dying unit))
    • Custom script: call RemoveLocation( udg_Set_Point )
+rep if that helped
 
Level 11
Joined
May 31, 2008
Messages
698
You can change the percentage of the item to drop from a creep. Just put all ur items in then double click the item and at the top of the box that pops up it will say "Chance" as a percentage. You can change that to whatever you want as long as the total chance to drop an item is 100 or less

EDIT:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • Dying unit is evil
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 25
        • Then - Actions
          • Unit - Create 1 Whatever for Bad Guys at (Position of (Dying unit)) facing Default building facing degrees
        • Else - Actions
I think this should be good, just change the 25 in "less than or equal to 25" to whatever number you want and that will be the chance that a unit will spawn (if you made it 50 there would be 50% chance for a unit to spawn)

^sorry for double post!!!!^ >.< my bad
 
Last edited by a moderator:
Level 4
Joined
May 4, 2008
Messages
113
Alternate way of doing it, helpful if you have LOTS of items and don't want tonnes of if/then/else's

Unit Type array variable called UnitDrop

Code:
Events
 Unit dies

Conditions
 Your conditions

Actions
 Set UnitDrop[1] = Thing1
 Set UnitDrop[2] = Thing2
 Set UnitDrop[3] = Thing3
 Create 1 UnitDrop[Random integer number between 1 and 3] at (Position of (Dying unit)) for <your player> facing <your degrees>

You can change that max integer number beyond the number of arrays to give it a chance to drop nothing, and you can put a unit in two fields to give it a higher chance of dropping.

Nothing against the above way, just thought Id throw this in as an extra incase you wanted to use this instead. :D

EDIT: Changed to units due to poor reading skills on my behalf :D
 
Last edited:

Ham

Ham

Level 5
Joined
Jan 16, 2009
Messages
132
Normally I think you would have a trigger to do that, ask somebody else about that but...


When you set a table/drop thingy for a unit. If you put in like 5 items for a 20% for each item. Then remove 3 of them, I think the remaining 2 items only have a 40%/100% of dropping I think. Might be a WE bug that the dialog dosen't update but I suppose you could try it.

NinjasDotFight Itempools works with weight and not percentage, an example, if an item from the itempool's weight is 1 and other item is 1 too, (just these two items used) they chance to drop is 50% for each one because both of them have the same weight, i just wanted to make "an empty item" kind of, so when the chance (15%) drops nothing at all. (i am not using drop list, i am using itempools)

If you wanted to do a trigger for the dieing unit you could do this:
  • Events
    • Unit - A unit Dies
  • Conditions
    • (Unit-type of (Triggering unit)) Equal to (the unit)
  • Actions
    • Set Set_Point = (Position of (Dying unit))
    • Unit - Create 1 (Spawning Unit) for Neutral Passive at Set_Point facing (Position of (Dying unit))
    • Custom script: call RemoveLocation( udg_Set_Point )
+rep if that helped

Shendoo2 as i explained in the first post, this trigger won't help me because i want it to have a chance to create an unit, and not always and just not randomly, the unit must create when the item-drop-unit doesn't drop anything at all then it will have a chance to make that unit for neutral passive.

You can change the percentage of the item to drop from a creep. Just put all ur items in then double click the item and at the top of the box that pops up it will say "Chance" as a percentage. You can change that to whatever you want as long as the total chance to drop an item is 100 or less

  • Untitled Trigger 001
    • Events
      • Unit - A unit Dies
    • Conditions
      • Dying unit is evil
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to 25
        • Then - Actions
          • Unit - Create 1 Whatever for Bad Guys at (Position of (Dying unit)) facing Default building facing degrees
        • Else - Actions
I think this should be good, just change the 25 in "less than or equal to 25" to whatever number you want and that will be the chance that a unit will spawn (if you made it 50 there would be 50% chance for a unit to spawn)

^sorry for double post!!!!^ >.< my bad

wolfman sorry again your trigger is to old for me, i am using itempools which is better way i know for item drops and they don't work with custom item-drop-list, your trigger isn't bad but it still need some fixes like "(Random integer number between 1 and 100)" you must first set a value for random integer else it will be leaking, and then again, you must make a trigger to get the exact integer from it, otherwise it'd make the times the "%" ur making in items, an example "Less than or equal to 25" if the integer is 17 it will make 17 items, i have already try it myself ;)

PS: you can just merge posts (copy one to notepad, delete the post and post it back to the first one) so you won't be double posting.

Alternate way of doing it, helpful if you have LOTS of items and don't want tonnes of if/then/else's

Unit Type array variable called UnitDrop

Code:
Events
 Unit dies

Conditions
 Your conditions

Actions
 Set UnitDrop[1] = Thing1
 Set UnitDrop[2] = Thing2
 Set UnitDrop[3] = Thing3
 Create 1 UnitDrop[Random integer number between 1 and 3] at (Position of (Dying unit)) for <your player> facing <your degrees>

You can change that max integer number beyond the number of arrays to give it a chance to drop nothing, and you can put a unit in two fields to give it a higher chance of dropping.

Nothing against the above way, just thought Id throw this in as an extra incase you wanted to use this instead. :D

EDIT: Changed to units due to poor reading skills on my behalf :D

so i must not use itempools you say?
 
Status
Not open for further replies.
Top