playMaker

Author Topic: Call events from text file[SOLVED]  (Read 1842 times)

LogLady

  • Full Member
  • ***
  • Posts: 150
Call events from text file[SOLVED]
« on: October 14, 2018, 04:25:37 PM »
Is it possible to call events from tags inside a text file?

Something like this:

<load="image.jpg"><set_position=400*400*1>

It would trigger a event to find and load this "image.jpg" and then set its position to x=400 y=400 z=1

Thanks!
« Last Edit: October 29, 2018, 06:06:38 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Call events from text file
« Reply #1 on: October 15, 2018, 02:26:23 AM »
Hi,

 yes, you should use DataMaker for this, it's a full blown xml reader and writer for PlayMaker.

https://hutonggames.fogbugz.com/f/page?W1133

however, you should properly define your structure and comply with Xml standard, it will be a lot more flexible and powerful down the road than an hybrid definition.

so something like that is better ( there are tons of variants of course) :

<Sequence>
  <load type='Sprite' id='My Image'>image.jpg</load>
  <SetPosition  space='world'>
     <Target>My Image</Target>
     <Position>400,400,1</Position>
  </SetPosition>
</Sequence>


If you don't go with an xml based text content, then you'll have to parse your tags manually, and that's a lot more painful indeed... and you'll need to learn Regex, we have some actions on the Ecosystem to work with regex like "StringRegexMatch"

something like that : https://regex101.com/r/GykLuX/1

Bye,

 Jean

LogLady

  • Full Member
  • ***
  • Posts: 150
Re: Call events from text file
« Reply #2 on: October 15, 2018, 09:34:10 AM »
It is a whole new world! Thanks for the reply Jean!

LogLady

  • Full Member
  • ***
  • Posts: 150
Re: Call events from text file
« Reply #3 on: October 15, 2018, 10:48:39 AM »
After instaling the DataMaker using the Ecosystem this error appeared:

"Assets/PlayMaker ArrayMaker/Addons/Custom/Table/Actions/ArrayTableContains.cs(116,36): error CS1061: Type `ArrayListTable' does not contain a definition for `GetColumnHeader' and no extension method `GetColumnHeader' of type `ArrayListTable' could be found. Are you missing an assembly reference?"

I'm using Windows10 and Unity 2017.4.12f1

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Call events from text file
« Reply #4 on: October 16, 2018, 03:27:05 AM »
Hi,

Right, I updated DataMaker to feature the latest ArrayMaker, should be good now.

 Bye,

 Jean

LogLady

  • Full Member
  • ***
  • Posts: 150
Re: Call events from text file
« Reply #5 on: October 18, 2018, 09:49:56 AM »
Working fine.

As always, thanks Jean!