HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Item Remove Trigger

05-04-2005, 06:03 PM#1
Zero
Ok, so far, I have a trigger that says every 4 min destory all items not marked as owned or invulrnable. Well, this works fine and all, the only dilema is every 4 min it kills all items, even if they were just droped by a monster you killed.

Does anyone know a more convient way I can do this?

I was thinking about doing a trigger that says when a unit dies and if its not a hero, then wait 4 min and kill, but wouldn't this confilict between all the items droped. Seeing as they would all be waiting 4 min, or would it wait a designated 4 min for each item droped?

Need some help
05-04-2005, 06:08 PM#2
Linera
I'm currently working on a system for doing just that. I'll let you know when its finished.
05-04-2005, 06:21 PM#3
Zero
Right on. Hurry :p
05-15-2005, 03:58 AM#4
Zero
Ok, I have tried many ways to do this using arrays.
They have all failed.

Can someone help me out with this trigger system?
Does anyone know of a way it can EVEN be done :(
05-15-2005, 10:07 AM#5
Zero
Ok, with the help of sansui, he came up with this system:

Code:
Items From Kills
    Events
        Unit - A unit owned by Neutral Hostile Dies
    Conditions
        (((Killing unit) is A Hero) Equal to True) or (((Killing unit) is Summoned) Equal to True)
    Actions
        Set RandomLoot = (Random integer number between 1 and 100)
        -------- Gold --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (RandomLoot Greater than or equal to 80) and (RandomLoot Less than or equal to 100)
            Then - Actions
                For each (Integer A) from 1 to 55, do (If ((Unit-type of (Dying unit)) Equal to Lv01_02Monsters[(Integer A)]) then do (Item - Create 50 Gold Coins at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 73, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create 100 Gold Coins at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 62, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create 150 Gold Coins at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 32, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create 200 Gold Coins at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 26, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create 250 Gold Coins at (Position of (Dying unit))) else do (Do nothing))
            Else - Actions
                Do nothing
        -------- Normal Items --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (RandomLoot Greater than or equal to 65) and (RandomLoot Less than or equal to 79)
            Then - Actions
                -------- Melee --------
                For each (Integer A) from 1 to 14, do (If ((Unit-type of (Dying unit)) Equal to Lv01_02Monsters[(Integer A)]) then do (Item - Create Items_Lv01[(Random integer number between 1 and 2)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 28 to 42, do (If ((Unit-type of (Dying unit)) Equal to Lv01_02Monsters[(Integer A)]) then do (Item - Create Items_Lv02[(Random integer number between 1 and 6)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_Lv03[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 46 to 58, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_Lv04[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 11, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_Lv05[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 34 to 44, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_Lv06[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 6, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_Lv07[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 17 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_Lv08[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 5, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_Lv09[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 14 to 18, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_Lv10[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                -------- Ranged --------
                For each (Integer A) from 15 to 21, do (If ((Unit-type of (Dying unit)) Equal to Lv01_02Monsters[(Integer A)]) then do (Item - Create Items_Lv01[(Random integer number between 3 and 4)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 43 to 47, do (If ((Unit-type of (Dying unit)) Equal to Lv01_02Monsters[(Integer A)]) then do (Item - Create Items_Lv02[(Random integer number between 7 and 13)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 23 to 33, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_Lv03[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 59 to 65, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_Lv04[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 12 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_Lv05[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 45 to 53, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_Lv06[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 7 to 11, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_Lv07[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 23 to 27, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_Lv08[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 6 to 9, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_Lv09[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 19 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_Lv10[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                -------- Magic --------
                For each (Integer A) from 22 to 27, do (If ((Unit-type of (Dying unit)) Equal to Lv01_02Monsters[(Integer A)]) then do (Item - Create Items_Lv01[(Random integer number between 5 and 6)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 48 to 55, do (If ((Unit-type of (Dying unit)) Equal to Lv01_02Monsters[(Integer A)]) then do (Item - Create Items_Lv02[(Random integer number between 14 and 18)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 34 to 45, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_Lv03[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 66 to 73, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_Lv04[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 23 to 33, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_Lv05[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 54 to 62, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_Lv06[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 12 to 16, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_Lv07[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 28 to 32, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_Lv08[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 10 to 13, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_Lv09[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 23 to 26, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_Lv10[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
            Else - Actions
                Do nothing
        -------- Enhanced --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (RandomLoot Greater than or equal to 54) and (RandomLoot Less than or equal to 64)
            Then - Actions
                -------- Melee --------
                For each (Integer A) from 1 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 46 to 58, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 1 and 5)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 11, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 15 and 19)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 34 to 44, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 15 and 19)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 6, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 29 and 33)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 17 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 29 and 33)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 5, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 43 and 47)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 14 to 18, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 43 and 47)] at (Position of (Dying unit))) else do (Do nothing))
                -------- Ranged --------
                For each (Integer A) from 23 to 33, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 59 to 65, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 6 and 10)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 12 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 20 and 24)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 45 to 53, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 20 and 24)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 7 to 11, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 34 and 38)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 23 to 27, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 34 and 38)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 6 to 9, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 48 and 52)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 19 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 48 and 52)] at (Position of (Dying unit))) else do (Do nothing))
                -------- Magic --------
                For each (Integer A) from 34 to 45, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 66 to 73, do (If ((Unit-type of (Dying unit)) Equal to Lv03_04Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 11 and 14)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 23 to 33, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 25 and 28)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 54 to 62, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 25 and 28)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 12 to 16, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 39 and 42)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 28 to 32, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 39 and 42)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 10 to 13, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 53 and 56)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 23 to 26, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllEnhanced[(Random integer number between 53 and 56)] at (Position of (Dying unit))) else do (Do nothing))
            Else - Actions
                Do nothing
        -------- Rare --------
        -------- This is for Lv's 5-6 + --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (RandomLoot Greater than or equal to 47) and (RandomLoot Less than or equal to 53)
            Then - Actions
                -------- Melee --------
                For each (Integer A) from 1 to 11, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 15 and 19)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 34 to 44, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 15 and 19)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 6, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 29 and 33)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 17 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 29 and 33)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 1 to 5, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 43 and 47)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 14 to 18, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 43 and 47)] at (Position of (Dying unit))) else do (Do nothing))
                -------- Ranged --------
                For each (Integer A) from 12 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 20 and 24)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 45 to 53, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 20 and 24)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 7 to 11, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 34 and 38)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 23 to 27, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 34 and 38)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 6 to 9, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 48 and 52)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 19 to 22, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 48 and 52)] at (Position of (Dying unit))) else do (Do nothing))
                -------- Magic --------
                For each (Integer A) from 23 to 33, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 25 and 28)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 54 to 62, do (If ((Unit-type of (Dying unit)) Equal to Lv05_06Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 25 and 28)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 12 to 16, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 39 and 42)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 28 to 32, do (If ((Unit-type of (Dying unit)) Equal to Lv07_08Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 39 and 42)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 10 to 13, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 53 and 56)] at (Position of (Dying unit))) else do (Do nothing))
                For each (Integer A) from 23 to 26, do (If ((Unit-type of (Dying unit)) Equal to Lv09_10Monsters[(Integer A)]) then do (Item - Create Items_AllRare[(Random integer number between 53 and 56)] at (Position of (Dying unit))) else do (Do nothing))
            Else - Actions
                Do nothing
        -------- Unique --------
        -------- This is for Lv's 7-8 + --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (RandomLoot Greater than or equal to 44) and (RandomLoot Less than or equal to 46)
            Then - Actions
            Else - Actions
                Do nothing
        -------- -------------------------------------------------------ITEM REMOVAL SET UP------------------------------------------------------- --------
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RandomLoot Greater than or equal to 47
            Then - Actions
                Set Item_Removal_Counter = (Item_Removal_Counter + 1)
                Set Item_Removal_Item[Item_Removal_Counter] = (Last created item)
                Trigger - Add to Item Removal Kill Item <gen> the event (Time - Item_Removal_Timer[Item_Removal_Counter] expires)
                Trigger - Run Item Removal Timer Creation <gen> (checking conditions)
            Else - Actions
                Do nothing

