• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Help with teleporation spell please.

Status
Not open for further replies.
Level 2
Joined
Jul 17, 2008
Messages
15
K, so i need to make a an ability "Drill" that when used will move the caster to the targeted point. The thing is, i cannot use TFT skills, so i gotta do it through triggers. It seems to work fine but the problem is i can literally go ANYWHERE, such as on cliffs where i wouldnt fit normally or in the water, even outta boundaries. Is there any way to make sure that when i try to go there that the unit would blow up, die or just cancel out?

so far i have this....

Drill Movement
- Events
Unit - A Unit begins channeling an ability
- Conditions
(Ability Being Cast) Equal to Drill
(Unit-type of (Triggering Unit)) Equal to MMD-V1
- Actions
Wait 30.00 seconds
Unit - Move (Casting Unit) instantly to (Target point of ability being cast)

any help please? would be appreciated. Also i can use tft triggers, the reason i cant use tft spells is because when i optimize the map after conversion to RoC they dissapear. if you know a way to fix that that would a LOT thanks.
 
Level 11
Joined
May 31, 2008
Messages
698
Conditions
Events
Conditions
Actions
Set temploc = target point of ability being cast
Set tempint = 0
Destructible - Pick every destructible within 100.00 of temploc and do (Actions)
Loop - Actions
Set tempint = (tempint + 1)
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Terrain pathing at temploc of type Walkability is on) Equal to (==) True
tempint Equal to (==) 0
Then - Actions
*Actions Here*
Else - Actions

Just put your actions where it says *actions here* and it should work. Also make another trig thats something like this:

Unit begins casting ability
then add all those conditions
under "else" do order triggering unit to stop and maybe make it say to the player "cant target that location"

You need 2 triggers because the first one should have event unit starts effect of ability. The begins casting ability one is to prevent the unit from actually casting the ability so it doesnt lose mana or have cooldown.
 
Level 11
Joined
May 31, 2008
Messages
698
They are pretty much the same trigger. The first one has the event Unit starts effect of an ability. The second one has the event Unit starts casting ability. Second trigger shouldnt do anything but stop the unit from casting if the conditions are not true. I made a very similar spell to this lemme post it for you.

Just do this for making it stop and checking the conditions, ignore the other triggers i posted :p

  • GrappleStop
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Grapple (upgrade)
    • Actions
      • Set DoodadCount[(Player number of (Owner of (Triggering unit)))] = 0
      • Set TempLoc[0] = (Target point of ability being cast)
      • Destructible - Pick every destructible within 100.00 of TempLoc[0] and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Multiple ConditionsAnd - All (Conditions) are true
                • Conditions
                  • ((Picked destructible) is alive) Equal to True
                    • Multiple ConditionsOr - Any (Conditions) are true
                      • Conditions
                        • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
                        • (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
                        • (Destructible-type of (Picked destructible)) Equal to Felwood Tree Wall
                        • (Destructible-type of (Picked destructible)) Equal to Northrend Tree Wall
                        • (Destructible-type of (Picked destructible)) Equal to Felwood Canopy Tree
                        • (Destructible-type of (Picked destructible)) Equal to Pathing Blocker (Ground) (Large)
                        • (Destructible-type of (Picked destructible)) Equal to Pathing Blocker (Ground)
            • Then - Actions
              • Set DoodadCount[(Player number of (Owner of (Triggering unit)))] = (DoodadCount[(Player number of (Owner of (Triggering unit)))] + 1)
            • Else - Actions
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Multiple ConditionsOr - Any (Conditions) are true
              • Conditions
                • DoodadCount[(Player number of (Owner of (Triggering unit)))] Not equal to 0
                • (Terrain pathing at TempLoc[0] of type Walkability is off) Equal to True
          • Then - Actions
            • Unit - Order (Triggering unit) to Stop
            • Game - Display to (Player group((Owner of (Triggering unit)))) for 7.00 seconds the text: |cffff4500Unable to target that location|r
          • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc[0])
Remember that this only prevents the unit from casting the ability if they target a location that is unpathable for land units or that has trees. Change the conditions for the Destructable types to any destructables in your map that you dont want the unit to target near. I did this because i wanted the unit to be able to grapple onto bridges and ramps and gates etc but not into a cluster of trees or pathing blockers or something.

Hope this helped. :)
 
Level 2
Joined
Jul 17, 2008
Messages
15
alrighty thanx a bunch, i dont think i have a group of trees that would cause any problems, heres some rep :D
 
Level 2
Joined
Jul 17, 2008
Messages
15
Are you using a WE Unlim or somthing your triggers look diffrent than mine. Also i finished it, took a while but i got lol, now it wont let the unit teleport anywhere :S :S :S :S

also for the 3rd action down the list, The Destructible - Pick Every destructible within 100 of temploc then do action, which action was i suppose to use.

__________________________________________________
scratch what i just said, i figured out another way, just had to remove some stuff. Thanks a bunch your help has opened me up to new ways :D
 
Last edited:
Level 11
Joined
May 31, 2008
Messages
698
What do you mean how do you set them? Just add action and hit "s" and Set Variable should pop up. If you click on "Variable" (in red) you can go to "Edit Variables" and make the variables you need. TempLoc is a point variable and DoodadCount is an integer variable. Both of them are arrays, but they dont have to be for this trigger. Also dont forget this part: Custom script: call RemoveLocation(udg_TempLoc[0]), it is very important because it removes the location so it wont leak. Leak = Lag, so its very bad.

Oh yeah try not to triple post. Use the edit button to add more stuff that you wanna say if someone hasnt replied after your post. Double posting and definately triple posting usually makes people pretty mad so try avoiding it lol
 
Status
Not open for further replies.
Top