playMaker

Author Topic: Help creating simple Dialog System (ArrayMaker)  (Read 2645 times)

TaberMac

  • Playmaker Newbie
  • *
  • Posts: 2
Help creating simple Dialog System (ArrayMaker)
« on: January 01, 2014, 10:56:13 AM »
Hi everyone,

I am starting (complete beginner) with PlayMaker and creating a simple little game. You are given a crime scene and must find the clues and talk to a few NPCs. I have everything modeled and set up but ran into a dead end when trying to display conversation akin to any RPG.

I read that the PlayMaker ArrayMaker was best for this and after going through the sample scenes and docs I really don't know where to start this. I want to create a spreadsheet of the game strings and be able to call them through PlayMaker.

For example, when you approach the dead body I want something like:
1. Check if player pressed Space.
2. Display String TEXT_001
3. Check if player pressed Space.
4. Clear all text from screen.

Please forgive me if this is much more simple than I am making it but after searching I really can't find a tutorial or resources for this with PlayMaker.

Thanks for any help you can give me.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help creating simple Dialog System (ArrayMaker)
« Reply #1 on: January 02, 2014, 09:32:06 AM »
Hi,


 ArrayMaker will allow you to define a list of strings that you can get either by index is using an arrayList or by a string key if using a hashtable.

if it's an arrayList you will have this

my first text
my second text
mythird text

and getting "my second text" will need the action ArrayListGet and use the index 1 ( arrays indexing starts at 0, not 1).

If you use a hashtable:

first key - > my first text
second key -> my second text
third key -> mythird text

and you would use the action HashtableGet and put "second key" in the key property to get "my second text"

Tho, you may want to look at XmlMaker

https://hutonggames.fogbugz.com/default.asp?W1133

XmlMaker will allow to get a lot further with an easier and text base xml file listing all your texts, and then you would be using xPath to query that xml to find out what text to show on screen.

bye,

 Jean
« Last Edit: January 02, 2014, 09:34:46 AM by jeanfabre »

TaberMac

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Help creating simple Dialog System (ArrayMaker)
« Reply #2 on: January 02, 2014, 10:11:53 AM »
Hi,

Thank you for your response but unfortunately even this simple task leaves issues with my current level of skills.

So my FSM:
1. Split Text to Array
2. Get Key Down
3. Array List Get
4. GUI Label (Showing the string var stored in step 3)

Is this the most straightforward way of doing this, is it possible to call an Array value to display on-screen directly?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Help creating simple Dialog System (ArrayMaker)
« Reply #3 on: January 02, 2014, 02:51:33 PM »
Hi,

 Yes, Few things:


Do the Split Text to Array only once ok?

ArrayMaker only let's you manage the data stored in the array, it's up to you to do whatever you want with them. It's better this way as it makes it very flexible at the cost of more work, but that's true with all gui systems, Data must be treated before showed on screen, wether you use arraymaker, playmaker or anything else.

bye,

 Jean