message to realtime text script

Hi everyone. I’m currently need help(obviously).
Here’s what I need help from.
A realtime text that can make the string of the realtime text copy the string of the body of the message sent to it(via message sensor and actuator). I’m sure this has been achieved. Is there any script for this? If there is. Could I have a step by step?
So basically. I want to change my realtime text via message actuators. Or is there a more simpler way to make dialog? HAHA. Please don’t say “Go to the resources forum”. I just checked there. And most of the dialog system, I just can’t understand. One of them requires windows. But i’m on a mac. And some are just too complex. NEED HELP. :frowning:

Bump. Anyone? I know i posted too early. But yeah. I’m impatient.

You are bumping too quickly…! If none of the experts presents a solution, I’ll start devising one…
You need a script that sets a changeable string into the body of a message actuator. Sounds pretty simple…
I’ll look around a bit!

Thank you. :slight_smile:

if I understood well, you can copy “properties” between objects ( so, the “real time text” too), using the “Property Actuator”!
Not very “flexible” but maybe useful?

Unless the objects are in the same scene, that is not possible!
As I understand it, a dialog system would be on an overlay scene.
BTW, fullgrown31, where to do you send the message and why?

A message is sent to the realtime text. And since the property of the realtime text is “Text” that is a string property, i want the realtime text to extract any message it receives and copies it to it’s string. In short words, i want the realtime text’s string property to copy the messages.

@OTO i know that. But how about when my realtime text is on another scene for overlay use? :confused:

Hey, remember that French Script? Line Fourty Two, there seems to be the Bug your Terminal couldn’t read, and the Comment says:

#If Error, replace by : view_buf[:]

So, replace Line 42 by:

view = view_buf[:]

That might work then.

About that Scene-Messaging Problem, I guess you should set the String via Python Scripts.

Hi fullgrown31,

you can use the S2A to do that.

Simply set it up like this:

Message sensor (true pulse)
-> Python controller Module: S2A.firstBodyToValue
…-> Property actuator Assign mode Prop: <propertyname> can be in the same folder as the .blend file or an internal textblock.

The message actuator can already send a property value in the body.

Please keep in mind, if more than one message is received only the first one is used.

I hope it helps

Master Monster show you the way!

About my simple solution, maybe you can use “Messages” to “trigger actions” between different scenes, and store the needed text/plane in the correspondent scene ( not tested).

FYI :slight_smile:

You can also call the object directly from another scene via python, and change its ‘Text’ property. That way you don’t need messages at all. For simple things it can be easier to communicate between scenes using message-actuators. However, it can get quite a strain and a mess for more complicated constructions, since you don’t know if a certain message-actuator has already fired or not…

@Monster I tried it but I’m kinda having a problem. I send a message called “Hello”. It will send whenever I press spacebar. But all I get is. “[[Hello not found] + [Extra characters after expression]]”. Do you know how to fix this?
@Rotory HOW?

I know why.

It means I never tested that with strings :wink:

The problem is that strings in the value field of a property actuator needs to be surrounded by “”. Now it looks for a property called Hello which obvious is not present.

What you can do is sending “Hello” rather than Hello.

In the meantime I will think about if I can fix that in S2A.

to be continued

…done you can find the fixed version in the resource section

Works very well! I just want to ask if this could be use as a dialog?


call the scene and it objects, and change the property of the desired one. In Python it would sound something like this:

from bge import logic
textscene = logic.getSceneList()['NameOfSceneContainingTextObject']
textobject = textscene.objects['NameOfTextObject']
textobject['Text'] = 'This message was sent from another scene'

or in short, since you are not going to use these objects again in the same script probably…:

from bge import logic
logic.getSceneList()['NameOfSceneContainingTextObject'].objects['NameOfTextObject']['Text'] = 'Here is the message!'