• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

How to make a text when using a spell?

Status
Not open for further replies.
Level 5
Joined
Oct 22, 2008
Messages
156
Hey gamers...

How can I link a text with a spell?
so if you, press a spell, it says " Private L33T-ViV: Fire in hole! " ??

- thanks
 
Level 7
Joined
Jun 16, 2008
Messages
327
Good day, L33t,
The solution to your problem is simple but twofold:
Usually, spells employ the use of floating text (such as the red numbers used by Critical Strike, or the green numbers used by Shadow strike - although this isn't limited to numbers, such as the "miss" floating text string whenever a unit misses an attack.) If this is what you're looking for, then the answer is very simple, although requires an intermediate level of GUI triggering knowledge:

  • Prototype Spell
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to <YourAbility>
  • Actions
    • Floating Text - Create floating text that reads ((Pvt <Or you could use a string/integer variable for military ranks> + (Name of (Owner of (Casting unit)))) + : Fire in the hole!) above (Casting unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Set the velocity of (Last created floating text) to 40.00 towards 90.00 degrees
That's the basic, inital layout for what I think you want. I'd recommend adding a lifespan/temporary age onto the floating text and make a floating text variable to set it to so there are no leaks.

---

Alternatively, you may be asking for the game HUD text display, such as the hints/quest messages make use of. This is far simpler, yet not as appealing to some players:

  • Prototype Spell
  • Events
    • Unit - A unit Begins casting an ability
  • Conditions
    • (Ability being cast) Equal to <YourAbility>
  • Actions
    • Game - Display to (All players) the text: ((Pvt + (Name of (Owner of (Casting unit)))) + : Fire in the hole!)
Of course, you could change it so that it doesn't display "Pvt" for everyone by use of integer/string variables.
I hope this helped.
 
Level 8
Joined
Mar 12, 2008
Messages
437
Do you want it to appear as floating text or just a message?

For message, just do this:

  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to <Ability Name>
  • Actions
    • Game - Display to (All players) the text: Private L33T-ViV: Fire in hole!
Alternatively, you can use floating text:
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to <Ability Name>
  • Actions
    • Set Point = Unit - Position of (Triggering unit)
    • Floating Text - Create floating text that reads Private L33T-ViV: Fire in the hole! at P[1] with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
    • Floating Text - Disable permanence for (Last created floating text)
    • Floating Text - Set lifespan of (Last created floating text) to 4 seconds
    • Custom script: call RemoveLocation(udg_Point)
The latter will create the text above the unit.
 
Status
Not open for further replies.
Top