playMaker

Author Topic: String Split inconsistent when used inside of a template  (Read 3178 times)

mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
String Split inconsistent when used inside of a template
« on: March 28, 2016, 04:05:06 PM »
I can't seem to get the "String Split" action to work inside of a template- it works fine in a normal FSM but inside of a template the array is always "empty"

Arraymaker + "Split text to array list"  works fine inside of template's so I'm using that instead

Unity 5.3.2f1
Playmaker 1.8.0f43
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14938
  • Official Playmaker Support
    • View Profile
Re: String Split inconsistent when used inside of a template
« Reply #1 on: March 28, 2016, 10:49:51 PM »
Hi,

 It works here, so I would double check that indeed you have the right string value to split and that you have an arrayList on the GameObject you are targeting within the action.

Else, can you do a quick sample that illustrate the bug and package it? if I can repro, I can fix it :)

Bye,

 Jean

mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: String Split inconsistent when used inside of a template
« Reply #2 on: March 28, 2016, 11:30:56 PM »
Hey Jean- so the Arraymaker Split String works perfectly inside of my templates- its the String Split for the native arrays in 1.8 that is giving me problems inside of templates-

I'll put together a small test scene
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14938
  • Official Playmaker Support
    • View Profile
Re: String Split inconsistent when used inside of a template
« Reply #3 on: March 29, 2016, 02:00:26 AM »
Hi,

 oh, sorry completlly mis readed your topic!

I'll have a look after lunch

Bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14938
  • Official Playmaker Support
    • View Profile
Re: String Split inconsistent when used inside of a template
« Reply #4 on: March 30, 2016, 03:40:23 AM »
Hi,

 Yep, indeed you have found a nice little bug :) I have forwarded this to Alex.

Thanks for your contribution and help, it's really appreciated!

 Bye,

 Jean

mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: String Split inconsistent when used inside of a template
« Reply #5 on: March 30, 2016, 03:00:23 PM »
Good to know-  your Arraymaker never fails Jean, so I'll keep using it instead  ;D
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3637
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: String Split inconsistent when used inside of a template
« Reply #6 on: March 30, 2016, 06:47:20 PM »
Sorry about that. Please try the attached version. It should fix the bug.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14938
  • Official Playmaker Support
    • View Profile
Re: String Split inconsistent when used inside of a template
« Reply #7 on: March 30, 2016, 11:27:41 PM »
Hi,

 Don't worry... ArrayMaker has it's lot of issues :)


@Alex, so what's the purpose of .stringValues? it should only be used as a getter?

Bye,

 Jean
 

mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: String Split inconsistent when used inside of a template
« Reply #8 on: March 31, 2016, 03:16:19 AM »
I think I found another bug with the native arrays in 1.8 when used inside of a template-

If you use "array clear" inside of a template- lets say to clear the arrays before using FINISH to exit the template-

The first time the template runs the array works fine- but after using "array clear" the next time you run the template the array will not add new items- all the values will be stuck as "null"
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3637
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: String Split inconsistent when used inside of a template
« Reply #9 on: March 31, 2016, 12:15:56 PM »
@Alex, so what's the purpose of .stringValues? it should only be used as a getter?

You can set stringValues, but you then also need to set Values to make sure it's consistent. I need to clean up the API a little and wrap stringValues in a property that does this automatically...

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3637
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: String Split inconsistent when used inside of a template
« Reply #10 on: March 31, 2016, 12:16:55 PM »
The first time the template runs the array works fine- but after using "array clear" the next time you run the template the array will not add new items- all the values will be stuck as "null"

Any chance you could send me a template that reproduces this problem?

mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: String Split inconsistent when used inside of a template
« Reply #11 on: March 31, 2016, 02:49:41 PM »
Hey Alex, sorry just saw this post after converting the template over to using arraymaker instead- I left the original native array actions in the template but switched them off-

In the attached template I deleted the arraymaker actions and converted it back to the native array actions- hope its useful
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

mdotstrange

  • Hero Member
  • *****
  • Posts: 551
    • View Profile
    • Can't code? Who cares! Make games anyway!
Re: String Split inconsistent when used inside of a template
« Reply #12 on: March 31, 2016, 09:15:21 PM »
@Alex missed the new SplitString before- thanks for the updated action  :)
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!