playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - krmko

Pages: 1 2 [3] 4 5 ... 67
31
PlayMaker Help / Re: Error Loading Action - Index was out of range
« on: January 14, 2020, 11:51:28 AM »
Any news on this one? Some more appeared too:

Code: [Select]
Error Loading Action: State 1 : HutongGames.PlayMaker.Actions.SetProperty : targetProperty
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at HutongGames.PlayMaker.ActionData.GetFsmProperty (HutongGames.PlayMaker.Fsm fsm, System.Int32 paramIndex) [0x00000] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1872

  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, System.Int32 paramIndex) [0x00279] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1092

  at HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.ActionData+Context context, System.Int32 actionIndex) [0x00260] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:959

Code: [Select]
Error Loading Action: State 1 : HutongGames.PlayMaker.Actions.SetProperty : everyFrame
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, System.Int32 paramIndex) [0x00399] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1124

  at HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.ActionData+Context context, System.Int32 actionIndex) [0x00260] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:959

Code: [Select]
Error Loading Action: State 1 : HutongGames.PlayMaker.Actions.SetProperty : debug
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index

  at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, System.Int32 paramIndex) [0x00399] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1124

  at HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.ActionData+Context context, System.Int32 actionIndex) [0x00260] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:959

32
PlayMaker Help / Re: Get accurate speed of a game object
« on: January 12, 2020, 03:49:25 PM »
Probably both last and current frame positions are being taken in the same frame, try adding next frame event in between.

33
PlayMaker Help / Re: Get accurate speed of a game object
« on: January 12, 2020, 05:09:03 AM »
You don't need to use physics actions, subtract the last frame position from current position and there's your speed. If the value is negative, multiply it by -1 so you get te positive value if you need it in that format.

34
PlayMaker Help / Re: Renaming Global events
« on: January 11, 2020, 12:28:37 PM »
Haha my bad, i'm reading variables instead of events all the time, sorry :D I am messing with some globals right now so i must have switched my brain on that.

Thanks for the footer.

The idea for events is great, i don't know why it's not allowed to change the name of the global event in a normal way.

35
PlayMaker Help / Re: Renaming Global events
« on: January 11, 2020, 12:12:35 PM »
No, not events, variables. I suppose i didn't explain it quite well.

Instead of using a global variable Ball, you will put a local variable Ball in the variable manager and get the value from that object with get fsm variableType or set it with set fsm variableType. Only global variable will the the reference to the variable manager, nothing else. It has one extra step, but it keeps the project tidy. If something screws up with global variables, and usually does, you're toast.

You can also have multiple game objects for multiple variable types (player variables manager, weapon variables manager and so on) and reference them via global variables.

36
PlayMaker Help / Re: Renaming Global events
« on: January 11, 2020, 11:36:17 AM »
After years of using, my best advice on Global Variables is - don't use them. They're extremely convenient and my hand always moves towards that "create global variable" button. But the whole system is messy and problematic, so it's best to use one object which will be referenced by one single global variable as the global variable manager and whenever you need to get or set something just use get fsm/set fsm and voila.

As for moving variable from global to local and global again, i haven't tried it, don't think that can end up well or even work :P

37
PlayMaker Help / Missing action warning, but action exists (not custom)
« on: January 11, 2020, 10:55:46 AM »
Hi guys,

i've got a report that the action is mission, but that action is definitely present. Any ideas on what i should do?



I removed the action, put the same back in, but i still get the error.

38
PlayMaker Help / Re: Need advice on data driven design
« on: January 11, 2020, 04:45:59 AM »
Yeah, it's awesome. Way better than game data editor imo.

39
PlayMaker Help / Re: Need advice on data driven design
« on: January 08, 2020, 04:38:25 AM »
I opted for BG Database, a fine tool. More on it here: https://hutonggames.com/playmakerforum/index.php?topic=21528.0

40
Well, i found the solution.

I was having a tough time deciding between Game Data Editor https://assetstore.unity.com/packages/tools/visual-scripting/game-data-editor-18480 which i used before, but is quite expensive and i had some good and bad stuff with it and BG Database https://assetstore.unity.com/packages/tools/integration/bg-database-112262 which is relatively new. Both have Playmaker support (actually, only database management assets that have it on asset store). I opted to try out BG Database, which is also half the price of Game Data Editor.

After the initial setup which takes a bit of time, but is not complicated due to good manual (google sheets api, access, tokenization and all that boring stuff) i managed to set up a database. You can either export data from the database editor in unity, or import it. I find that the best workflow is to setup fields in the integrated editor, export, fill out the data in the spreadsheet then import it back.

And now the most magical thing. There is a Playmaker action generator that creates actions related to your tables and fields.



The next best magical thing is the one i was afraid of. What if i decide to put another column in the table and recreate the actions, will the existing actions be overwritten along with assigned variables? No! All the existing actions are replaced with new ones with the existing variables and assignments intact.

