• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

ThisPOT's Teleport System V:2

  • Like
Reactions: alves
ThisPOT's Teleport System V2

* Requires Bribe's Unit Event (included)



This system replicates and improves upon the normal teleport spells already in the game, giving you an array of custom effects that are not available in the normal game.


I made this spell a long time ago as a request for my systems workshop, and was asked to improve it, so here it is :)!



Different Teleports:

- Teleport to Unit
- Teleport to Building
- Teleport to Item
- Teleport to Point
- Teleport to Destructible



Custom Stats:

- Max Range
- Can Tele To Allies (or not)
- Need Vision (or not)
- Grab Range
- Accurate Teleport Range
- Cast Delay
- 7 different tooltips for why you can't teleport
- Caster Special Effect
- Target Special Effect


Change-Log:


- Added the possibility to switch cast delay to channeling (gets interrupted)
- Added more special effects for the caster and the target
- Added more special effects for the departure and landing zones
- Added a choice to return used mana on interrupt
- Added a choice to determine if you can teleport to dead units/items/destructibles
- Added a choice to determine if teleport gets interrupted when the target item is picked up
- Added a choice to determine if grabbed destructibles are destroyed on impact
- Fixed bugs



How to use:

1) Copy / paste the trigger folder into your map
2) Set the variables listed below to whatever you want and done!