Code:
Items From Drops
    Events
        Unit - A unit Loses an item
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        ((Item being manipulated) is owned) Equal to True
                        ((Item being manipulated) is invulnerable) Equal to True
                        (Current life of (Item being manipulated)) Not equal to 10.00
            Then - Actions
                Do nothing
            Else - Actions
                Set Item_Removal_Counter = (Item_Removal_Counter + 1)
                Set Item_Removal_Item[Item_Removal_Counter] = (Item being manipulated)
                Trigger - Add to Item Removal Kill Item <gen> the event (Time - Item_Removal_Timer[Item_Removal_Counter] expires)
                Trigger - Run Item Removal Timer Creation <gen> (checking conditions)

Code:
Item Removal Timer Creation
    Events
    Conditions
    Actions
        Countdown Timer - Start Item_Removal_Timer[Item_Removal_Counter] as a One-shot timer that will expire in 240.00 seconds
        Set Item_Removal_Timer[Item_Removal_Counter] = (Last started timer)

Code:
Item Removal Kill Item
    Events
    Conditions
    Actions
        Set Item_Removal_Counter2 = (Item_Removal_Counter2 + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Item_Removal_Item[Item_Removal_Counter2] is owned) Equal to True
                        (Item_Removal_Item[Item_Removal_Counter2] is invulnerable) Equal to True
                        (Current life of Item_Removal_Item[Item_Removal_Counter2]) Not equal to 10.00
            Then - Actions
                Do nothing
            Else - Actions
                Item - Remove Item_Removal_Item[Item_Removal_Counter2]

