Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: DARK_ETERNAL on November 06, 2012, 02:40:30 PM

Title: [SOLVED] CompoundArray issue
Post by: DARK_ETERNAL on November 06, 2012, 02:40:30 PM
Greetings.

I'm not pretty sure to be understanding CompoundArray property. According to this thread below, CompoundArray only works for two objects. Pretty interesting if I might want to use more than two, but, instead... I wanna use ONE. And, working with the CompoundArray, defining only one parameter, I get the error that no constructor for CompoundArray is defined for only one parameter. Is there any alternate way to compound arrays, or should I use CompoundArray with a unused parameter? What I would like to avoid is unnecessary memory allocation.

http://hutonggames.com/playmakerforum/index.php?topic=147.msg561;topicseen#msg561

Thanks in Advance.
Title: Re: CompoundArray issue
Post by: DARK_ETERNAL on November 06, 2012, 02:45:55 PM
I guess I've got my solution, thus I'm marking this as solved.

It's just a matter of defining a public array, and, when setting its size, it'll generate the fields to define each array position's value.
Title: Re: [SOLVED] CompoundArray issue
Post by: jeanfabre on November 07, 2012, 04:08:36 AM
Hi,

 There are standards actions you should open scripts from to see how compound arrays are working, for example the "fsm state switch":

https://hutonggames.fogbugz.com/default.asp?W487 (https://hutonggames.fogbugz.com/default.asp?W487)


now, if you want simply an array for a single fsmValue, yes, it's only a matter of appending [] to the variable class like the "build string" action:

https://hutonggames.fogbugz.com/default.asp?W372 (https://hutonggames.fogbugz.com/default.asp?W372)

bye,

 Jean