Item Upgrade Messup

Knatten

New Member
Reaction score
7
Hello, ive just created this item upgrade trigger but when i buy the Spyglass - Level 1 item, it directly upgrades to level 3.

Code:
Spyglass upgrade
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Spyglass - [|cffffcc00Level 1|r]
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has an item of type Spyglass - [|cffffcc00Level 1|r]) Equal to True
            Then - Actions
                Item - Remove (Item carried by (Triggering unit) of type Spyglass - [|cffffcc00Level 1|r])
                Hero - Create Spyglass - [|cffffcc00Level 2|r] and give it to (Triggering unit)
                Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has an item of type Spyglass - [|cffffcc00Level 2|r]) Equal to True
            Then - Actions
                Item - Remove (Item carried by (Triggering unit) of type Spyglass - [|cffffcc00Level 2|r])
                Hero - Create Spyglass - [|cffffcc00Level 3|r] and give it to (Triggering unit)
                Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
            Else - Actions

Where did i mess up :S ?
 

Chocobo

White-Flower
Reaction score
409
Check your trigger.

Condition 1 : Check if the unit has a Spyglass Level 1 which is the condition to fire the trigger ; the condition will be always true in that case.
Action 1 : Removes that item and creates a Spyglass Level 2.
Condition 2 : Check if the unit has the Spyglass Level 2 ; a spyglass was created to the hero because he had a Spyglass Level 1 -> condition true
Action 2 : Creates the Spyglass Level 3 and removes the old item...


That is the answer to your question ; to solve it, it requires a bit more info about upgrading your item (do you need to buy 3 times the Spyglass Level 1 to upgrade to level 3? and so on..)
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
This functions the same as item stacking, you should search for that trigger and you'll solve this in no time. What your current one is doing is reading all the items in a stream line you can say...since you are obtaining each time.
 

Knatten

New Member
Reaction score
7
Yes, i need to buy spyglass 3 times to upgrade it to level 3, but i have no idea which conditions i should add.

Okay, im gonna do that now Cidzero, didn't refresh page so i didn't see your anwser.
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
Just add a Skip Remaining Actions at the end of the first Then grouping, and your problem should go since it won't check the second If if the first If uses it's Then actions. Or, you could just move the second If into the Else-actions of the first If.
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
If the if is met, the else is stopped.

His trigger is running everytime he obtains an item, and he obtains the item each use till he gets lvl 3. The trigger is giving the needed items essentially..
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
>If the if is met, the else is stopped.
That's the point. If he changes his trigger so it looks like this:
Code:
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has an item of type Spyglass - [|cffffcc00Level 1|r]) Equal to True
            Then - Actions
                Item - Remove (Item carried by (Triggering unit) of type Spyglass - [|cffffcc00Level 1|r])
                Hero - Create Spyglass - [|cffffcc00Level 2|r] and give it to (Triggering unit)
                Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
            Else - Actions
               If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                   If - Conditions
                       ((Triggering unit) has an item of type Spyglass - [|cffffcc00Level 2|r]) Equal to True
                   Then - Actions
                       Item - Remove (Item carried by (Triggering unit) of type Spyglass - [|cffffcc00Level 2|r])
                       Hero - Create Spyglass - [|cffffcc00Level 3|r] and give it to (Triggering unit)
                       Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                   Else - Actions

Then it will only give the item once.
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
heh...didn't notice that ^_^ his if/else aren't stacked lol so its checking both in a row during the same run lol That could solve the problem...very simple indeed.
 

Knatten

New Member
Reaction score
7
:banghead: I still don't get it, read the item stacking tuts and tried to stack the If/then/else, but then, the hero will instantly get the Spyglass level 2 and if he buys a spyglass again he will get another one level 2.
 

Knatten

New Member
Reaction score
7
Ok, so my trigger looks right now like this

Code:
Spyglass upgrade
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to Spyglass - [|cffffcc00Level 1|r]
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has an item of type Spyglass - [|cffffcc00Level 1|r]) Equal to True
            Then - Actions
                Item - Remove (Item carried by (Triggering unit) of type Spyglass - [|cffffcc00Level 1|r])
                Hero - Create Spyglass - [|cffffcc00Level 2|r] and give it to (Triggering unit)
                Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                Skip remaining actions
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Triggering unit) has an item of type Spyglass - [|cffffcc00Level 2|r]) Equal to True
                    Then - Actions
                        Item - Remove (Item carried by (Triggering unit) of type Spyglass - [|cffffcc00Level 2|r])
                        Hero - Create Spyglass - [|cffffcc00Level 3|r] and give it to (Triggering unit)
                        Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                    Else - Actions

But still wont work >_<!
 

trb92

Throwing science at the wall to see what sticks
Reaction score
142
Code:
((Triggering unit) has an item of type Spyglass - [|cffffcc00Level 1|r])
Will always be true, because your detecting when one of these is bought... That's hwy you instantly get a level 2 when you buy a level 1. I'm not exactly sure how to fix that right now, but that's what causes the problem.
 

eloytoro

New Member
Reaction score
4
Code:
((Triggering unit) has an item of type Spyglass - [|cffffcc00Level 1|r])

Instead of using triggering unit use "Hero Manipulating item"
 

Cidzero

Imma firin mah lazer!!!1!1
Reaction score
39
Code:
Charged Items stack
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-class of (Item being manipulated)) Equal to Charged
    Actions
        For each (Integer ItemMerging) 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 being manipulated)) Equal to (Item-type of (Item carried by (Hero manipulating item) in slot ItemMerging))
                        (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot ItemMerging)
                    Then - Actions
                        Item - Set charges remaining in (Item carried by (Hero manipulating item) in slot ItemMerging) to ((Charges remaining in (Item carried by (Hero manipulating item) in slot ItemMerging)) + (Charges remaining in (Item being manipulated)))
                        Item - Remove (Item being manipulated)
                    Else - Actions

HOLY HOLY ITEM MERGING!!!

Look at the conditions in that to figure your problem out, its all in the conditions...of the actions...

Also - I didn't write this, got it from this forum somewhere...can't remember so I just copied it off my map...^_^
 

Knatten

New Member
Reaction score
7
Code:
Spyglass upgrade
    Events
        Unit - A unit Acquires an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by (Hero manipulating item) in slot ItemCombine))
        (Item being manipulated) Not equal to (Item carried by (Hero manipulating item) in slot ItemCombine)
    Actions
        For each (Integer ItemCombine) from 1 to 6, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                    Then - Actions
                        Item - Remove (Item carried by (Triggering unit) of type Spyglass - [|cffffcc00Level 1|r])
                        Hero - Create Spyglass - [|cffffcc00Level 2|r] and give it to (Triggering unit)
                        Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                        Skip remaining actions
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                ((Triggering unit) has an item of type Spyglass - [|cffffcc00Level 2|r]) Equal to True
                            Then - Actions
                                Item - Remove (Item carried by (Triggering unit) of type Spyglass - [|cffffcc00Level 2|r])
                                Hero - Create Spyglass - [|cffffcc00Level 3|r] and give it to (Triggering unit)
                                Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
                            Else - Actions

That won't freaking work.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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