Fixing Triggered Skill - Removing Skill From Learnable List?

Zaraf

New Member
Reaction score
22
I have a skill that I made which is giving me some trouble. I'll put the triggers here first, and then explain how it works, and what the problem is.

Trigger:
  • Transference Beacon
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Transference - Set Beacon
    • Actions
      • Set tempPoint = (Position of (Casting unit))
      • Set Transference_Beacon_Loc[(Player number of (Owner of (Casting unit)))] = tempPoint
      • Custom script: call RemoveLocation(udg_tempPoint)
      • Unit - Create 1 Teleport Beacon for (Owner of (Casting unit)) at Transference_Beacon_Loc[(Player number of (Owner of (Casting unit)))] facing Default building facing (270.0) degrees
      • Set Transference_Beacon_Unit[(Player number of (Owner of (Casting unit)))] = (Last created unit)
      • Unit - Add a (30.00 x (Real((Level of Transference - Set Beacon for (Casting unit))))) second Generic expiration timer to Transference_Beacon_Unit[(Player number of (Owner of (Casting unit)))]
      • Unit - Add Transference - Teleport to (Casting unit)
      • Unit - Set level of Transference - Teleport for (Casting unit) to (Level of Transference - Set Beacon for (Casting unit))
      • Unit - Remove Transference - Set Beacon from (Casting unit)

Trigger:
  • Transference Teleport
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to (==) Transference - Teleport
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between (Position of (Casting unit)) and Transference_Beacon_Loc[(Player number of (Owner of (Casting unit)))]) Less than or equal to (<=) (250.00 + (375.00 x (Real((Level of Transference - Teleport for (Casting unit))))))
        • Then - Actions
          • Special Effect - Create a special effect at (Position of (Casting unit)) using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Move (Casting unit) instantly to Transference_Beacon_Loc[(Player number of (Owner of (Casting unit)))]
          • Special Effect - Create a special effect at Transference_Beacon_Loc[(Player number of (Owner of (Casting unit)))] using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Remove Transference_Beacon_Unit[(Player number of (Owner of (Casting unit)))] from the game
          • Unit - Add Transference - Set Beacon to (Casting unit)
          • Unit - Set level of Transference - Set Beacon for (Casting unit) to (Level of Transference - Teleport for (Casting unit))
          • Unit - Remove Transference - Teleport from (Casting unit)
        • Else - Actions
          • Game - Display to (Player group((Owner of (Casting unit)))) the text: |c00ff0000Cannot te...

Trigger:
  • Transference Beacon Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to (==) Teleport Beacon
    • Actions
      • Special Effect - Create a special effect at (Position of (Dying unit)) using Abilities\Spells\Items\TomeOfRetraining\TomeOfRetrainingCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Add Transference - Set Beacon to BuilderChosen[(Player number of (Owner of (Dying unit)))]
      • Unit - Set level of Transference - Set Beacon for BuilderChosen[(Player number of (Owner of (Dying unit)))] to (Level of Transference - Teleport for BuilderChosen[(Player number of (Owner of (Dying unit)))])
      • Unit - Remove Transference - Teleport from BuilderChosen[(Player number of (Owner of (Dying unit)))]


Basically, with this skill, when you use it, it drops a beacon. The beacon skill is then removed and replaced by a teleport skill. Using the teleport skill will teleport you instantly to whever the beacon is (and remove the beacon), and then remove the teleport skill and give you back the beacon skill.

All of this works just fine, but the problem I'm having is this:

The unit only has the beacon skill to start with, and the teleport skill is added afterwards by the trigger. Therefore, the unit can learn and upgrade the beacon skill. When the beacon skill is removed, it is NOT removed from its learnable list. So what happens is this:

If you try to upgrade the skill while the beacon is deployed (and you currently have the teleport skill), then the game assumes you do not have the beacon skill, and allows you to learn the beacon skill at level 1 (regardless of how high you might already have it). This conflict causes some mess ups, and ends up causing you to lose skill points.

Optimally, I would like to be able to replace the beacon skill in the learnable list with the teleport skill, so that if you upgrade while the beacon is deployed, the teleport skill is increased accordingly. However, if that is not possible, I'm willing to go with just removing the beacon skill from the learnable list when you don't have it, and so that way you can only upgrade the skill when the beacon is not deployed.

Thanks for any help! +rep
 

Icedddragon

New Member
Reaction score
0
Hmm, you need it to be MUI? I have an idea, going for dinner now, if no-ones helped by the time i get back i'll give it a go.
a small v stands for variable in my answer btw

pretty much
a unit learns a skill
skill = teleport
set variable teleport level to vTeleportlevel+1
Select all teleporters and set level of teleport to level of learned skill

then you just make your trigger that sumons the teleporters to
set level teleport to vTeleportlevel

edit: just thought of a way to do it for MUI, just make vTeleportlevel an array with 1,2,3,4,5 etc being the player number
 

Zaraf

New Member
Reaction score
22
Tried a bunch of different things....like enabling/disabling the skills instead of adding/removing them, but nothing seems to work correctly :(
 

bOb666777

Stand against the ugly world domination face!
Reaction score
117
why remove them? that's annoying
You should just find a way to keep the levels when leveled.
 

Zaraf

New Member
Reaction score
22
It's one spell that has its icon and ability change when each is activated. When you activate one, it's replaced by the other. When you activate the other, it goes back to the first.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top