Display text in a box when interacting with an NPC?
I am trying to figure out what is the best way of displaying a text box when interacting with an NPC. I have tried the display text behaviour, but haven't been able to tweak it the way I want it. I want my text box to work in a similar way to most RPG's, as in, when you interact with an npc, they will speak and you can press the space bar again to move on to the next bit of text.
I have also tried the spawn actor method but I am struggling with it in all honesty. I made it so that, when you interact with an npc, an actor (text box) will spawn and have text in in that you can read through. I couldn't get the text displaying in the box either.
Any help with this would be much appreciated.
Many thanks,
Thornster
I have also tried the spawn actor method but I am struggling with it in all honesty. I made it so that, when you interact with an npc, an actor (text box) will spawn and have text in in that you can read through. I couldn't get the text displaying in the box either.
Any help with this would be much appreciated.
Many thanks,
Thornster
Best Answer
-
fadamion Posts: 309
Make a global attribute intrager thats called "what image" .
Then when it collides change attribute "what image" to "what image +1"
This will make the attribute 1
next time it is hit 2 then 3 so on
Then have a rule if attribute "what image" is 1 show image 1
then a second rule if "what image" is 2 then show image next image
and so on for as many images as you want if you want it to just go back and forth with 2 images then there is a way to do that also.
Answers
here is an image of my scene to better explain my point.
https://dl.dropbox.com/u/15466671/game salad display text box problem.jpg
When the red diamond touches the white square and the space button is pressed,an actor will spawn above the white square called 'bubble 1' that contains an exclamation mark. I want to make it so that when I collide with the white square again it will change the image in bubble 1 to something else. I have the collision behaviour on the white square so that when it collides with the red square an actor is spawned, and the change image behaviour on the bubble actor. I know I am missing a big piece of the puzzle here but I can't seem to connect the dots. Am I going about this the right way or is there an easy way to do it.
Many thanks for you patience.
truly appreciated. I have a follow up question though.
But first let me explain the way I have implemented what you guys have said. As you remember from my picture, when the red actor touches the white actor and the user presses space, it spawns a third actor called 'speech bubble'. On top of this, in the do section of the rule there is also change attribute to +1 so it counts up. In the same actor, I have made a rule so that if whatimage = 2 then spawn a second actor(all these rules aforementioned are on the second actor). The reason I did it this way is because all the actors are separate. My issue now is, when I put the rule 'if whatimage =2' in the first speech bubble actor and then 'destroy' in the do section of the rule, nothing happens. The speech bubble doesn't die. What am i doing wrong?
Perhaps, there is also an easy way to do all this than the way I am doing it with so many actors. Should i group actors? is there an easier way?
Many thanks
Thornster
Just change image alpha to 0 (when it has to be inactive), and to 1 (if you want it to display your image).
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I have decided to go with the image changing using the method you mentioned. I am very new to game salad and programming in general, so all this is new to me.I thank you guys immensely for the support you have given me. I have managed to get my actor to change images when I click space 3 times.(so he changes to 3 different images from the standard white block. However, I then proceeded to make a rule that if the attribute equals 4, i will change the attribute to 0(using a change attribute), thus making it go back to the original white square. However it takes 5 clicks to get it to change and then it goes back to image one and not the default white square. I decided to change this to 3 just to see what it did. It went through all the images but again it reset to image 1 instead of the default white square. Any idea why?
cheers
many thanks
old demo: http://www.mediafire.com/download.php?b82qa73d4qfqfxr
done with tables … is only a demo of one way to handle dialogue
I tried to have a look but I couldn't open the file. I am using the Beta for Windows so that might be an issue at present.
If anyone has more info on my latest hurdle, I would much appreciate some direction.