Posted By
|
Message
|
Rydenio
Registered 19/04/2006
Points 42
|
6th January, 2010 at 17:30:26 -
So I'm making a pokemon game, and I'm having a problem with the speech window.
There is a nice pokemon style background behind the text which is an active. At the start of the game, the edit object and the background are invisible. When they are hidden, global value 1 is 2 and when they are visible, it is 4. When the player is overlapping an NPC and global value 1 = 2, the background and the edit object become visible, and the edit object has 'set text' with the next I want for this NPC.
Now, The edit object only has two visible lines, so the way it works is that I have the user presses space, and if the total number of lines visible is less than the total number of lines-2, the window will close, but if it's greater then it will scroll to the next set of two lines. So the user can open, scroll thorugh and close the text window by hitting space. Also, the background window, has a flashing arrow on the walking animation to show that there is more text coming.
Now for some reason, this only works when done twice. I don't know why. I made it work for NPC's by adding repeat 2 times on the initial talk condition. Now I want to make some cutscenes where all this happens without the user being over something and pressing space, so rinning the SAME effects on a timer or something instead and what happens is, the text loads, but the arrow does not flash, and pressing space closes the window. So I guess it believes that the text only has two lines.
Now, to experiment, I put the initial condition to collides with object instead of overlapping and pressing space. And it does the same. HOWEVER, it works every other time! So the first time you bump into whatever, the text loads and believes it is two lines from the end, but the second time it works as it should, third time, doesnt work, fourth time, works! It's so weird. I know its the same thing that makes it necessary for me to have the repeat 2 times condition on my space press, but obviously there is something that changes that I am not aware about. I made sure the text loads first, but it still does not magange to spot that the first time.
I am sorry that my description of my code is bad, but I do not fully understand it myself since it took me so much trial and error to get it work WITH the space press at the start.
Anyone who has the time and wants to help can have my project file if you can make sense of it. I'm hoping this is something obvious.
n/a
|
Nickey
Registered 16/11/2009
Points 9
|
6th January, 2010 at 18:26:45 -
I am pretty green around here, but I kinda understand the problem and what you are trying to achieve.
A quick question - have you tried the Speech Bubble extension? It has a clickable arrow in the speech bubble that you click when you want to continue the dialogue.
There is an example of this in mmf2 called conversation.mfa - if I knew how, I would upload this example for you to download. Sry
n/a
|
Rydenio
Registered 19/04/2006
Points 42
|
6th January, 2010 at 19:31:46 -
The game does not involve the cursor, and it looks almost exacly like pokemon red/blue, so I don't want to do this any other way. but maybe i will have to if the coding i made is buggy by default.
n/a
|
Nickey
Registered 16/11/2009
Points 9
|
6th January, 2010 at 20:07:27 -
I'm not sure what your code looks like, but maybe you need to define things better:
Something like - If the lines in the edit box r >2, set the edit box internal flag to 1, If the internal flag of the edit box is 1 - display the arrow, if the arrow is visible/or maybe in certain zone and the edit box internal flag is 1 and upon pressing spacebar - do whatever and set the internal flag of the edit box back to 0
This is if I understand correctly; since it seems that something is not firing correctly.
Just taking a stab in the dark.
Edited by Nickey
n/a
|
Rydenio
Registered 19/04/2006
Points 42
|
7th January, 2010 at 12:35:35 -
Thanks for your replies. I actually solved it while redoing it from scratch. All I had to do was have it clear the edit object of text when it goes invisible again.
n/a
|
Nickey
Registered 16/11/2009
Points 9
|
7th January, 2010 at 21:11:35 -
I'm glad you've solved your problem.
n/a
|
|
|