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.


Topics - Deek

Pages: [1]
1
Feature Requests / Navigate states with arrow keys
« on: October 31, 2017, 07:01:21 AM »
Something that would help a great deal in switching between states in the PlayMaker Editor is if you could select the nearest state by pressing the appropriate arrow key.
For example: Pressing the left arrow key selects the state to the left of the current one (even if it is a bit off to the top/bottom).

That would save a lot of time and (miss-)clicks, especially if you want to copy/compare values/actions from one state to another or navigate in more complex FSMs.

It might not be that easy to implement, but would increase productivity a lot.


Features on top of that:
Holding Ctrl or Shift while pressing the arrow keys follows transitions to the destinated state (could pose a problem if a state has more than 1  transition, maybe then you could press its number and the arrow key).

If no state is selected, pressing any arrow key selects the first best state on the pressed side (pressing left selects the left-most state, if there is more than one state under another, it goes from top to bottom; so it selects the left- and top-most state).

Edit:
Additionally be able to select states by pressing the first character of the state name: Pressing 'S' once selects the first state starting with "S", pressing 'S' several times cycles through all states starting with "S" alphabetically and numerically, then pressing 'P' selects the first state starting with "P" and so on.
Internally this could be achieved by keeping a hidden list of all available states in this FSM and select the first occurence of the pressed character.

2
I recently started to create an own asset that extends the NGUI functionality by anything that I see it's missing (like sprite-animations, -shadows, etc.) and would like to use PlayMaker FSMs (only) in the Demo-Scenes, because I've gotten so used to it and it's way more convenient than creating scripts for everything.

Since this asset isn't targeted at PlayMaker users, I wonder if I can include a broken down PlayMaker version (the PlayMakerPreview package maybe?), so that the end-user doesn't need to have PlayMaker installed to let these FSMs run.

Is that possible/ok to do?
If so, I would probably also need to include the actions used in those FSMs or is there a different method entirely?

3
Playmaker Tips & Tricks / Don't use RunFSMs in instantiated GameObjects!
« on: August 27, 2017, 12:10:25 PM »
I had a problem in my game for a while in which I got severe lag spikes when instantiating enemies at runtime (see attached screenshot).
Finally took some time to look into it and it turns out it's because those enemies had FSMs on them that are using RunFSM Actions. The templates those RunFSMs use are also big and have even more RunFSMs nested inside of them.

It seems to be that PlayMaker creates a new FSM for every RunFSM the original FSM contains, thus adding up instantiation time in the Awake()-Function (which is actually the best place for heavy operations, but still not efficient enough for big and nested FSMs).

I didn't know that and it's described nowhere that it actually creates new FSMs, I was hoping it would take all actions out of those templates and append those internally to the host FSM or any other way that would be more efficient.

So it should be best to avoid using RunFSMs on objects that have to be instantiated at runtime (and I can't use pooling or create them at scene start since the spawn-amount is indefinite).
Alternative approaches would be to copy over the content of the RunFSMs to the host FSM (useful when the content is small in action/state size) or to outsource the template into a global manager that you ping with a global event instead of creating that template at runtime.

4
Playmaker Tips & Tricks / CoolColorCodes - Color-Coding in PlayMaker
« on: July 15, 2017, 01:09:23 PM »
Unlike a lot of other Visual-Scripting-Tools, PlayMaker doesn't contain any functionality to group several states in categories (like drawing a box around them and giving those a label; see UE4's Blueprints), wich would help organize FSMs especially once they become bloated.
But even with the lack of such functionality you can still help yourself out by giving your states colors that resemble recurring tasks and give life to your FSMs.

I'm talking, of course, about color-coding, the act of differentiation through color (for example: giving every state that tests/checks something a specific color like orange, giving states that are time-related like delays a different color like blue and so on...)
This not only makes your FSMs more visually appealing, but you also see at a glance immediately what which state does without having to look into it (at least if you stay persistent with your color definitions).

That's why I have experimented & collected several nice, unique and differently looking colors a while back which you can adapt and adopt into your PlayMaker Preferences>Colors Slots to your liking.

