How can I import a Game.Attribute into an actor typed in with the keyboard Attribute?
Say for instance i wanted to to import a keyboard name entry into a story, "the main actor would say something like, "whats your name?" and the new player would replay with the keyboard that pops up. Then the player's name would be entered, and the main actor would follow up with the name entered in his next line "saying, hello .......," ect.
Best Answers
-
tatiang Posts: 11,949
@TRowe007 said:
It doesn't run through all the way, its a little incomplete. But that is what I'm trying to do thanks. The (input) actor where it says, (if:) (self.tempinput), not finished, and the (change attribute), (set:) (self.tempinput), (to), ?Sorry, it's a Mac Creator file and I didn't realize you had posted in the PC subforum.
By the way, some of those attribute values are supposed to be blank. I'm purposely resetting the value of a text attribute to [blank].
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
-
tatiang Posts: 11,949
Here are screenshots in case the Mac Creator file doesn't work properly on your PC. Both actors should be placed on a scene.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
-
tatiang Posts: 11,949
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers
Create a text attribute (I'll call it name)
When the dialog comes up that asks him for his name use the keyboard input to save his name to game.text and save that attribute.
In the expression editor you would put "Hello "..game.text..". How are you?" for example
Need Help? Email Me | Templates | Full Game Source Code
ok, now will this setup still work with me using a table that hold the conversation in it?
Here's an example of how to use tables with the Keyboard Input behavior.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
It doesn't run through all the way, its a little incomplete. But that is what I'm trying to do thanks. The (input) actor where it says, (if:) (self.tempinput), not finished, and the (change attribute), (set:) (self.tempinput), (to), ?
This is what I started mine from witch I believe is your example as well.
https://www.dropbox.com/s/jf7p07e7x1r38je/Dialog v3.zip
Ok all the images are lined up perfectly to what is written in the template, but if I run the game in the template and answer the question by typing my name into the keyboard I click done and it doesn't do anything, (continue the conversation).
Can you post a link to download the file you're working from?
That Dialog demo is mine but it serves a different purpose.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yeah that's what I'm trying do. But I've set my game up already off of your dialog demo. I don't see the difference in propose, they seen the same just one is more in depth. Ok are you asking to see my game or the file I'm copying off of?
Well, the Keyboard Input with Tables demo allows you to type in text and have the next prompt display that text, while the Dialog demo doesn't allow any input but rather just displays text in a certain order based on the table layout.
I thought you were saying that the Keyboard Input with Tables demo wasn't working for you, so I'm trying to see why that might be. What I meant was that you could post (or send via private message) your project file and I could look at how you have it set up.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
ok I'm sending it now