* You can also copy the teleport spells in the ability section but it's not necessary, you can use your own ability instead if you prefer (just make sure it's a Point Target Ability)


  • TPTP Initialization
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • -------- Set to the Point Ability that you would like to cast Teleport --------
      • Set TPTP_Ability_Unit = Teleport to Unit
      • Set TPTP_Ability_Building = Teleport to Building
      • Set TPTP_Ability_Item = Teleport to Item
      • Set TPTP_Ability_Point = Teleport to Point
      • Set TPTP_Ability_Destructible = Teleport to Destructible
      • -------- 0 = no max range (1-99999) --------
      • Set TPTP_MaxRange_Unit = 0.00
      • Set TPTP_MaxRange_Building = 0.00
      • Set TPTP_MaxRange_Item = 0.00
      • Set TPTP_MaxRange_Point = 2000.00
      • Set TPTP_MaxRange_Destructible = 0.00
      • -------- Can you also teleport to allies? --------
      • Set TPTP_CanTeleToAllies_Unit = True
      • Set TPTP_CanTeleToAllies_Building = True
      • -------- Do you need vision of the thing you're teleporting to? --------
      • Set TPTP_NeedVision_Item = True
      • Set TPTP_NeedVision_Point = False
      • Set TPTP_NeedVision_Destructible = True
      • -------- Defines how far from cast location to grab targets from (0 = does not grab) --------
      • Set TPTP_GrabRadius_Unit = 1200.00
      • Set TPTP_GrabRadius_Building = 99999.00
      • Set TPTP_GrabRadius_Item = 300.00
      • Set TPTP_GrabRadius_Destructible = 600.00
      • -------- This interrupts the teleport if the item was acquired before the teleport was completed. --------
      • -------- * Only works with the Item Target Teleport --------
      • Set TPTP_AcquireInterrupt_Item = False
      • -------- This kills all destructibles within the grab radius when the teleport occurs --------
      • -------- * Only works with the Destructible Target Teleport --------
      • Set TPTP_KillGrabbed_Destructible = True
      • -------- If cast within this range of the target, will be an exact point --------
      • -------- If more than grab, becomes the same as grab --------
      • -------- Set to 0 to just TP to the target itself always --------
      • Set TPTP_AccurateTP_Building = 400.00
      • Set TPTP_AccurateTP_Item = 0.00
      • Set TPTP_AccurateTP_Destructible = 300.00
      • -------- How much delay there is after you cast teleport --------
      • Set TPTP_CastDelay_Unit = 2.50
      • Set TPTP_CastDelay_Building = 3.00
      • Set TPTP_CastDelay_Item = 3.50
      • Set TPTP_CastDelay_Point = 2.00
      • Set TPTP_CastDelay_Destructible = 1.50
      • -------- Does the spell get interrupted if the target dies? --------
      • Set TPTP_DieInterrupt_Unit = True
      • Set TPTP_DieInterrupt_Building = True
      • Set TPTP_DieInterrupt_Item = True
      • Set TPTP_DieInterrupt_Destructible = False
      • -------- Replaces cast delay with channeling time, which will interrupt the teleport if another order is given --------
      • Set TPTP_Channeling_Unit = False
      • Set TPTP_Channeling_Building = False
      • Set TPTP_Channeling_Item = True
      • Set TPTP_Channeling_Point = False
      • Set TPTP_Channeling_Destructible = True
      • -------- Refunds the mana cost of the spell if it was interrupted --------
      • -------- * Only works when channeling is already set to TRUE --------
      • Set TPTP_ManaRefund_Unit = False
      • Set TPTP_ManaRefund_Building = False
      • Set TPTP_ManaRefund_Item = True
      • Set TPTP_ManaRefund_Point = False
      • Set TPTP_ManaRefund_Destructible = False
      • -------- The tooltips displayed when you can't teleport --------
      • Set TPTP_Tooltip_TooFar = |cffFF0000Too far!|r
      • Set TPTP_Tooltip_NoUnitsFound = |cffFF0000No units in range!|r
      • Set TPTP_Tooltip_NoBuildingsFound = |cffFF0000No buildings in range!|r
      • Set TPTP_Tooltip_NoItemsFound = |cffFF0000No items in range!|r
      • Set TPTP_Tooltip_NoDestrFound = |cffFF0000No trees in range!|r
      • Set TPTP_Tooltip_NoVision = |cffFF0000Need vision!|r
      • Set TPTP_Tooltip_CantTeleThere = |cffFF0000Can't teleport there!|r
      • Set TPTP_Tooltip_Interrupted = |cffFF0000Interrupted!|r
      • -------- The special effects that for "origin" "caster" --------
      • Set TPTP_Effect_Cast_Unit = Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
      • Set TPTP_Effect_Cast_Building = Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
      • Set TPTP_Effect_Cast_Item = Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
      • Set TPTP_Effect_Cast_Point = Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
      • Set TPTP_Effect_Cast_Destructible = Abilities\Spells\Human\MassTeleport\MassTeleportTarget.mdl
      • -------- If you want more effects on the caster --------
      • Set TPTP_Effect_Cast2_Unit = <Empty String>
      • Set TPTP_Effect_Cast2_Building = <Empty String>
      • Set TPTP_Effect_Cast2_Item = <Empty String>
      • Set TPTP_Effect_Cast2_Point = <Empty String>
      • Set TPTP_Effect_Cast2_Destructible = <Empty String>
      • -------- The special effects for "origin" "target" --------
      • Set TPTP_Effect_Land_Unit = Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
      • Set TPTP_Effect_Land_Building = Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
      • Set TPTP_Effect_Land_Item = Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
      • Set TPTP_Effect_Land_Point = Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
      • Set TPTP_Effect_Land_Destructible = Abilities\Spells\Human\MassTeleport\MassTeleportTo.mdl
      • -------- If you want more effects on the target --------
      • Set TPTP_Effect_Land2_Unit = <Empty String>
      • Set TPTP_Effect_Land2_Building = <Empty String>
      • Set TPTP_Effect_Land2_Item = <Empty String>
      • Set TPTP_Effect_Land2_Point = <Empty String>
      • Set TPTP_Effect_Land2_Destructible = <Empty String>
      • -------- The special effect from the departure point when teleport happens --------
      • -------- Only use special effects that can be instantly destroyed here --------
      • Set TPTP_Effect_Go_Unit = Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Set TPTP_Effect_Go_Building = Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Set TPTP_Effect_Go_Item = Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Set TPTP_Effect_Go_Point = Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • Set TPTP_Effect_Go_Destructible = Abilities\Spells\NightElf\Blink\BlinkCaster.mdl
      • -------- The special effect on the arrival point when teleport happens --------
      • -------- Only use special effects that can be instantly destroyed here --------
      • Set TPTP_Effect_Leave_Unit = Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Set TPTP_Effect_Leave_Building = Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Set TPTP_Effect_Leave_Item = Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Set TPTP_Effect_Leave_Point = Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
      • Set TPTP_Effect_Leave_Destructible = Abilities\Spells\NightElf\Blink\BlinkTarget.mdl
* Please let me know if there are any improvements that I can make!


Last Update: 08/31/2018
Contents

