Community

SCI Programming => Mega Tokyo SCI Archive => Topic started by: Pikachu14 on July 24, 2002, 07:56:19 AM

Title: Larry 3 customized swearing - How to do it?
Post by: Pikachu14 on July 24, 2002, 07:56:19 AM
In Larry 3, you could enter your own custom cussword and whenever appropiate, Larry would say it. But how is it done? EditPrint, obviously, but...
Title: Re:Larry 3 customized swearing - How to do it?
Post by: Chris Cromer on July 24, 2002, 08:33:50 AM
You save the "word" as a variable and use FormatPrint to print it.

For instance I beleive it was something like this:

Code: [Select]
FormatPrint("Don't you dare say %s to me again!" aString)

It will then replace %s with the word that is in aString.

Hope this helps.
Title: Re:Larry 3 customized swearing - How to do it?
Post by: Pikachu14 on July 24, 2002, 08:38:22 AM
Well, that's showing the cussword. But how does EditPrint fit in?
Title: Re:Larry 3 customized swearing - How to do it?
Post by: Chris Cromer on July 24, 2002, 08:49:35 AM
EditPrint is for entering a value into a edit field(just like the input for typeing.)

When it is called it opens a dialog window with the text you chose, the input box, and any text you want to be within the input box.
Title: Re:Larry 3 customized swearing - How to do it?
Post by: Brian Provinciano on July 24, 2002, 02:33:13 PM
You simply use a combination of EditPrint() and FormatPrint().


You can use string variables:

Code: [Select]

/******************************************************************************/
(string
   theName[41]
)
/******************************************************************************/
(instance public rm001 of Rm
   (properties)
   (method (init)
       EditPrint(theName 40 "What is your name?")
       FormatPrint("Well hello there %s! Have a good day!" theName)


or local variables:

Code: [Select]

/******************************************************************************/
(local
   theName[41]
)
/******************************************************************************/
(instance public rm001 of Rm
   (properties)
   (method (init)
       EditPrint(@theName 40 "What is your name?")
       FormatPrint("Well hello there %s! Have a good day!" @theName)

or temp variables:
Code: [Select]

/******************************************************************************/
(instance public rm001 of Rm
   (properties)
   (method (init)
       (var theName[41])
       = theName[0] 0
       EditPrint(@theName 40 "What is your name?")
       FormatPrint("Well hello there %s! Have a good day!" @theName)


Each operate slightly differently, but all work.
Title: Re:Larry 3 customized swearing - How to do it?
Post by: Pikachu14 on July 24, 2002, 03:04:59 PM
YAY! It works! Thank you!

Enter new cuss word: Camelpoo
c -What are you going to do?- uss
"Camelpoo!" you shout, and feel much better...