Spell "Shop" System

Spray-

Member
Reaction score
1
Yo, been trying to make a system where you buy spells as "upgrades" from a general building, which Should give my hero a spell, and when the same upgrade is done again, replace the old ability with a new one. This is the code ive got and it doesnt seem to work :/

Code:
Untitled Trigger 002
    Events
        Unit - A unit Finishes an upgrade
    Conditions
        (Owner of (Researching unit)) Equal to Player 1 (Red)
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Researched tech-type) Equal to Test Spell Upgrade 1
                (Current research level of Test Spell Upgrade 1  for Player 1 (Red)) Equal to 0
            Then - Actions
                Hero - Learn skill for Wizard 0000 <gen>: Blink
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Researched tech-type) Equal to Test Spell Upgrade 1
                        (Current research level of Test Spell Upgrade 1  for Player 1 (Red)) Equal to 1
                    Then - Actions
                        Unit - Remove Blink from Wizard 0000 <gen>
                        Hero - Learn skill for Wizard 0000 <gen>: Blink
                    Else - Actions
                        Do nothing

Any help appreciated.
 

Spray-

Member
Reaction score
1
I did that at first, same result, i changed it to Learn skill in hope it would work :eek:
 

Tharius

Occasionally Around
Reaction score
39
Yo, been trying to make a system where you buy spells as "upgrades" from a general building, which Should give my hero a spell, and when the same upgrade is done again, replace the old ability with a new one. This is the code ive got and it doesnt seem to work :/

Code:
Untitled Trigger 002
    Events
        Unit - A unit Finishes an upgrade
    Conditions
        (Owner of (Researching unit)) Equal to Player 1 (Red)
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Researched tech-type) Equal to Test Spell Upgrade 1
                (Current research level of Test Spell Upgrade 1  for Player 1 (Red)) Equal to 0
            Then - Actions
                Hero - Learn skill for Wizard 0000 <gen>: Blink
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Researched tech-type) Equal to Test Spell Upgrade 1
                        (Current research level of Test Spell Upgrade 1  for Player 1 (Red)) Equal to 1
                    Then - Actions
                        Unit - Remove Blink from Wizard 0000 <gen>
                        Hero - Learn skill for Wizard 0000 <gen>: Blink
                    Else - Actions
                        Do nothing

Any help appreciated.

Juggernaut is correct, you need to use "Unit - Add Ability" instead of "Hero - Learn Skill". "Hero - Learn Skill" tells the hero to place an available skill point into the specified ability, and does nothing if the hero doesn't have that ability (or any skill points to spend). Your problem is because this event is triggered upon finishing the upgrade, and by the time it gets to the first IF, the current research level is going to be 1, not 0.

P.S. You aren't supposed to double-post unless there's at least 24 hours between postings. Edit your previous post instead.
 

SupremeRuler

Member
Reaction score
1
The problem is that the trigger runs when Player 1 has finished researching Test Spell Upgrade 1, but at the same time, the level of Test Spell Upgrade 1 must be = 0 which is not possible if the unit just finished researching the upgrade.
 
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