ThisPOT's Teleport System V:2.5c (Map)

Reviews
MyPad
Notes: All of the handler triggers (TPTP Target <Object>) are similar in functionality. Why not consolidate them into a single trigger with a condition statement filtering out the usage of certain abilities? Unit Indexer (Bribe) should be replaced...
Dr Super Good
Comments and Suggestions: Potentially useful as a template for teleport related abilities. Includes functionality for most common teleport events such as channel interrupt or mana refund. Overall spell and system layout could be better. Currently all...
Level 2
Joined
Jun 19, 2018
Messages
7
Suggestions:

Possibly, you could add the ability to attach multiple special effects on the unit and the target point. The ability to cancel the initial cast so the casting unit doesn't gets teleported to the location.

Else, well done you killing it with the system you made there! +REP ;)
 
Level 11
Joined
Feb 23, 2009
Messages
577
A big improvement is to make multiple different teleport abilities behave differently.

That's what I'm trying to do :)
If you have any suggestions on how to do that even more please let me know and I will add it asap!


New
Suggestions:

Possibly, you could add the ability to attach multiple special effects on the unit and the target point. The ability to cancel the initial cast so the casting unit doesn't gets teleported to the location.

Else, well done you killing it with the system you made there! +REP ;)

Will do asap! These are good ideas. I will add a possibility of 2 Special Effects for caster and ground effect, and add 2 more for the moment when the teleport happens at the position of the caster and the position of the teleport.

+ the possibility of changing Cast Delay to Channeling Time if you want to (which gets interrupted by stuns or changing the order of the unit in general)


EDIT: Added everything and uploaded new version
 
Last edited by a moderator:
This looks like an aspiring GUI version of CustomTeleport. Perhaps @Spellbound has some insights as to how this is done.

At a glance, I think this is spell-based, and not unit-based. (When spell-based, everything about the spell is the same for all units having that ability, while when unit-based, each unit stores different data about the ability).

As preview trigger is not working at the moment, I will release a review once I test this.
 
Level 11
Joined
Feb 23, 2009
Messages
577
At a glance, I think this is spell-based, and not unit-based. (When spell-based, everything about the spell is the same for all units having that ability, while when unit-based, each unit stores different data about the ability).

I didn't realize that people would need to have specific stats depending which unit casts it, but regardless, it would be a very easy fix that would just require a few filters and moving a few things around. I didn't think this was needed, but since you are asking I will fix this too ;)!

PS: It can still be spell based.
 
Last edited by a moderator:
This appears to be a teleport a-la Scroll of Town Portal except it only takes the caster. It seems competent in what it does but I have noticed a couple of quirks such as the teleport effect not always being centered on the object you are teleporting to. Additionally, when trying to teleport to a building when there is none will teleport on to the building closest to the target point, even if it's nowhere near it (probably further than 4000 units). I'm not sure if that's intentional or not but other types of teleport when there were none of the required objects were nearby failed to execute.
 
Level 11
Joined
Feb 23, 2009
Messages
577
It seems competent in what it does but I have noticed a couple of quirks such as the teleport effect not always being centered on the object you are teleporting to.

That is the accurate TP stat (if cast within a radius of a valid target, will teleport directly to that spot instead of the target location).


Additionally, when trying to teleport to a building when there is none will teleport on to the building closest to the target point, even if it's nowhere near it (probably further than 4000 units).

That is the grab stat (how far from cast point do we look for a target, and building was set to 99999).


I'm not sure if that's intentional or not but other types of teleport when there were none of the required objects were nearby failed to execute.

That's because every teleport in this demo is set to have different stats and thus behaves differently :).
 
Level 18
Joined
Nov 21, 2012
Messages
835
1.Teleport to point can bug unit by stuck on the cliffs.
2.Issuing "smart" order during channeling will not cancel teleport as it should.
3.No need to use hashtable if you're using unit indexer in my opinion.
Please rething whole teleport code. The current state of your submission is not approvable.

I'm unable to see triggers using "Preview triggers" it throws me an error: "A server error occurred. Please try again later."
 
Level 11
Joined
Feb 23, 2009
Messages
577
1.Teleport to point can bug unit by stuck on the cliffs.

I was not able to replicate this bug, are you sure? Fixed


2.Issuing "smart" order during channeling will not cancel teleport as it should.