Here is a picture, if that was 2 drastic for ya.



On a test map, this worked, well, without the first trigger's unit stuff. Just the ITEM REMOVE part.

Anyways, on my map, with these exact triggers, it fails to work.
When you drop an item, it won't fire and when an item drops from killing a unit, IT runs the timer, but then it doesn't remove the item.

SOMEONE help me plz, going crazy
05-15-2005, 10:50 AM#6
Anitarf
Damn, making RPGs is one big mess.

OK, first of all, there are some differences between the triggers on the pictures and the triggers copied as text, like the duration of the timer and in the first trigger it doesn't start timers for unique items in the text but it does on the picture. Just some minor differences that probably don't mean any trouble. You also have a picture of the second trigger twice and no picture of the fourth... but this doesn't really matter, we got all the triggers in text, that's what I'll be looking at.

My first guess would be that your destroyable items don't have 10 hit points as they should (because the triggers only destroy items (and also only start a new timer if an item is dropped) if they are not owned, not invulnerable and have 10 hp).

If that's not it, then I would ask you to test some more and give us more information on how the system behaves in action. Try testing only the triggers that already worked on the test map, to see if it's maybe just the new trigger that's messing stuff up and the old triggers still work as they did if the new one never runs. If not, run the test map again and triple test everything there, to see if there might be problems with the original triggers that you might not have seen. If the triggers work perfectly in the test map, but not in your map, then it's probably some other triggers messing things up, although I can't see how exactly, you don't have any actions that would likely cause other triggers to run, and you also use only global variables that are reserved for this system, so even if other triggers would run they couldn't mess things up.
05-15-2005, 05:38 PM#7
Zero
Quote:
Originally Posted by Anitarf
Damn, making RPGs is one big mess.

Agreed. It is a pain in the ass and a complete mess. Slowly but surley, it's getting done :)

Quote:
Originally Posted by Anitarf
My first guess would be that your destroyable items don't have 10 hit points as they should (because the triggers only destroy items (and also only start a new timer if an item is dropped) if they are not owned, not invulnerable and have 10 hp).

The condtions should be:

- Not Owned
- Not Invulrnable
- NOT 10 LIFE

Did I set this wrong? I changed it from not equal to 10 to equal to 10 on the item remove, 4th trigger, but wouldn't I leave it to "not equal" on the drop trigger, the 2nd one?
05-15-2005, 06:43 PM#8
Elven Ronin
What about making a map-wide tornado building damage aura based ability that targets items, dealing the right amount of damage to kill them after 4 minutes by steadily draining their health? I've heard that ability works before for killing items.

This just means setting "owned" items to be invulnerable also, is that a problem?
05-15-2005, 06:49 PM#9
Anitarf
Ahh, I see the problem now most certainly. You want your conditions to be:

- Not Owned
- Not Invulnerable
- NOT 10 LIFE

However, because you put the remove actions under "else - actions", you have to use the inverse conditions:

- Owned
- Invulnerable
- 10 LIFE

But you mixed something up here and you put:

- Owned
- Invulnerable
- NOT 10 LIFE

That's why it doesn't work. You should definitely fix this in both triggers.

It should work after you fix it. However, you may have a problem here: variable arrays only go up to 8000 or something like that and after that, I don't know exactly what happens, but it just doesn't work. Because you don't recycle places in the array, you will eventually get to this limit. I don't know, maybe that will happen after about 20 hours of intensive play, in that case, you don't need to worry. But, if it happens sooner, or, if a player just decides to start mass dropping and picking up items, you have a problem. I know that it may never happen, but still, it's just not nice to code things so inefficiently and with potential bugs. If you want, I can rewrite the system to be more optimized for you.
05-15-2005, 07:10 PM#10
SADISM
Well one of your problems lie with the detection of an item being dropped. When a unit drops an item in its inventory the trigger still counts that item as owned, so the trigger will not fire because you have it ignore items that are owned.

