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.
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
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)
- Events
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...
- If - Conditions
- Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
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)))]
- Events
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