playMaker

Author Topic: Arrays access  (Read 4914 times)

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Arrays access
« on: September 01, 2011, 02:18:35 AM »
I am totally stuck on PM arrays.. I assume that they are apart of PM as i could not find Arrays in the Unity scripting reference for C#..

When ever i try to access the array values that i am trying to set up.. i get this error.

NullReferenceException: Object reference not set to an instance of an object

I assume that it means that there is not really an array index available..

The only think i can figure is where i declare my array variable in the Action.. I have a Private FsmInt[] declared at the top with the rest of the variables and then i have in my OnEnter the variable name = new FsmInt[10];  i really need to set it to a specific number based on other variables set by the user but i have been simplifying to try and figure out what is wrong.. If i try to access the array right after that it gives me the error..

It is probably simple i just dont get it.

Q

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Re: Arrays access
« Reply #1 on: September 01, 2011, 07:55:22 AM »
Hum seems bad it is for AI?
Bye

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Arrays access
« Reply #2 on: September 01, 2011, 08:25:02 AM »
No it is for my card deck shuffling Action i was building.. It is all done but i cant get the Arrays to do anything... and i am not sure why. It could be a limitation of PM or Unity with Arrays in C#..

I may have to rewrite it in Java maybe..

Hope someone who knows can give me a heads up on where i should take this..

Q

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Re: Arrays access
« Reply #3 on: September 01, 2011, 09:28:46 AM »
I see but I not good in scripts
PlayMaker support JavaScript?
Bye

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Arrays access
« Reply #4 on: September 01, 2011, 09:46:19 AM »
Not really sure.. I think i can interact with them and call functions..

Arrays are used in PM but maybe only in a limited way..

I have another idea of how to do it but it is way more complicated so this made more sense to me.. i think.

Q

Dev_Sebas

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 398
    • Blog
Re: Arrays access
« Reply #5 on: September 01, 2011, 09:51:28 AM »
I think PlayMaker do not support Java Script :'(
Bye

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Arrays access
« Reply #6 on: September 01, 2011, 12:51:55 PM »
I think i have the Arrays figured out... not really sure what i was doing wrong but... will post some code later.

Q

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Arrays access
« Reply #7 on: September 04, 2011, 08:18:10 AM »
Hi,

 I am also working on an array system using 1.2 and simple actions . Will release sometime this week for preview and feedback. Basically you have actions like add, get, delete etc etc as actions and you point to a wrapped array in a script that you attached where you want. I am still unsure if I should also have actions that create and manage arrays so that it's all automated ( no need to drop manually that array wrapper). We'll see how far I can take it.

Bye,

 Jean

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • Permaximum Betty
Re: Arrays access
« Reply #8 on: September 05, 2011, 12:09:10 PM »
Thats sounds great.
Sure if you also can make arrays it would be even better.

qholmes

  • 1.2 Beta
  • Hero Member
  • *
  • Posts: 509
Re: Arrays access
« Reply #9 on: September 05, 2011, 11:51:48 PM »
Cool,,, i think you are doing something way more complex then me.. But when i got mine working i did see some potential to expand the abilities of some Actions using Arrays.

Frantically trying to get some work done before heading out on holiday. If anyone is in Maine USA i will wave.

Q