• 🏆 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!

Goblin Tunnel Effect

Status
Not open for further replies.
Level 10
Joined
Nov 5, 2008
Messages
536
Hi!

I have this trigger:

  • Unload Effect
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Goblin Tunnel (Unload)
    • Actions
      • Floating Text - Create floating text that reads Dig Dig Dig! at (Target point of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Wait 7.00 seconds
      • Floating Text - Destroy (Last created floating text)
      • Special Effect - Create a special effect at (Target point of ability being cast) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
The ability has a casting time of 7 seconds. This means, when I unload at target area, (create a tunnel) the text appears and after 7 seconds the text is gone and the unit is unloaded at the spot. But the special effect does not display. If I remove the text completly, the special effect appears.

Any ideas how to have both text and special effect?
 
Level 8
Joined
Aug 1, 2008
Messages
420
^^ Leaks. Try using variables first, it might work then
Dont forget to remove them, if you need help just ask
 
Level 6
Joined
Jul 22, 2008
Messages
243
I don't think you can use "Target point of ability being cast" after a wait; Store it in a variable and it should work.
 
Level 10
Joined
Nov 5, 2008
Messages
536
Thanks for both of your quick answears.

^^ Leaks. Try using variables first, it might work then
Dont forget to remove them, if you need help just ask

I don't think you can use "Target point of ability being cast" after a wait; Store it in a variable and it should work.

How do I do to store them in a variable and what type of variable do I need to create?
 
Level 8
Joined
Aug 1, 2008
Messages
420
TargetLoc "Point" seems like the only one you need.
First action should be:
  • Set TargetLoc = (Target point of ability being cast)
So it would look like this:

  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Goblin Tunnel (Unload)
    • Actions
      • Set TargetLoc = (Target point of ability being cast)
      • Floating Text - Create floating text that reads Dig Dig Dig! at TargetLoc with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Wait 7.00 seconds
      • Floating Text - Destroy (Last created floating text)
      • Special Effect - Create a special effect at TargetLoc using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TargetLoc)
+ Leak free aswell
 
