• 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.

DisplayTextToForce to Timed

Status
Not open for further replies.
Level 7
Joined
Jul 4, 2007
Messages
249
Hi, I wanted to change this to timed text instead
  • Game - Display to Players the text: (PlayerColor[(Player number of Loan_player)] + ((Name of Loan_player) + (|r wants to borrow + ((String(Loan_playerBRequest)) + gold. Type |cFF99ccff-l|r to lend him.))))
So I converted it to custom text and just changed to DisplayTimedTextToForce and added the time udg_Loan_msgTime
JASS:
call DisplayTimedTextToForce( udg_Players, udg_Loan_msgTime, ( udg_PlayerColor[GetConvertedPlayerId(udg_Loan_player)] + ( GetPlayerName(udg_Loan_player) + ( "|r wants to borrow " + ( I2S(udg_Loan_playerBRequest) + " gold. Type |cFF99ccff-l|r to lend him." ) )
But when I run the map it says "Syntax Error, unexpected: end of line?"
 
Level 30
Joined
Feb 18, 2014
Messages
3,623
No need to convert to JASS, there is already a function that does that, it's just below it :
  • Game - Display to (All players) for 30.00 seconds the text: Text
As for your custom script, I think you're missing a ")" at the end.
 
Level 2
Joined
Nov 26, 2019
Messages
10
That happens because you're not closing your brackets. Check back on how many brackets you're opening and how many you're closing.
 
Level 7
Joined
Jul 4, 2007
Messages
249
No need to convert to JASS, there is already a function that does that, it's just below it :
  • Game - Display to (All players) for 30.00 seconds the text: Text
Yes but I have a lot of text messages that would be easier to change this way instead of redoing them all.
As for your custom script, I think you're missing a ")" at the end.
Tried adding that, doesn't work. I also tried removing, also doesn't work.
There is 8 ('s and 8 )'s so should be right
 
Level 45
Joined
Feb 27, 2007
Messages
5,578
With JASS you can get rid of all of the unnecessary parenthesis fuckery that GUI adds:

call DisplayTimedTextToForce(udg_Players, udg_Loan_msgTime, udg_PlayerColor[GetConvertedPlayerId(udg_Loan_player)] + GetPlayerName(udg_Loan_player) + "|r wants to borrow " + I2S(udg_Loan_playerBRequest) + " gold. Type |cFF99ccff-l|r to lend him.")
 
Level 7
Joined
Jul 4, 2007
Messages
249
With JASS you can get rid of all of the unnecessary parenthesis fuckery that GUI adds:

call DisplayTimedTextToForce(udg_Players, udg_Loan_msgTime, udg_PlayerColor[GetConvertedPlayerId(udg_Loan_player)] + GetPlayerName(udg_Loan_player) + "|r wants to borrow " + I2S(udg_Loan_playerBRequest) + " gold. Type |cFF99ccff-l|r to lend him.")
Ohh nice it works :D thanks!
 
Level 7
Joined
Jul 4, 2007
Messages
249
I had a problem with this again and it seems like a custom script can be too long, so not everything will be read and therefore it can bug for that reason. So that explains why it worked when I removed a few parentheses
 
Status
Not open for further replies.
Top