Of course, if you want to use prefabs in your database, you need to enable the addressables. For now, in editor (we'll see builds), everything works fine, but it's another layer of work which needs proper handling since you can use addressables by their location (which can easy break things) or by GUID (which is a drag because it's not quite human readable). Using addressables means you can't go below 2018.3 unfortunately, so you'll have to upgrade if you didn't.

41
PlayMaker Help / Re: Need advice on data driven design
« on: January 07, 2020, 04:40:13 AM »
Hey Krmko! :D

Just wanted to follow up since its been a few months and see if you've discovered/been working in a new way since posting this topic? I've been slowly shifting over into the same type of workflow and am totally looking for pointers! :D

-craigz

Hah, sorry i missed this.

The more i progress in the project, data management is getting more and more complicated. I'm not using as much global variables as before, now it's mostly global events with local variables and lots of managers with local variables. But storing data is still a problem, lots of global variables are shit for maintenance and you can make a mess if you name some of the local and global variables the same and assign a local one instead of a global one, there's no chance you'll ever find where you made a mistake.

Few months ago i worked on Statfetched, a platformer which was done in c#, no Playmaker and we used Game Data Editor in it, a cool asset which uses google sheets to draw data from (and it has Playmaker actions). Another one that caught my eye is BG Database, which works the same way and has Playmaker actions too. By using spreadsheets you can keep track of all data in an organized manner, avoid using global variables and analyze and modify it as needed. Instead of storing similar stuff and variables across fsm, you keep everything in one sheet and get it as needed.

Still haven't done it since it takes time, but i think it's the way to go in any fairly complex project.

42
Hi all,

time came to optimize my game a bit since instantiate/destroy calls are making a lot of GC calls and it's about time to address that.

I was happy when nested prefabs came, but in the long run, it creates more problems when you intend on pooling stuff (which is neccessary for my game) since only the parent is pooled, all the children belonging to it are instantiated as usual.

I have two issues to address.

Issue #1

Enemies have multiple children which have their exact default local position and their default state (active/not active). So, for the enemy of type Provoker (in the image below) i have the following:

Enemy Name: Provoker

Child 1: Light
Child 2: Light2
Child 3: ProvokerGunpoint
Child 4: JetAnimation
Child 5: EnemyTag

Child 1 Position: x, y, z
Child 2 Position: x, y, z
Child 3 Position: x, y, z
Child 4 Position: x, y, z
Child 5 Position: x, y, z

Child 1 State: Active/Not Active
Child 2 State: Active/Not Active
Child 3 State: Active/Not Active
Child 4 State: Active/Not Active
Child 5 State: Active/Not Active



So when i spawn the enemy named provoker, fsm on it should get it's name and then spawn children with appropriate position and state.

Issue #2

Second issue is similar to first. Squadrons are groups of enemies which i handled relatively easy with nested prefabs, i just dragged and dropped prefabs, saved them under SquadronNameX prefab and that's it. But, unfortunately, these need to be spawned so using nested prefabs is kinda off.



So i meant of collecting all the data i need (which will be a long and tedious process by itself) and then what? I can store them in some data structure, but i don't know what would be the most suitable, internal like arraylist or external in a script.

The way i'm doing things now is horrible since i have few hundred of these with 5-10 enemies in each. First i need to spawn all enemies one by one and assign a variable for them



Then i need to manually set position for each one of them



It's tedious to do and there's A LOT of space for error. The preferred way would be a structure to draw data from, like get name of the squadron > number of enemies, if name of Squadron is NameX, spawn prefabY, assign positionZ, repeat until finished.

What can you recommend? Hash tables, arrays, huge scriptable object, json, xml?  I'm quite confident in scripting lately, for the first time i see this maybe more viable in script then with fsms, bit i'd like to stick to fsms completely if possible.

P.S.

Not to mention that maintaining the other enemy systems with their data (HP, speed, loot and so on) is beginning to feel real tiresome by using local (per fsm) data, i'd like to organize that a bit better too.

There's some assets like bg database and gamedata editor, i guess they're worth checking out...

43
PlayMaker Help / Re: Collision not detected
« on: January 05, 2020, 11:32:27 AM »
Assuming you set all properly, did you try setting the collision detection to continuous?

44
PlayMaker Help / Re: Bonus Level
« on: January 01, 2020, 06:15:19 AM »
You can get the number of the level each level, if you can divide it by five, the next level loaded should be the bonus level, if not, then regular level.

If it can be divided you will get 1, 2, 3, 4 and so on. If it can't be divided, you'll get zero. So you only need one int compare (compare with 0, if equal, load regular level, if not equal, load bonus level).

45
PlayMaker Help / Re: Core Gamekit/Pool Boss trouble
« on: December 30, 2019, 07:09:53 AM »
Hey Jean,

never got the chance to thank you on this one, i learned a lot since then, this will be useful. Thanks again!

Pages: 1 2 [3] 4 5 ... 67