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

[Trigger] Scroll Text

Status
Not open for further replies.
Level 2
Joined
Dec 2, 2007
Messages
14
Next question for my map. =)

How would you scroll a concatenate string text across the screen?

The two parts as of yet are "|c########Level|r" and an integer variable.

An idea I had was to create a loop and make each loop create that many space characters before my words via another concatenate string. However, I can't figure how to enter (Integer A) spaces into a string.

Edit: I have clear text before each loop.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174

The explanation wasn't 100% clear, please try to explain better next time.

Anyway, you might want to try to make a string consisting of " " (a space) and then typing it as much as you need.

You can also make preset strings with each one being with + space or 2, but it will be quite annoying.

And on a side note, you do know that |c########text|r makes no sense, right ?
It's |cffRRGGBBtext|r.
 
Level 2
Joined
Dec 2, 2007
Messages
14
Color: Yes, I know; I just didn't feel like inputting values to do the color. =P

Basically here is what i want:

LEVEL 2
LEVEL 2
LEVEL 2

ad infinitum, though all on the same line, giving off the effect of the string "scrolling" or marqueeing across the screen left to right. I already have it where it just shows up in the middle via mass " "'s, but I want it to scroll across.

As for the loop, what i wanted was this:

Loop 1-50, string + string; first string = (Int A) spaces, 2nd string is LEVEL #
 
Level 11
Joined
Oct 13, 2005
Messages
233
What you need is to have a delay in between clearing the screen and displaying the text again. Unless you don't want the text movement to be smooth, I'd avoid using a wait action as the fastest you'll get is about 10 updates per second if you're lucky. Now, this leaves you with pretty much two other options. One would be to have a periodic trigger that goes off sometime about every .05 seconds that you enable when you want to have the scrolling text. This option would likely be the easiest to implement and you would simply have to set a global variable to the level and make sure to turn the trigger on/off at the right times. Your other option would be to use a timer, but that would likely require JASS and be a bit harder to set up.
 
Level 2
Joined
Jun 15, 2008
Messages
18
I feel I'm tantalisingly close with this trigger

  • Floating Text - Create floating text that reads Level 2 at (Center of (Playable map area)) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
  • Set FLOAT = (Last created floating text)
  • Floating Text - Change the position of FLOAT to (Point(((Target X of current camera view) + 500.00), (Target Y of current camera view))) with Z offset 0.00
  • Floating Text - Set the velocity of FLOAT to 300.00 towards 180.00 degrees
  • Wait 3.00 seconds
  • Floating Text - Destroy FLOAT
  • Trigger - Run (This trigger) (ignoring conditions)
Quite apart from the fact it obviously leaks three times every time it runs, it also seems to have a bit of a random ghost in the machine - it wil scroll fine for the first quarter of the screen, then jump to halfway, then scroll fine to the end.

Nevertheless, this might be the angle to attack it from if you can't JASS it
 
Level 2
Joined
Dec 2, 2007
Messages
14
Ah, mucho gracias. I'm going for a JASS-free map :D

I didn't even think of floating text for some reason. The only compunction I have about it is the font used by the floating text and the less-sharp features of it compared to the game text
 
Status
Not open for further replies.
Top