Author Topic: Custom Messages  (Read 6554 times)

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Custom Messages
« on: 2008-04-04, 11:46:04 AM »
i played around with it now. there are some things i don't understand. (i use the latest version now)

what does that mean?
Map the input from the specified player (1-4) to the specified sprite only if no messages are waiting on the player for dismissal.

are there some buttons i can use to close the actually displayed message? (dismiss = close?). i've read about dismiss buttons in the souce code, i have no clue how to activate them, if this is necessary.
i wrote some rules which allow the player to touch a sprite, and if pressed a special key, to open and close a message of that sprite.
now i am seeking for a good way to don't map input to the player as long a message is open.

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: Custom Messages
« Reply #1 on: 2008-04-04, 05:57:36 PM »
i think it's button 1 that dismisses it. It's one of the buttons anyway, unless that was just built into the sample project, not by default.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Custom Messages
« Reply #2 on: 2008-04-05, 09:33:23 AM »
If you look at the sample project in the "Level 1" map on layer "Main", you will see it has a "ManagePlayers" plan.  In this plan, you will see a "Hello Player 1" rule.  This rule displays the message passing parameters that cause the message to prevent input for the player from being processed until button 1 is pressed.  On the "options" parameter, if you select "Specify multiple Options values" you can see all the options that are selected in the options parameter.  Notice that Player1 and Button2Dismiss are checked.  That means that, if you call CustomObjects.Message.MapPlayerToInputs instead of the regular MapPlayerToInputs, then:
1) Player 1 will only receive input when a message for player 1 is not displayed AND
2) Player 1 can dismiss the message using button 2
(that is the meaning of the two options).

See also: the "Player Inputs" plan

Make sense?

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: Custom Messages
« Reply #3 on: 2008-04-05, 10:49:08 AM »
yup, thanks!

if someone would like to add multiple choice-options and so on, that would be the same work as doing it for that xml stuff, right?
is that much work? pass me some keywords, maybe i can get a friend to do the stuff. is the c# code so much different from C++?
« Last Edit: 2008-04-05, 11:48:46 AM by Tanja »

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: Custom Messages
« Reply #4 on: 2008-04-05, 11:53:34 AM »
what happens if one uses foreign letters in messages on a system with english language support only? like these:

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Custom Messages
« Reply #5 on: 2008-04-07, 04:46:55 PM »
if someone would like to add multiple choice-options and so on, that would be the same work as doing it for that xml stuff, right?
is that much work? pass me some keywords, maybe i can get a friend to do the stuff. is the c# code so much different from C++?

Most of what you need to understand about implementing a multiple choice system for messages in an SGDK2 game is not related to the language you write in (althouth C# and C++ are similar in many ways), but is related to understanding the architecture of an SGDK2 project and what functions are available fot getting input and drawing output, and how the main game loop works.  Hopefully the existing Message.cs code object can provide most of that information.  There are some things that you would need to know beyond that to implement a multiple choice system. There's a rule function that can test a specific keyboard key to see if it's pressed (IsInputPressed I think).  You'll probably want to use that to activate a user's choice.  Also, yes, you'll need to decide how you want to control the flow of the multiple choice system.  As you suggest, this could be build as part of an XML conversation system.

what happens if one uses foreign letters in messages on a system with english language support only? like these:

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: Custom Messages
« Reply #6 on: 2008-08-20, 12:01:02 PM »
using "\r\n" in a message causes a line break. what other commands are there? can i make some words bold or italic or colored? is there a list somewhere?

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Custom Messages
« Reply #7 on: 2008-08-20, 12:38:58 PM »
Aside from \t, There aren't any other (useful) options for standard ascii text, because standard ascii text doesn't imply any style or color.  \t just inserts a tab.  You would have to modify the code to accept other escape characters if you wanted to use other colors or styles within a single message.
Edward Dassmesser

Tanja

  • Clever
  • Fanatic
  • ***
  • Posts: 606
    • View Profile
Re: Custom Messages
« Reply #8 on: 2008-08-20, 12:41:40 PM »
what useless options would that be?

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Custom Messages
« Reply #9 on: 2008-08-20, 12:46:01 PM »
Standard ASCII control characters, based on Printer output:

\a     alert
\b    backspace
\r    carriage return
\f    form feed
\t    horizontal tab
\n    newline
\v    vertical tab
\\    backslash

I don't think most of these actually do anything in most visual display systems.  I do know that in DOS if you display a file that has a \a in it, there's an audible beep, but that wouldn't happen in SGDK2.
Edward Dassmesser