The first picture shows all colors live in action and the second one is an own example how I use to sort my actions (you don't need to define colors based on functionality, anything that should be differentiated can be sorted by colors like levels, objects, daytime, settings, ...)
The text file contains all color codes + 2 extra ones. In the Preferences just click on one the color fields and put a code in the 'Hex Color' field.

P.S.:
I gave them all somewhat odd names in an effort to give them all names that start with a different character than the other ones, because it is easier to give states colors by just typing the first letter of the color-name when selecting the state color, instead of clicking on them.

5
Share New Actions / ...just another big Custom Action collection
« on: July 14, 2017, 02:59:34 PM »
Since I work on a somewhat larger project for ~2 years I encountered all kinds of challenges to overcome and often times the default- and ecosystem-actions, even though large in numbers, couldn't suffice for all those hurdles.

That's why I had to help myself out and create or modify existing actions wich I share with this community, because without PlayMaker itself and all those people contributing additional functionalities I wouldn't have even come close to an almost complete game.

I sorted them all in this GitHub Repository, added Screenshots of how the actions look including their description, so everything should be pretty self-explanatory when browsing through the folders:

GitHub:
https://github.com/justDeek/Useful-Unity-Utilities

Direct-Download Links:
https://tinyurl.com/y7mgd3mc

There are also some handy Component- and Editor-Scripts in that Repo wich you can use and build upon to your liking.
Of course I will still add more actions when I see the need for them during production and if you have any questions or want an action that works similar to the prevalent ones, ask right ahead.
If you found any errors or room for improvement, you can also point those out or try fixing themself in a GitHub commit.

A breakdown of all currently included actions (their purpose can be derived from their name or GitHub-Description):

Custom-ActionProbable-Usefulness-Rating (1=barely, 5=very)
Animator:
Get Animator Runtime Controller★★
Set Animator Runtime Controller★★
Applications:
Is On Platform Event★★★
Array List:
ArrayList Get Length★★★
Audio:
Int Switch AudioClip★★★★
Get AudioProgress★★★★★
Get AudioClip Length★★★
Get AudioClip Name★★
Device:
Get Device Linear Acceleration(not fully tested yet)
Get Device Roll Custom★★★
Swipe Gesture Event Advanced★★★★
Enum:
Enum Get Random★★
Get Enum As Array★★★★
Random Weighted Enum★★★
GameObject & UnityObject:
Destroy Children★★★★
Enable Children★★★★★
Get GameObject Sibling★★★★★
Get Multilevel GameObject★★★★★
Get Object Name★★★★
Activate Multiple Components★★★
Logic:
GameObject Compare Multi★★★★★
GameObject Is Visible Alternative
GameObject Is Visible Alternative 2D
Int Switch★★★
Math & Vectors:
Float Flip★★★★
Int Flip★★★★
Int Round To Nearest★★★★
Random Weighted Vector3★★
Vector2 Operator Advanced★★★★
Vector3 Operator Advanced★★★★
Physics & Transform:
Enable Collider★★★★★
Enable Collider Multi★★★★★
Get Position Add Offset★★★★
Get Scale Add Offset★★★★
Set Position Multi★★
Random:
Random Float Around Range★★★★★
Random Int Around Range★★★★★
Random Wait Custom★★
Select Random AudioClip★★★★
Select Random Object★★★★★
StateMachine:
Debug Variable On Screen★★★★★
Send Event Multi★★★★
Send Event Random Delay★★★★
Send Event Set Value★★★★★
Send Event Set Multi★★★★
String:
Get String Numbers★★★★
String Contains Switch★★★★★
String Remove Chars★★★
String Replace Each Char★★★
String Switch Custom★★★★★
System & Time:
Countup Timer★★★★
Find Asset By Name★ (Editor only)
Get File Extension★★★
Get TimeScale★★★★
uGUI
Draw Fullscreen Color Advanced★★★
Remove Fullscreen Color★★
Set Sprite Color Custom★★
______________
    Third Party
¯¯¯¯¯¯¯¯¯¯¯¯¯¯
ANA:
ANA Non Redundant File
GDE:
GDE Add Float★★★
GDE Add Int★★★
GDE Add String★★★
GDE Bool Test★★★★
GDE Create Item★★★★★
GDE Find Item By Value★★★★
GDE Get Random Item★★★★★
GDE Get Schema By Item★★★★★
GDE Has Item★★★
GDE Load All Items By Schema★★★★
GDE Load All Keys By Schema★★★
GDE Load Schema List★★
GDE Load String List Custom★★★
GDE Multiply Float★★★
GDE Multiply Int★★★
NGUI:
NGUI Get Widget Details★★★★
NGUI Set Sprite Multiple★★★★
NGUI Set Sprite Size★★
NGUI Set Widget Alpha Multi★★★★
NGUI Set Widget Color★★★
NGUI Set Widget Details★★★★
NGUI Sprite Is Visible
NGUI Tools Add Child Advanced★★★★★
NGUI Tools Destroy Multi★★

Edit:
15.07.17:
- Added: Direct-Download Links since you can't download single files in GitHub
19.07.17:
- Added: Actions "Countup Timer", "Swipe Gesture Event Advanced" & Custom Menu options to quickly change between scenes with shortcuts
21.07.17:
- Added: GDE-Actions: "GDE Add Float", "GDE Add Int", "GDE Add String", "GDE Multiply Float", "GDE Multiply Int"
- Fixed: GitHub Screenshot-Previews, they should all be visible now
02.08.17:
- Added: "Activate Multiple Components" and several GDE-related Actions
28.08.17:
- Added: "GDE Find Item By Value", "NGUI Tools Destroy Multi", "Enum Get Random", "Get Enum As Array", "Random Weighted Enum", "Random Weighted Vector3"
09.10.17:
- Added: "NGUI Set Sprite Size", "NGUI Set Widget Color", "Get -" + "Set Runtime Animator Controller", "Get AudioClip Length", "Get Audio Progress", "Int Switch", "Set Position Multi", "Debug Variable On Screen", "Send Event Random Delay", "Send Event Set Multi"
- Re-arranged how the list is represented in this post

6
Even though the Ecosystem is still in an early stage (at least according to its version number) it is missing a feature that I consider pretty vital: Notifying the user if any of the downloaded actions have an update available.
It is already checking what scripts are "installed" so it shouldn't be that big of a deal to give an indicator if some of the scripts are outdated (maybe an exclamation point next to them or on Unity start some Debug logs to be least obstrusive)

Background is that I was struggling a few months ago with the 'Draw Line' script to get it to work more smoothly, not knowing there was already an update on it on the Ecosystem that fixed a lot of stuff.

It could pose a problem that all those custom actions are in one GitHub Repository, meaning it's not that easy to push a newer version on to it and maybe it also is a bit more workload comparing all found actions to their GitHub version but it's still a feature to at least be considered and to make the life of every user a bit easier; especially with all these quite fast Unity updates (5.5, 5.6 and next 2017.1) wich can result in compatibility issues.

P.S.:
I know it counts as an Addon but I would need to be a board-member in Trello and this is just a short request.

7
For a while now I started creating custom actions that are tailored to my needs, but I can't figure out how to set all Elements of an Array to UseVariable = true (if even possible).
For a single
Code: [Select]
FsmGameObject _go it works with
Code: [Select]
_go = new FsmGameObject() {UseVariable = true}; in Reset(), but how would I do it with an FsmGameObject[] _go while still specifying the default amount (new FsmGameObject[3])?

Probably just my lack of programmatical understanding...
The pictures show the actual and the desired behaviour.

Thanks in advance.

8
Not really a bug but the SceneManager Action "Allow Scene Activation" has the same Description as the "Create Scene" Activation, wich confused me at first.
Since most of the Descriptions derived from the official Unity ScriptReference, this might be the source of the correct Description:
https://docs.unity3d.com/ScriptReference/AsyncOperation-allowSceneActivation.html

All tooltips and the Action itself are all fine, so it should be easy to fix.

Just thought it would be important to point out since Asynchronous Operations are already a tough nut itself and it is always good when the official Version of Playmaker has less mistakes.

9
Hey folks,
the problem I'm facing today is that when I try to execute the said Action at runtime i get the following Error:

NullReferenceException: Object reference not set to an instance of an object
HutongGames.PlayMaker.Actions.MousePick2dEvent.DoRaycast () (at Assets/PlayMaker/Actions/Physics2D/MousePick2dEvent.cs:103)
HutongGames.PlayMaker.Actions.MousePick2dEvent.DoMousePickEvent () (at Assets/PlayMaker/Actions/Physics2D/MousePick2dEvent.cs:68)
HutongGames.PlayMaker.Actions.MousePick2dEvent.OnUpdate () (at Assets/PlayMaker/Actions/Physics2D/MousePick2dEvent.cs:61)
HutongGames.PlayMaker.FsmState.OnUpdate () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:256)
HutongGames.PlayMaker.Fsm.UpdateState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2618)
HutongGames.PlayMaker.Fsm.Update () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1865)
PlayMakerFSM.Update () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:509)


This might be because I upgraded from a previous Playmaker Version that had the 'PlaymakerUnity2D.unitypackage' Extension installed, but I deleted that folder since 2D Actions are now part of the official Playmaker Versions.
I now have Playmaker Version 1.8.4 and the GameObject this FSM is attached to has a Sprite Renderer and a Box Collider 2D.

When I click on the Error it references to the highlighted line in the second Attachment.

Since I have no clue what could cause this or how to fix this, I hope someone here can.

Pages: [1]