The Daily Click ::. Forums ::. Klik Coding Help ::. How to display paragraph?
 

Post Reply  Post Oekaki 
 

Posted By Message

]Alpha[



Registered
  19/09/2003
Points
  245
8th April, 2009 at 15:57:11 -

Hi, all...
I have this problem :

I have a string object named "Game Text" and it has 20 paragraphs.
I have an active object with an alterable value named "answer".

What I want to do is this :
When the player hits the "A" Button, the "Game Text" is displayed according to the number stored in the alterable value "answer".

So, for example...

+Button "A" is pressed
+Answer = 1
Then... display paragraph 1 of Game Text

+Button "A" is pressed
+Answer = 2
Then... display paragraph 2 of Game Text

+Button "A" is pressed
+Answer = 14
Then... display paragraph 14 of Game Text

etc....

I tought that was pretty easy if I use the "use a calculation" function of the string object.

I tried with :
+Button "A" is pressed
+Answer > 0
Then... display paragraph (Answer)

The problem is that it does not matter which formula I put in there... the text will always display the first paragraph of the string!

Somebody can help?
Thank you in advance!

Edited by ]Alpha[

 
All that I see is the years...

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
8th April, 2009 at 16:30:22 -

There shouldn't be a problem with that.
It sounds more like the alterable value isn't being set properly - try it with a visible counter instead (or just look in the debugger).

 
n/a

]Alpha[



Registered
  19/09/2003
Points
  245
8th April, 2009 at 16:48:09 -

The alterable value is set properly.
I always use visible counters to track the values if there's something wrong.
Plus, I tried to create a new project with only a string object in it.
I set 3 paragraphs and tried the calculation function but I have the same problem.

What is the debugger?

p.s. I just tried to display the text at the beginning of the frame and then change paragraph according to the number stored in the alterable value.
It works this way.
I still don't understand the problem.
It should work both ways or neither of the two... but is a contraddiction to work in a way and not in the other.
Any suggestion?


Edited by ]Alpha[

 
All that I see is the years...

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1970

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
8th April, 2009 at 17:35:53 -

No, I don't know then
There've been a few weird bugs cropping up in MMF2 lately.

The debugger is the little box that appears when you run your game - the one with play controls, that tells you how many objects there are, and how much memory it's using etc.

It's actually much more useful than that though, because it lets you view all the alterable values, angles etc of all the objects in your game, plus all the global values etc - while the game is actually running.

* click the "+" button.
* click the "add object" button (leftmost of the 3 buttons at the bottom).
* select the object you want to look at.

You can also add an object to the debugger using an event.


 
n/a

]Alpha[



Registered
  19/09/2003
Points
  245
8th April, 2009 at 17:54:50 -

Thank you for the info... I'll try that

I tried to play with the calculation and I discover something strange.

Basically when you use the "Use a Calculation" option, you're asked to put in a number or an expression that will tell the game which paragraph to display.
Now I tried to put just a simple number in it and not a formula.
I used 2.
So that should display paragraph number 2, but it still display only paragraph 1!!!

So, if I say :
Display paragraph 2... the game will display paragraph 2.

But if I say :
Use a Calculation... display paragraph 2... the game will always display paragraph 1!!!

How could it be possible?
Did anyone had problem with the calculation function when displaying a text?
Is really a bug or am I missing something?

Thank you in advance!

Edited by ]Alpha[

 
All that I see is the years...

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49566

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
8th April, 2009 at 18:22:32 -

Try inputting 3, if that doesn't work then there must be some code somewhere telling it to delete the 2nd paragraph.

Make sure the string object isn't in a qualifier group, and make sure you are putting the commands into the correct object.

I'm bad at trying to help when I can't see the source, can you upload it if that's possible?

Edit: The string object worked fine for me with the latest build of MMF2Dev http://www.jsoftgames.com/stingthing.zip

You are doing something wrong.

Edited by UrbanMonk

 
n/a

]Alpha[



Registered
  19/09/2003
Points
  245
9th April, 2009 at 08:30:05 -

Thank you for the answer Monk.
In your example you used the "Set Paragraph" function and not the "Display Text" function.
The set paragraph function is working for me too (I said it in my last reply) but I need to use the display text function.
So why if you "display text" using the formula you used for the "set paragraph", you will always see paragraph 1, regardless of the alterable value A of your active?

Thank you!
Dany

 
All that I see is the years...
   

Post Reply



 



Advertisement

Worth A Click