| 04-02-2007, 06:15 AM | #1 |
trying to get items i have created from triggers to be removed after a set amount of time on ground. tried adding the timed life after the item is created blah blah and got nothing. heres the trigger i have so far. Events Unit - A unit owned by Neutral Passive Dies Actions Item - Create (Random level 10 item-type) at (Position of (Dying unit)) Item - Set life of (Last created item) to 10.00 Wait 15.00 seconds Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Passive at (Position of (Dying unit)) facing (Facing of (Dying unit)) degrees problem is that when the item is created it stays there and it seems the trigger that gives it timed life isnt working. any help would be nice. |
| 04-02-2007, 10:32 AM | #2 |
anyone up to helping me? |
| 04-02-2007, 11:22 AM | #3 |
It's been four hours. Don't double post and have patience. That function doesn't give an item 'timed life'. Items have life just like units have life. So all you're doing is giving the item 10 life. You could wait 10 seconds and then remove the item if you feel so inclined. (Might be useful if items could have hp regen xD) |
| 04-02-2007, 12:21 PM | #4 |
So you want the item to be removed after 15 seconds? Well if so make a variable called Item_ItemGettingRemoved and do this trigger: Events Unit - A unit owned by Neutral Passive Dies Actions Item - Create (Random level 10 item-type) at (Position of (Dying unit)) Set Item_ItemGettingRemoved = (Last created item) Wait 15.00 seconds Item - Remove Item_ItemGettingRemoved Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Passive at (Position of The problem with this way is if you kill another unit before 15 seconds is over it doesn't work. I'm not sure if there's a simpler way but you could make 15 variables Item_ItemGettingRemoved1, Item_ItemGettingRemoved2 etc and have 15 different triggers. The triggers would look like this: Events Unit - A unit owned by Neutral Passive Dies Actions Item - Create (Random level 10 item-type) at (Position of (Dying unit)) Set Item_ItemGettingRemoved1 = (Last created item) Trigger - Turn of (This trigger) Wait 15.00 seconds Trigger - Turn on (This trigger) Item - Remove Item_ItemGettingRemoved1 Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Passive at (Position of Events Unit - A unit owned by Neutral Passive Dies Actions Item - Create (Random level 10 item-type) at (Position of (Dying unit)) Set Item_ItemGettingRemoved2 = (Last created item) Trigger - Turn of (This trigger) Wait 15.00 seconds Trigger - Turn on (This trigger) Item - Remove Item_ItemGettingRemoved2 Unit - Create 1 (Unit-type of (Dying unit)) for Neutral Passive at (Position of and keep doing that untill you have 15 different triggers. Hope this has helped. |
| 04-02-2007, 07:17 PM | #5 |
Using global vars tat way makes things complicated. Use local vars is better. But if u dont knwo jass then u need to find a more logical way |
| 04-02-2007, 09:28 PM | #6 |
right now i have it removing a random item on the map evey 15 seconds and set the buildings path req to nothing so it respawns on top of the item. it works for now but i would like a better way of doing it. |
| 04-02-2007, 10:17 PM | #7 |
I have a method but it wont work if tere are many items in 1 spot. Gui is really hard |
| 04-04-2007, 02:10 AM | #9 |
lol ure evil one :D |
| 04-04-2007, 03:00 AM | #10 |
I would recommend at least a 30 second time to pick-up items, or only delete them if a player is not within a certain distance. Some people (myself included) take a while to pick-up item, as we have to read and compare the numerous descriptions. And let me tell you, its a pain when you are deciding what item to pick up when suddenly, it disappears. |
