• 🏆 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!

[Trigger] I have a big problem and need help

Status
Not open for further replies.
Level 12
Joined
Nov 20, 2007
Messages
660
I need help at my bag system ... i don't know why it didn't work ... there is the Trigger.Who solve the problem, please post here :thumbs_up:
Bag System
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Ability being cast) Equal to Close Bag
      • Then - Actions
        • Set Player_Bag_Detect = (((Player number of (Owner of (Casting unit))) x 6) - 6)
        • For each (Integer A) from Player_Bag_Detect to (Player_Bag_Detect + 6), do (Actions)
          • Loop - Actions
            • Set Bag_System_Temp_Integer = (Bag_System_Temp_Integer + 1)
            • Set Players_Bags_Items[(Integer A)] = (Item-type of (Item carried by (Casting unit) in slot Bag_System_Temp_Integer))
            • Item - Remove (Item carried by (Casting unit) in slot Bag_System_Temp_Integer)
            • Hero - Create Player_Items[(Integer A)] and give it to (Casting unit)
        • Unit - Add Open Bag to (Casting unit)
        • Unit - Remove Close Bag from (Casting unit)
        • Set Bag_System_Temp_Integer = 0
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Ability being cast) Equal to Open Bag
      • Then - Actions
        • Set Player_Bag_Detect = (((Player number of (Owner of (Casting unit))) x 6) - 6)
        • For each (Integer A) from Player_Bag_Detect to (Player_Bag_Detect + 6), do (Actions)
          • Loop - Actions
            • Set Bag_System_Temp_Integer = (Bag_System_Temp_Integer + 1)
            • Set Player_Items[(Integer A)] = (Item-type of (Item carried by (Casting unit) in slot Bag_System_Temp_Integer))
            • Item - Remove (Item carried by (Casting unit) in slot Bag_System_Temp_Integer)
            • Hero - Create Players_Bags_Items[(Integer A)] and give it to (Casting unit)
        • Unit - Add Close Bag to (Casting unit)
        • Unit - Remove Open Bag from (Casting unit)
        • Set Bag_System_Temp_Integer = 0
      • Else - Actions
 
Level 17
Joined
Sep 8, 2007
Messages
994
Just a tip for efficiency.
You have no main condition for the trigger but still you only continue actions if conditions in the action-section are true. This causes the RAM to save free space if you activate the trigger since there is no main condition. Now, if the condition in the action-section both are false, you saved RAM for nothing what causes the map to be slowed down.
Simply said: Add this main condition to your trigger:

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • ((Ability being cast) equal to Close Bag) or ((Ability being cast) equal to Open bag)
  • Actions
    • //Your Actions
 
Level 12
Joined
Nov 20, 2007
Messages
660
Ok ... let's see ...
Photo 1
77319401.jpg

There are the free slots (Bag Status : Closed)

Photo 2
34228325.jpg

I buy some items for test (Bag Status : Closed)

Photo 3
42329308.jpg

I open the bag to buy some items on it (Bag Status : Opened)

Photo 4
19228795.jpg

I buy some items in bag (Bag Status : Opened)

Photo 5
97045131.jpg

I close the bag and the bug get started .... (Bag Status : Closed)

Photo 6
10183557.jpg

I open again the bag and still bugged ... (Bag Status : Opened)
Observation:The item from bag (slot 2 and 3) are same with the peon normal items :hohum: , but the item from first slot is changed :confused: .... Need help ... who solve this i will credit him :wink:
 
Status
Not open for further replies.
Top