Strange Item Problem

Azylaminaz

Vox Populi
Reaction score
91
This is a problem I have never seen before. o_O

Okay, I am making it so all items can stack, charges can stack nine times, and constants (such as blades, cloak, and others) can stack five times.

I used the following triggers for stacking (made by someone I forgot):
Code:
Stack
    Events
        Unit - A unit Acquires an item
    Conditions
        (Charges remaining in (Item being manipulated)) Not equal to 0
    Actions
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to (Item-type of (Item being manipulated))
                        (Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) Less than (Item level of (Item carried by (Hero manipulating item) in slot (Integer A)))
                        (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to (Item being manipulated)
                    Then - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated))) Greater than (Item level of (Item being manipulated))
                            Then - Actions
                                Item - Set charges remaining in (Item being manipulated) to (((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated))) - (Item level of (Item being manipulated)))
                                Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to (Item level of (Item being manipulated))
                            Else - Actions
                                Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A)) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot (Integer A))) + (Charges remaining in (Item being manipulated)))
                                Item - Remove (Item being manipulated)
                    Else - Actions
Code:
Split
    Events
        Unit - A unit Is issued an order targeting an object
    Conditions
    Actions
        Custom script: set udg_order = GetIssuedOrderId()
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                order Greater than or equal to 852002
                order Less than or equal to 852007
                (Target item of issued order) Equal to (Item carried by (Ordered unit) in slot (order - 852001))
                (Charges remaining in (Target item of issued order)) Greater than 1
            Then - Actions
                Item - Set charges remaining in (Target item of issued order) to ((Charges remaining in (Target item of issued order)) - 1)
                Set L = (Position of (Ordered unit))
                Item - Create (Item-type of (Target item of issued order)) at L
                Custom script: call RemoveLocation(udg_L)
                Item - Set charges remaining in (Last created item) to 1
            Else - Actions
Those work great. The problem is, it doesn't exactly stack the constant effects of items like blades and such, so I did the following for the cloak(untested, but if you can spot an error, would be helpful):
Code:
Timed Abilities
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Set TempGroup[0] = (Units in (Entire map))
        Unit Group - Pick every unit in TempGroup[0] and do (Actions)
            Loop - Actions
                Set TempLocation[0] = (Position of (Picked unit))
                For each (Integer A) from 1 to 6, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Item-type of (Item carried by (Picked unit) in slot (Integer A))) Equal to Cloak of Flames [280]
                            Then - Actions
                                Set TempUnit[0] = (Picked unit)
                                Set TempGroup[1] = (Units within 160.00 of TempLocation[0])
                                Unit Group - Pick every unit in TempGroup[1] and do (Actions)
                                    Loop - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                ((Picked unit) is A structure) Equal to True
                                            Then - Actions
                                                Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - ((Real((Charges remaining in (Item carried by TempUnit[0] in slot (Integer A))))) x 10.00))
                                            Else - Actions
                                Custom script: call DestroyGroup (udg_TempGroup[1])
                            Else - Actions
                Custom script: call RemoveLocation (udg_TempLocation[0])
        Custom script: call DestroyGroup (udg_TempGroup[0])

The real problem is with true constants, such as the blade, I attempted to fix it this way:
Code:
Claws
    Events
        Unit - A unit Acquires an item
        Unit - A unit Loses an item
    Conditions
    Actions
        Trigger - Run Claws Finish <gen> (checking conditions)