I will fix that asap! Fixed


3.No need to use hashtable if you're using unit indexer in my opinion.

Hashtables take less room so I use them instead of variables when it makes sense, how would you do it? All variable arrays? Fixed

Also, how do you refer to the unit in question in the hashtable without assigning them an ID?


I'm unable to see triggers using "Preview triggers" it throws me an error: "A server error occurred. Please try again later."

That's a hive error I believe.
 
Last edited by a moderator:
Level 18
Joined
Nov 21, 2012
Messages
835
You can consider this 2 triggers to track "isUnitChanneling"
JASS:
function Trig_Unit_StartChannel takes nothing returns boolean       
    set g_unitChanneling[GetUnitUserData(GetTriggerUnit())] = true       
    return false
endfunction
function Trig_Unit_EndChannel takes nothing returns boolean       
    set g_unitChanneling[GetUnitUserData(GetTriggerUnit())] = false       
    return false
endfunction
    set t=CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CHANNEL) //triggers to set boolean variable "g_unitChanneling[unit user data]"
    call TriggerAddCondition(t, Condition(function Trig_Unit_StartChannel))
    set t = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_ENDCAST)
    call TriggerAddCondition(t, Condition(function Trig_Unit_EndChannel))
I am using dummy-blinker unit with "blink" ability to find nearest walkable location. It's not elegant solution but simple, and always works. I got item in my map named "teleportation wings" that can teleport caster to the targeted point. If you're interested you can look at the code. It is trigger action code and uses waits.
JASS:
function Trig_StaffOfTeleportation_OnCast takes nothing returns nothing
    local unit u=GetTriggerUnit()
    local real x=GetUnitX(u)
    local real y=GetUnitY(u)
    local real Tx=GetSpellTargetX()
    local real Ty=GetSpellTargetY()
    local integer counter=0
    local boolean ok=true
    local boolean targetPointOk=true
    local timer t=null
    local effect eff1=null
    local unit blinker=CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE), 'h00L', Tx, Ty, 0.00)
   
    if IssuePointOrder(blinker, "blink", Tx+1.00, Ty+1.00) then
    elseif IssuePointOrder(blinker, "blink", 0.00, 0.00) then
        //blink ok --> current position walkable :) --or-- //blink ok
    else  //blink failed...interrupt!
        set targetPointOk=false
    endif
   
    if targetPointOk then
        set eff1=AddSpecialEffect("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTo.mdl", x, y)
        set t=CreateTimer()
        call TimerStart(t, 4.00, false, null)
        loop
            exitwhen TimerGetRemaining(t)<=0.00
            if (not UnitAlive(u)) or (not UnitChanneling(u)) then
                call Msg(GetOwningPlayer(u), "Teleportation interrupted.")
                set ok=false
                exitwhen true
            endif
            if counter==3 then //read target coords
                set Tx=GetUnitX(blinker)
                set Ty=GetUnitY(blinker)
            endif
            set counter=counter+1
            call TriggerSleepAction(0.20)
        endloop
        call DestroyEffect(eff1)
        call DestroyTimer(t)
        set t=null
    endif
   
    if targetPointOk and ok then
        call RemoveUnit(blinker)
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportCaster.mdl", x, y))
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\MassTeleport\\MassTeleportTarget.mdl", Tx, Ty))
        call SetUnitPosition(u, Tx, Ty)
        //call MsgDev("caster succefully "+I2S(counter))
    elseif not targetPointOk then
        call Msg(GetOwningPlayer(u), "Teleportation failed.")
        call TriggerSleepAction(1.00)
        call BlzEndUnitAbilityCooldown(u, ABI_ITEM_TELEPORTATION_WINGS)
    endif
   
    call RemoveUnit(blinker)
    set blinker=null
    set eff1=null
    set u=null
endfunction
Hashtables take less room so I use them instead of variables when it makes sense, how would you do it? All variable arrays?
yeah, just use UnitUserData aka Custom Value of Unit as a parameter
I was not able to replicate this bug, are you sure?
It bugs caster after 3rd or 4th cast on the cliff.
 
Level 18
Joined
Nov 21, 2012
Messages
835
that's your own code:
  • TPTP Target Unit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to TPTP_Ability_Unit
    • Actions
      • ...
      • Hashtable - Save (Custom value of TPTP_TargetUnit) as 1 of (Custom value of (Triggering unit)) in TPTP_Hash
