Page 1 of 1

My newb way of making text appear.

PostPosted: Fri Jul 28, 2006 2:00 pm
by Hyperyon
It took me a while to figure out how to easily make pop-up texts for players.
I'll share the method with any other noob like myself:)
Everything revolvs around collision and a count variable.

Before anything, make the texts (I used Adobe Photoshop).
Next, in Game Editor, create 2 actors.Talkingactor and Charactertexts
Add all the text using add animation in the "charatertexts" actor.

On the player you want text to pop up,(talkingactor) add a keydown event, then choose script editor, add a count variable and type the following code (wich Makslane tought me 8) ) regarding the way you want texts to appear.



count++;

if(count == 1)
{
//Create actor "charactertexts" (in 'choose animation', pick the desired text)
}
else if(count == 2)
{
//destroy actor "charactertexts"
}


Now, everytime you push the keydown, "talkingactor's" text (charactertexts actor) should appear.
To avoid that, on the main player, add a collision with the surface of youre platform , add action, event disable, keydown of "talkingactor"

Then add collision with talkingactor, and chosse event enable, keydown.
Now the text will appear after you collide with the talking actor.
You can also disable the main player's keydown events when you collide and avoid popping up the text anytime.

Make an addition in count 2 "else if count==2)//enable mainplayer's key down events" so you can move after the text is over.

Theres one minor flaw. The text appears 1 time. I dont know how to repeat the code. :?

Well,I hope its clear. I appreciate any advice! :D

PostPosted: Fri Jul 28, 2006 2:13 pm
by makslane
Try reset count in second condition:

Code: Select all
if(count == 2)
{
//destroy actor "charactertexts"
count = 0;
}

PostPosted: Fri Jul 28, 2006 3:13 pm
by Hyperyon
Its good! Thanks :D

PostPosted: Fri Jul 28, 2006 8:19 pm
by relaxis
DO LOOP lol