Code:
Claws Finish
    Events
    Conditions
    Actions
        Trigger - Turn off Claws <gen>
        Set TempGroup[0] = (Units in (Entire map))
        Unit Group - Pick every unit in TempGroup[0] and do (Actions)
            Loop - Actions
                For each (Integer A) from 1 to 6, do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                Or - Any (Conditions) are true
                                    Conditions
                                        (Item-type of (Item carried by (Picked unit) in slot (Integer A))) Equal to Claws of Attack +50 [210] One
                                        (Item-type of (Item carried by (Picked unit) in slot (Integer A))) Equal to Claws of Attack +50 [210] Two
                                        (Item-type of (Item carried by (Picked unit) in slot (Integer A))) Equal to Claws of Attack +50 [210] Three
                                        (Item-type of (Item carried by (Picked unit) in slot (Integer A))) Equal to Claws of Attack +50 [210] Four
                                        (Item-type of (Item carried by (Picked unit) in slot (Integer A))) Equal to Claws of Attack +50 [210] Five
                            Then - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        (Charges remaining in (Item carried by (Picked unit) in slot (Integer A))) Equal to 1
                                    Then - Actions
                                        Item - Remove (Item carried by (Picked unit) in slot (Integer A))
                                        Hero - Create Claws of Attack +50 [210] One and give it to (Picked unit)
                                    Else - Actions
                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            If - Conditions
                                                (Charges remaining in (Item carried by (Picked unit) in slot (Integer A))) Equal to 2
                                            Then - Actions
                                                Item - Remove (Item carried by (Picked unit) in slot (Integer A))
                                                Hero - Create Claws of Attack +50 [210] Two and give it to (Picked unit)
                                                Hero - Create Claws of Attack +50 [210] Two and give it to (Picked unit)
                                            Else - Actions
                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                    If - Conditions
                                                        (Charges remaining in (Item carried by (Picked unit) in slot (Integer A))) Equal to 3
                                                    Then - Actions
                                                        Item - Remove (Item carried by (Picked unit) in slot (Integer A))
                                                        Hero - Create Claws of Attack +50 [210] Three and give it to (Picked unit)
                                                        Hero - Create Claws of Attack +50 [210] Three and give it to (Picked unit)
                                                        Hero - Create Claws of Attack +50 [210] Three and give it to (Picked unit)
                                                    Else - Actions
                                                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                            If - Conditions
                                                                (Charges remaining in (Item carried by (Picked unit) in slot (Integer A))) Equal to 4
                                                            Then - Actions
                                                                Item - Remove (Item carried by (Picked unit) in slot (Integer A))
                                                                Hero - Create Claws of Attack +50 [210] Four and give it to (Picked unit)
                                                                Hero - Create Claws of Attack +50 [210] Four and give it to (Picked unit)
                                                                Hero - Create Claws of Attack +50 [210] Four and give it to (Picked unit)
                                                                Hero - Create Claws of Attack +50 [210] Four and give it to (Picked unit)
                                                            Else - Actions
                                                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                                    If - Conditions
                                                                        (Charges remaining in (Item carried by (Picked unit) in slot (Integer A))) Equal to 5
                                                                    Then - Actions
                                                                        Item - Remove (Item carried by (Picked unit) in slot (Integer A))
                                                                        Hero - Create Claws of Attack +50 [210] Five and give it to (Picked unit)
                                                                        Hero - Create Claws of Attack +50 [210] Five and give it to (Picked unit)
                                                                        Hero - Create Claws of Attack +50 [210] Five and give it to (Picked unit)
                                                                        Hero - Create Claws of Attack +50 [210] Five and give it to (Picked unit)
                                                                        Hero - Create Claws of Attack +50 [210] Five and give it to (Picked unit)
                                                                    Else - Actions
                            Else - Actions
        Custom script: call DestroyGroup (udg_TempGroup[0])
        Trigger - Turn on Claws <gen>
Two triggers to fix the never ending loop(how fun it is when you find them).
Five items, each with a different damage ability(50, 100, 150, 200, 250).

I got multiple problems here.. One, the items would stack in a strange matter sometimes.. But the big problem was... the damage effects stayed.. As in, say I had three stack claws (it would be converted to three 150 stacks, but only one takes effect).. it would work. But when I "lost"(dropped, sold, whatever), the damage effects would stay. So I could just drop and pick up the item until I had +3428934892378942350 damage... o_O

Can someone tell me why the effects would stay and how to remove the bug?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top