Level 10
Joined
Nov 5, 2008
Messages
536
Thanks! I have followed your instructions and here is how my trigger looks like now:

  • Unload Effect
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Dig! (Unload)
    • Actions
      • Set SetTargetTunnel = (Target point of ability being cast)
      • Floating Text - Create floating text that reads Dig Dig Dig! at (Target point of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Wait 7.00 seconds
      • Floating Text - Destroy (Last created floating text)
      • Special Effect - Create a special effect at (Target point of ability being cast) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Special Effect - Destroy (Last created special effect)
But the special effect does not show:(

Does the trigger work for you?
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Copy this function in your Map Custom Script Code:

JASS:
function GoblinTunnel takes location target, real timeout returns nothing
    local real x = GetLocationX(target)
    local real y = GetLocationY(target) 
    local texttag q = CreateTextTag()
    call RemoveLocation(udg_TempPoint)
    call SetTextTagPos(q, x, y, 10.00)
    call SetTextTagVisibility(q, true)
    call SetTextTagPermanent(q, false)
    call SetTextTagColor(q, 255, 255, 0, 255)
    call SetTextTagLifespan(q, timeout)
    call SetTextTagText(q, "Dig Dig Dig!", 0.023)  
    call PolledWait(timeout)
    call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", x, y))  
    set q = null
endfunction

Don't alter the function above if you don't uderstand it. It can be easily called from GUI like this:

  • Test
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • -------- Add your conditions to the trigger --------
      • -------- Make 2 variables: Point variable TempPoint and real variable Duration --------
      • -------- Alter Variables below according to your needs --------
      • Set TempPoint = (Target point of ability being cast)
      • Set Duration = 7.00
      • -------- Above code means that Floating Text will spawn at the target point of casting ability and will last 7 seconds --------
      • -------- Don't put wait functions after custom script because it includes wait itself --------
      • -------- Do not change this custom script code --------
      • Custom script: call GoblinTunnel(udg_TempPoint, udg_Duration)
The function clears location leaks itself which means you don't have to use RemoveLocation on TempPoint.

I hope this helped!
 
Level 6
Joined
Jul 22, 2008
Messages
243
Thanks! I have followed your instructions and here is how my trigger looks like now:

  • Unload Effect
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Dig! (Unload)
    • Actions
      • Set SetTargetTunnel = (Target point of ability being cast)
      • Floating Text - Create floating text that reads Dig Dig Dig! at (Target point of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Wait 7.00 seconds
      • Floating Text - Destroy (Last created floating text)
      • Special Effect - Create a special effect at (Target point of ability being cast) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Special Effect - Destroy (Last created special effect)
But the special effect does not show:(

Does the trigger work for you?
Change:
  • Special Effect - Create a special effect at (Target point of ability being cast) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
To
  • Special Effect - Create a special effect at SetTargetTunnel using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
 
Level 8
Joined
Aug 1, 2008
Messages
420
Because you still did
  • Special Effect - Create a special effect at (Target Point of ability being cast)
Its supposed to be:
  • Special Effect - Create a special effect at SetTargetTunnel
LOL 3 answers in a minute.
Child_of_bodom, it would be easier doing it our way if he doesnt understand triggers that much

Btw, dont forget the
  • Custom script: call RemoveLocation(udg_TargetLoc)
 
Level 16
Joined
Jul 21, 2008
Messages
1,121
Thanks! I have followed your instructions and here is how my trigger looks like now:

  • Unload Effect
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Dig! (Unload)
    • Actions
      • Set SetTargetTunnel = (Target point of ability being cast)
      • Floating Text - Create floating text that reads Dig Dig Dig! at (Target point of ability being cast) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Wait 7.00 seconds
      • Floating Text - Destroy (Last created floating text)
      • Special Effect - Create a special effect at (Target point of ability being cast) using Objects\Spawnmodels\Undead\ImpaleTargetDust\ImpaleTargetDust.mdl
      • Special Effect - Destroy (Last created special effect)
But the special effect does not show:(

Does the trigger work for you?

Don't use that trigger because if that spell is casted 2 or more times in 7 second period your floating texts will never be destroyed. Check my above post for MUI solution.
 
Level 10
Joined
Nov 5, 2008
Messages
536
Thanks for your answears! I missed that small thing! Now it works fine.

One last question:

If I three buildings uses this ability on three different locations, three text messages appears, but sometimes not all of them disappear. Is it possible to make every text message appear for 7 seconds instead of Special Effect - Destroy (Last created effect)?

(If it is that that causes the bug)


----------------------------------------------------------------------------------------

Child_Of_Bodom answeared my question before I even finished to wrote this!
 
Level 10
Joined
Nov 5, 2008
Messages
536
This is how my trigger looks like:

  • Dig Trigger
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Dig! (Unload)
    • Actions
      • Set TempPoint = (Target point of ability being cast)
      • Set Duration = 7.00
      • Custom script: call GoblinTunnel(udg_TempPoint, udg_Duration)
The variables are named: TempPoint and Duration.

JASS:
function GoblinTunnel takes location target, real timeout returns nothing
    local real x = GetLocationX(target)
    local real y = GetLocationY(target)
    local texttag q = CreateTextTag()
    call RemoveLocation(udg_TempPoint)
    call SetTextTagPos(q, x, y, 10.00)
    call SetTextTagVisibility(q, true)
    call SetTextTagPermanent(q, false)
    call SetTextTagColor(q, 255, 255, 0, 255)
    call SetTextTagLifespan(q, timeout)
    call SetTextTagText(q, "Dig Dig Dig!", 0.023)
    call PolledWait(timeout)
    call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", x, y))
    set q = null
endfunction

An error appears on line 5. "Undecleared variable udg_TempPoint"
I upload a picture below.

Any ideas what I can do to get it to work correctly?
 

Attachments

  • Script.jpg
    Script.jpg
    169.4 KB · Views: 175
Last edited:
Level 10
Joined
Nov 5, 2008
Messages
536
This is how my trigger looks like:

  • Dig Trigger
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Dig! (Unload)
    • Actions
      • Set TempPoint = (Target point of ability being cast)
      • Set Duration = 7.00
      • Custom script: call GoblinTunnel(udg_TempPoint, udg_Duration)
The variables are named: TempPoint and Duration.

JASS:
function GoblinTunnel takes location target, real timeout returns nothing
    local real x = GetLocationX(target)
    local real y = GetLocationY(target)
    local texttag q = CreateTextTag()
    call RemoveLocation(udg_TempPoint)
    call SetTextTagPos(q, x, y, 10.00)
    call SetTextTagVisibility(q, true)
    call SetTextTagPermanent(q, false)
    call SetTextTagColor(q, 255, 255, 0, 255)
    call SetTextTagLifespan(q, timeout)
    call SetTextTagText(q, "Dig Dig Dig!", 0.023)
    call PolledWait(timeout)
    call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Undead\\ImpaleTargetDust\\ImpaleTargetDust.mdl", x, y))
    set q = null
endfunction

Below is two pictures with errors that appears.

Anyone has any ideas what is wrong?
 

Attachments

  • script2.jpg
    script2.jpg
    231.2 KB · Views: 92
  • Script3.JPG
    Script3.JPG
    55.1 KB · Views: 96
Level 8
Joined
Aug 1, 2008
Messages
420
Is goblin tunnel an ability, or a unit?
and "undeclared variable" means that you didnt set the variable, and are trying to remove it. (removing it before setting = error)

make sure that you got your GUI trigger setting the variables before that JASS Trigger
 
Level 10
Joined
Nov 5, 2008
Messages
536
Is goblin tunnel an ability, or a unit?
and "undeclared variable" means that you didnt set the variable, and are trying to remove it. (removing it before setting = error)

make sure that you got your GUI trigger setting the variables before that JASS Trigger

The Goblin Tunnel is an ability I now call Dig! (Unload). It is unload with a cast range of 99999. The Goblins enters a building and the building "digs" tunnels underground.
When target an area with Dig! (Unload), a text appears warning enemy players that someone is digging under the ground. Then a small dust cloud appears and the Goblin comes out of the ground!

I have created two variables, a Point variable known as TempPoint and a real variable known as Duration. Shall they have an array value?



Here is the description I got from Child_Of_Bodom:

  • Test
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • -------- Add your conditions to the trigger --------
      • -------- Make 2 variables: Point variable TempPoint and real variable Duration --------
      • -------- Alter Variables below according to your needs --------
      • Set TempPoint = (Target point of ability being cast)
      • Set Duration = 7.00
      • -------- Above code means that Floating Text will spawn at the target point of casting ability and will last 7 seconds --------
      • -------- Don't put wait functions after custom script because it includes wait itself --------
      • -------- Do not change this custom script code --------
      • Custom script: call GoblinTunnel(udg_TempPoint, udg_Duration)
The function clears location leaks itself which means you don't have to use RemoveLocation on TempPoint.

I hope this helped!

Here is how my trigger looks like:

  • Dig Trigger
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Dig! (Unload)
    • Actions
      • Set TempPoint = (Target point of ability being cast)
      • Set Duration = 7.00
      • Custom script: call GoblinTunnel(udg_TempPoint, udg_Duration)
You think I have made something wrong with this one?
 
Status
Not open for further replies.
Top