The Daily Click ::. Forums ::. Klik Coding Help ::. how to grab random text?
 

Post Reply  Post Oekaki 
 

Posted By Message

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
29th August, 2014 at 29/08/2014 01:43:59 -

How does one grab a random paragraphs text from a string object? say theres 10 paragraphs all with 1 word each in them, how would i grab one at random? would help me a lot. thanks in advanced

 
[Game design makes my brain feel like its gonna explode.]

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
29th August, 2014 at 29/08/2014 03:58:20 -

You can use the random command to display different paragraphs stored in your string object.

For example, say the text display is called "DISPLAY_TEXT" and the paragraph with all the info is called "PARA_STORES".
You could do:

Change Alterable String "DISPLAY_TEXT" to Paragraph (Random(10)+1) "PARA_STORES"

I mean that's the basic idea. I don't have my MMF open in front of me now to verify the exact terminology.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

The_Antisony

At least I'm not Circy

Registered
  01/07/2002
Points
  1341

VIP MemberStarSnow
30th August, 2014 at 30/08/2014 18:19:49 -

Change Alterable String "DISPLAY_TEXT" to Paragraph (Random(npara("String"))+1) "PARA_STORES".
npara is the counted number of paragraphs in the string object. Adding npara will keep you from having to adjust the value if you decide to add or subtract paragraphs later.

 
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?

siven

I EAT ROCKS

Registered
  03/11/2008
Points
  604

Wii OwnerVIP Member
19th September, 2014 at 19/09/2014 19:11:51 -

Thanks guys!

 
[Game design makes my brain feel like its gonna explode.]

Pan-tosser



Registered
  24/10/2008
Points
  520

Has Donated, Thank You!
20th September, 2014 at 20/09/2014 04:31:39 -

@ siven long time no see

 
https://www.facebook.com/nathon.brown.7
   

Post Reply



 



Advertisement

Worth A Click