Here's a little trigger you can setup to test this problem:

Code:
Item Drops
    Events
        Unit - A unit Loses an item
    Conditions
        ((Item being manipulated) is owned) Equal to True
    Actions
        Game - Display to (All players) the text: test
05-15-2005, 08:06 PM#11
Anitarf
Quote:
Originally Posted by SADISM
Well one of your problems lie with the detection of an item being dropped. When a unit drops an item in its inventory the trigger still counts that item as owned, so the trigger will not fire because you have it ignore items that are owned.

I assume that the "item is owned" condition was put there to ignore items that are given from one hero directly to another, but you're correct, it is also true when a player drops an item to the ground, so that should also be the cause of things not working. Since the item remove trigger already checks if an item that was dropped is owned at the time it is trying to remove it, you should be safe when removing the condition from the trigger that detects item drops.

However, the system has another problem that I noticed right now. If you drop an item, then pick it up, carry it for some time, then drop it again 230 seconds after you dropped it the first time, it will be removed after 10 seconds. This could be fixed with another trigger which, when a hero acquires an item, loops through the array of items-to-be-destroyed from index Item_Removal_Counter2 to index Item_Removal_Counter and clears the item data if (Item_Removal_Item[(IntegerA)] == (Item being manipulated)). That way, when the timers expire, they will remove no item if the item that was originaly stored there was picked up in the meantime. Even with this "bug" gone, the system is still inefficient and potentially nonworking.
05-15-2005, 08:09 PM#12
Zero
Quote:
Originally Posted by Anitarf
It should work after you fix it. However, you may have a problem here: variable arrays only go up to 8000 or something like that and after that, I don't know exactly what happens, but it just doesn't work. Because you don't recycle places in the array, you will eventually get to this limit. I don't know, maybe that will happen after about 20 hours of intensive play, in that case, you don't need to worry. But, if it happens sooner, or, if a player just decides to start mass dropping and picking up items, you have a problem. I know that it may never happen, but still, it's just not nice to code things so inefficiently and with potential bugs. If you want, I can rewrite the system to be more optimized for you.

That would be awesome. I use WEU though, so, it would have to be done with this.

SADISM,
Yea, as for the drop trigger. I removed these conditions, and put only these:

- Is it being drop from a hero equal to false
- Life is not equal to 10

UPDATE:
OK! We got all the triggers to run now, BUT the only thing that still isn't working, is for some reason, it will only fire ONE timer... and thus only removes the FIRST item...

We are thinking that maybe it is WEU?

EDIT:

Quote:
Originally Posted by Anitarf
I assume that the "item is owned" condition was put there to ignore items that are given from one hero directly to another, but you're correct, it is also true when a player drops an item to the ground, so that should also be the cause of things not working. Since the item remove trigger already checks if an item that was dropped is owned at the time it is trying to remove it, you should be safe when removing the condition from the trigger that detects item drops.

However, the system has another problem that I noticed right now. If you drop an item, then pick it up, carry it for some time, then drop it again 230 seconds after you dropped it the first time, it will be removed after 10 seconds. This could be fixed with another trigger which, when a hero acquires an item, loops through the array of items-to-be-destroyed from index Item_Removal_Counter2 to index Item_Removal_Counter and clears the item data if (Item_Removal_Item[(IntegerA)] == (Item being manipulated)). That way, when the timers expire, they will remove no item if the item that was originaly stored there was picked up in the meantime. Even with this "bug" gone, the system is still inefficient and potentially nonworking.

Can you re-write it plz. IF you think it will work with WEU. It would be greatly appricated
05-15-2005, 08:30 PM#13
Anitarf
I'll do it with normal WE so I'm sure any "advanced" will be able to open it. I won't use timers at all so if that's the problem, it won't be anymore. I'll recycle a recycler from my arena.. Ha, isn't that funny, recycle a recycler, get it? :) ... *looks around, sees noone laughing* Ok, I'll get to work...
05-15-2005, 08:38 PM#14
BlinkBoy
Hmm i will try making a better system.

is not really difficult, but could be laggy.
05-15-2005, 11:17 PM#15
BlinkBoy
Quote:
Originally Posted by BlinkBoy
Hmm i will try making a better system.

is not really difficult, but could be laggy.
Ok i finished my System, reduces code alot, in difference to yours and works well, change the time from 30 to 240 so it remove the iten every 4 minutes.

oh and add the live condition, i didn't understood well what you wanted with the live, so i didn't added the condition.