yourVariable[Custom value of Unit]
Most importand is a way, you will choose to determine walkable location at teleport target point. There is "TerrainPathability" library by Rising_Dusk, (MAX_RANGE in this lib can be greatly increased and tested if this meets your expectations)
Simple "Move unit to the location" GUI action will not guarantee that unit will land on the proper point.
 
Level 11
Joined
Feb 23, 2009
Messages
577
Gotcha, I'll fix that then as you suggested. Fixed

So it's ok to just use variable arrays for everything? 5 year ago people were saying it's slow and clunky which is why I was using hashtables, I've been away a bit ^^...
 
Last edited by a moderator:

Notes:

  • All of the handler triggers (TPTP Target <Object>) are similar in functionality. Why not consolidate them into a single trigger with a condition statement filtering out the usage of certain abilities?
  • Unit Indexer (Bribe) should be replaced with the current Unit Event (also by Bribe), since it does the same thing, with more features, and is future-proof, as it is being actively maintained.
  • Repeated function calls to (Triggering Unit) have been spotted. Assign it to a variable to optimize performance.
  • Variable count should be minimized, as many of these do not need to be individualized to their own space. Use a more generic array variable in their place.
  • If-then branches could be minimized with the usage of the Or logical operator, available in GUI. That being said, repeated actions can be simplified.
  • Nested-ifs could be avoided for additional readability, but when it makes sense. Case in point:
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Load 2 of (Custom value of (Picked unit)) from TPTP_Hash) Equal to 1
      • Then - Actions
        • Special Effect - Create a special effect at TPTP_Point_4 using TPTP_Effect_Go_Unit
      • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Load 2 of (Custom value of (Picked unit)) from TPTP_Hash) Equal to 2
          • Then - Actions
            • Special Effect - Create a special effect at TPTP_Point_4 using TPTP_Effect_Go_Building
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Load 2 of (Custom value of (Picked unit)) from TPTP_Hash) Equal to 3
              • Then - Actions
                • Special Effect - Create a special effect at TPTP_Point_4 using TPTP_Effect_Go_Item
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Load 2 of (Custom value of (Picked unit)) from TPTP_Hash) Equal to 4
                  • Then - Actions
                    • Special Effect - Create a special effect at TPTP_Point_4 using TPTP_Effect_Go_Point
                  • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • (Load 2 of (Custom value of (Picked unit)) from TPTP_Hash) Equal to 5
                      • Then - Actions
                        • Special Effect - Create a special effect at TPTP_Point_4 using TPTP_Effect_Go_Destructible
                      • Else - Actions
  • Unit group filtering method is not optimal.

    • Set TPTP_Group = (Units within TPTP_GrabRadius_Unit of TPTP_Point_2 matching ((((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) or (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True)) and ((((Matching unit) is A structure) Eq...
    I suggest the following link on how to optimize group filtering (readability and performance-wise): Convenient Unit Group Filtering in GUI

Suggestions:

  • Upon the effect of the spell, should the (Triggering Unit) be issued to stop, the manacost is not refunded. Why not give an option to refund it?

Status:

  • Awaiting Update
 
Level 11
Joined
Feb 23, 2009
Messages
577
All of the handler triggers (TPTP Target <Object>) are similar in functionality. Why not consolidate them into a single trigger with a condition statement filtering out the usage of certain abilities?

I'm not sure I understand, could you please explain a little more?


Unit Indexer (Bribe) should be replaced with the current Unit Event (also by Bribe), since it does the same thing, with more features, and is future-proof, as it is being actively maintained.

Awesome, I didn't know about this, will do immediately. Fixed


Repeated function calls to (Triggering Unit) have been spotted. Assign it to a variable to optimize performance.

Understood, will do. Fixed


Variable count should be minimized, as many of these do not need to be individualized to their own space. Use a more generic array variable in their place.

If you could elaborate on this as well pls ^^... or give an example.
Do you mean to just do like Chanelling[1] is for units, Chanelling[2] is for buildings, etc?
If so the reason I didn't do that is just to make it easier on the eyes for users to change stats, is that a bad idea?


Nested-ifs could be avoided for additional readability, but when it makes sense. Case in point:

I have a question about this one, is it best to make it run another trigger with a bunch of skip actions and no nested-ifs?


Unit group filtering method is not optimal.

  • set.gif
    Set TPTP_Group = (Units within TPTP_GrabRadius_Unit of TPTP_Point_2 matching ((((Owner of (Matching unit)) Equal to (Owner of (Triggering unit))) or (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to True)) and ((((Matching unit) is A structure) Eq...


I suggest the following link on how to optimize group filtering (readability and performance-wise): Convenient Unit Group Filtering in GUI

I realize I've been doing it wrong this whole time thinking it was actually a faster method lol... Thank you for the link. Fixed


Upon the effect of the spell, should the (Triggering Unit) be issued to stop, the manacost is not refunded. Why not give an option to refund it?

Good idea, I'll implement that as well! Fixed



PS: I uploaded a new version, not all of the fixes are implemented as I'm waiting for you to explain a bit more the parts that I don't understand.

PPS: Added a few death booleans, a destructible grabbed kill boolean, and an acquire item interrupts teleport boolean (v 2.5), removed a useless hashtable (v 2.5b), fixed a major bug when you teleported to a flying unit above a cliff (v 2.5c)
 
Last edited by a moderator:
If you could elaborate on this as well pls ^^... or give an example.
Do you mean to just do like Chanelling[1] is for units, Chanelling[2] is for buildings, etc?
If so the reason I didn't do that is just to make it easier on the eyes for users to change stats, is that a bad idea?

What you assumed is right, you can do Channeling[1], Channeling[2], and so on.

However, certain variables which you declared are not type-generic. Examples of these are the unit group variables, since they cannot be used to express a more generic group of destructables, items, locations and so on.

I have a question about this one, is it best to make it run another trigger with a bunch of skip actions and no nested-

To my understanding of that question, no. You can do what you need to do in the trigger itself.

All of the handler triggers (TPTP Target <Object>) are similar in functionality. Why not consolidate them into a single trigger with a condition statement filtering out the usage of certain abilities?

I'm not sure I understand, could you please explain a little more?

While looking at the triggers, I found out that they are very similar, too similar in what they do. Moreover, I am saying that you can pack all of your trigger actions in one trigger.
 
Level 11
Joined
Feb 23, 2009
Messages
577
However, certain variables which you declared are not type-generic. Examples of these are the unit group variables, since they cannot be used to express a more generic group of destructables, items, locations and so on.

Ok, I understand which variables you're talking about. My worry was that the timer could run at the same time as other triggers, creating issues. Does that happen in warcraft 3? Or am I safe using the same generic variables in cast trigger and in timer triggers?


While looking at the triggers, I found out that they are very similar, too similar in what they do. Moreover, I am saying that you can pack all of your trigger actions in one trigger.

I tried consolidating them a little but the problem is that they are all slightly different, but I am sure I can pack them more. I will do that asap.

EDIT: Actually, if question 1's answer is that it's safe, I will be able to pack them way more.
 
My worry was that the timer could run at the same time as other triggers, creating issues. Does that happen in warcraft 3? Or am I safe using the same generic variables in cast trigger and in timer triggers?

Everything in Warcraft 3 is sequential. That means no two actions can run at the same time, yet they can run at the same time-frame.

Code:
function b(int v) returns v
    return v*v

function a() returns v
    v = b(2)
    return v

a()

In the example above, a() is called on some piece of code. While a() is running, a value "v" is defined as the result of b(2). When calling function b(), the thread in a() is paused, and b() is run. After reaching the return point, a() continues up until its' return point, returning 4.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Comments and Suggestions:
Potentially useful as a template for teleport related abilities. Includes functionality for most common teleport events such as channel interrupt or mana refund.

Overall spell and system layout could be better. Currently all variants of the teleport are coupled together and fed hard coded values. This makes it hard to customize in the case the user wants two differently configured versions of the same teleport variant or if they do not need one or more of the available variants. Maybe something could be done to allow data to be fed in from a set of arrays which number of indices used are the number of configurations, a form of data feeding.

As pointed out by MyPad there is quite a bit of code duplication. It might be possible to reduce the entire system into a single trigger with branching logic based on configuration. Would also go well with a data fed approach.​
 
Top