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!
Here is a map i am currently working on. The words are supposed to be destroyed once you enter the words in the chat. but it doesn't seem to work, please point out the problems or teach me what triggers to put. btw i know that there are some leaks lol
Actually, there is much more to it then just setting a variable to be the last created floating text and then destroying them.
This game needs dynamically created triggers with registered chat events.
(You might also be abled to use 1 trigger with all the chat events. But I don't see why you want to do that instead of having a dynamically created trigger that does it for you.)
@Chaosy
The fact that you are using GetLastCreatedTextTag() which is a BJ is not so good. They should be avoided since BJ's take up execution time.
Also, this is wrong:
JASS:
local texttag variable = GetLastCreatedTextTag()
call DestroyTextTag(variable())
A variable is not a function...
And I also suggest using a different name for readability's sake ;P
(Not trying to piss you off or anything Chaosy, just trying to prevent you from giving bad information)
@bisnar13:
I made the entire thing for you. To see how it works look at the triggers, most of the triggers are in GUI. (It does use quite some Custom script) The rest is in the header script.
To check out the header script simply click on the map icon: Typing Machine.w3x in the top of your trigger list.
You can adjust the speed by changing the Move event, you can adjust the amount of words by changing the Words event, you can change the game timer in the Initialization of Words and in Restart.
I really liked playing it My highscore after playing 3 times was 160 with the current settings.
EDIT: tip: the chat events are exact matches so you might want to take away the first uppercase, it's quite annoying to keep using the shift key.
Also, you can always add more words if you like. It's your map anyways...
Well yeah it does indeed work if you created the floating text through GUI, but if you make it in Jass then GetLastCreatedTextTag() might do nothing depending on the coder ofc.
This is because all that GetLastCreatedTextTag() does is return bj_lastCreatedTextTag:
JASS:
function GetLastCreatedTextTag takes nothing returns texttag
return bj_lastCreatedTextTag
endfunction
In fact you might even want to do this instead (1 less function call):
JASS:
local texttag floatingText = bj_lastCreatedTextTag
Which is set when a text tag is created through GUI (and since locals can only be declared at the top of a function, this might get a bit messy):
Floating Text - Create floating text that reads blah? 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
JASS:
function CreateTextTagLocBJ takes string s, location loc, real zOffset, real size, real red, real green, real blue, real transparency returns texttag
set bj_lastCreatedTextTag = CreateTextTag()
call SetTextTagTextBJ(bj_lastCreatedTextTag, s, size)
call SetTextTagPosBJ(bj_lastCreatedTextTag, loc, zOffset)
call SetTextTagColorBJ(bj_lastCreatedTextTag, red, green, blue, transparency)
return bj_lastCreatedTextTag
endfunction
In other words, the best way would be:
JASS:
local texttag floatingText = CreateTextTag()
This way floatingText refers directly to the created text tag.
You can then use the non-BJ versions of the SetTextTag functions to do whatever you want with your floating text.
If you want to know how to use the non-BJ version of a function, simply search the BJ in the function list and see what it does.
Then use that code directly instead of calling the BJ.
Try to make sure that there is no red code in your script. (In rare cases it's inevitable though).
But the less you have, the better your scripts are optimized.
Thanks for the help! , but what I only really needed was to destroy the text.
btw, those were just sample words, I will of course add more, about a thousand if I can, and about the request, I can't see the picture D:
I tried the vJass/custom script for destroying the text, but it still wouldnt work D: I think I tested the disable permanence/ set lifespan and other stuff, but they dont work
OH LOL, FUUUUUU, IT WORKED ALL ALONG, It was just because of the capital letter. -_- Sorry, I really didn't have a problem. lol
Yes, and the trigger to check if a word is correct is done in Jass. It's in the map header. I've explained in my previous post how to access the map header and see the code.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.