Item Timer v1.0.4

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
  • Like
Reactions: deepstrasz
=========================================
Item Timer v1.0.4
=========================================

Not much to say about this system. I just see some RPG games have a "bad" way to clean up items dropped by monsters or anything else. So that's why I created this system. Hopefully this is acceptable. v1.0.4 is the final version.

This system simply gives timer to any items dropped by any unit. Then removes them after the timer expired. Pretty simple system.




  • IoG Drop
    • Events
      • Unit - A unit Loses an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IT_SellBoolean Equal to True
        • Then - Actions
          • Set IT_SellBoolean = False
          • Skip remaining actions
        • Else - Actions
      • Set IT_IndexMax = (IT_IndexMax + 1)
      • Set IT_Item[IT_IndexMax] = (Item being manipulated)
      • Set IT_Timer[IT_IndexMax] = IT_Duration
      • Set IT_Owner[IT_IndexMax] = (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IT_IndexMax Equal to 1
        • Then - Actions
          • Trigger - Turn on IoG Timer <gen>
        • Else - Actions
  • IoG Acquired
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer IT_Loop) from 1 to IT_IndexMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item being manipulated) Equal to IT_Item[IT_Loop]
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Triggering unit) Not equal to IT_Owner[IT_Loop]
                • Then - Actions
                  • -------- if you want the timer of acquired item to be reseted just activate this line by pressing ctrl+f --------
                  • Set IT_Timer[IT_Loop] = IT_Duration
                  • Hero - Drop (Item being manipulated) from (Triggering unit)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IT_Loop Not equal to IT_IndexMax
                    • Then - Actions
                      • Set IT_Item[IT_Loop] = IT_Item[IT_IndexMax]
                      • Set IT_Timer[IT_Loop] = IT_Timer[IT_IndexMax]
                      • Set IT_Owner[IT_Loop] = IT_Owner[IT_IndexMax]
                    • Else - Actions
                  • Set IT_IndexMax = (IT_IndexMax - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IT_IndexMax Equal to 0
                    • Then - Actions
                      • Trigger - Turn off IoG Timer <gen>
                    • Else - Actions
            • Else - Actions
  • IoG Timer
    • Events
    • Conditions
    • Actions
      • For each (Integer IT_Loop) from 1 to IT_IndexMax, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IT_Timer[IT_Loop] Greater than 0.00
            • Then - Actions
              • Set IT_Timer[IT_Loop] = (IT_Timer[IT_Loop] - IT_LoopDelay)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IT_Timer[IT_Loop] Less than or equal to 0.00
                • Then - Actions
                  • Item - Set life of IT_Item[IT_Loop] to 0.39
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IT_Loop Not equal to IT_IndexMax
                    • Then - Actions
                      • Set IT_Item[IT_Loop] = IT_Item[IT_IndexMax]
                      • Set IT_Timer[IT_Loop] = IT_Timer[IT_IndexMax]
                      • Set IT_Owner[IT_Loop] = IT_Owner[IT_IndexMax]
                    • Else - Actions
                  • Set IT_IndexMax = (IT_IndexMax - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IT_IndexMax Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                      • Set IT_Loop = (IT_Loop - 1)
                • Else - Actions
            • Else - Actions

v1.0.4- indexing optimized
- leaks removed

v1.0.0 - Uploaded

1. Copy the IT v1.0.4 folder to your map.
2. Open configurable trigger, edit all variable just like you want it
3. Done




Post here if you find anything's wrong with triggers or another objects. Don't need to give me credits. Edit it as you like. Please, give the system ratings instead of giving me rep+ (see my rep+ is disabled). End of all, enjoy :)
[TD] I. Greetings and opening words [/TD]

[TD] II. Description [/TD]

[TD] III. Characteristic [/TD]

[TD] IV. Triggers [/TD] [TD] V. Updates [/TD]
[TD] VI. How to import [/TD]

[TD] VII. Credits [/TD]
[TD] VIII. Closing words [/TD]

[TD] IX. My Resources [/TD]

Keywords:
item, timer
Contents

IT v1.0.4 (Map)

Reviews
12:24, 6th Dec 2013 Maker: You should get rid of the item ownership
Status
Not open for further replies.

Moderator

M

Moderator

12:24, 6th Dec 2013
Maker: You should get rid of the item ownership
 
Level 19
Joined
Mar 18, 2012
Messages
1,717
Most items come along with a death animation. The normal max. timeout for those is ~1.5 seconds. I think, it would be nice to see the death animation, before the item gets removed.

Edit: An item is considered as dead with a life of < 0.405. In order to kill an item you have to set the items life to < 0.401 (just tested).
GUI doesn't come along with a function, that sets item life correct to three decimal places (just two). But with a custom script you can:
  • call SetWidgetLife(udg_IoG_Item[udg_IoG_Loop], 0.401)
Maybe you can also just use the GUI function SetItemLife(item, 0.00). (didn't test that)

But now you are facing a new issue:
  • 1) Items are not properly cleaned on death (not only powerups are concerned),
  • 2) Items are not destroyed when you use "RemoveItem" on a dead item. Indeed, the model is properly hid but the handle still exists and leaks.

Luckily there are two systems which keep track of dead items

I would advise users to add one of those systems to their map, if they want to use this system given that, you concern about my recommendation. :)

As you see displaying the death animation requires some extra work.
Its up to you if it is worth it or not.
 
Last edited:
Level 38
Joined
Jun 23, 2007
Messages
4,028
why should? this is especially just for items.

I don't like how you promote your resource here. it's indirectly saying something like "hey, mine is better". sorry, but, please remove it..

That's not what I'm saying at all.
Why would I be telling you to improve your system if it was obsolete? It could be a GUI alternative and It would clearly be better if it supported all types like mine does.

Why are you being so sensitive lol
 
Level 22
Joined
Sep 24, 2005
Messages
4,820
He means that you should remove the links to your other resources.

EDIT:
these

IX. My Resources
  • Get Closest Unit 3D
  • Paralyzing Cask
  • Inventory System with Pages
  • Chain Hook
  • Arrow Missile System
  • Earth Pressure
 
Status
Not open for further replies.
Top