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
Share New Actions / Various Navigation Actions (NavMeshes, -Agents, ...)
« on: February 04, 2018, 06:26:31 AM »
- Removed most of them again, since there's already the 'Path Finding' package on the Ecosystem that contains similar functionalities -

I started creating actions for Unity's 'Nav Mesh' pathfinding system, since I recently started using it and there didn't seem to be a lot of them on the Ecosystem or anywhere else. If you find any problem with them or want additional features on one of them, let me know (either here or on my main post).

Ecosystem
Action Name
Usefulness
Nav Mesh Agent Get Acceleration★★★
Nav Mesh Agent Get Angular Speed★★★
Nav Mesh Agent Get Auto Braking★★
Nav Mesh Agent Get Auto Repath★★
Nav Mesh Agent Get Auto Traverse Off Mesh Link★★
Nav Mesh Agent Get Avoidance Priority★★
Nav Mesh Agent Get Base Offset★★
Nav Mesh Agent Get Height★★
Nav Mesh Agent Get Path End Position★★★
Nav Mesh Agent Get Path Next Position★★
Nav Mesh Agent Get Path Status★★★★
Nav Mesh Agent Get Remaining Distance★★★★
Nav Mesh Agent Get Speed★★★
Nav Mesh Agent Get Stopping Distance★★
Nav Mesh Agent Get Velocity★★★
Nav Mesh Agent Has Path★★★★
Nav Mesh Agent Is On Nav Mesh★★★★
Nav Mesh Agent Is On Off Mesh Link★★★★
Nav Mesh Agent Is Path Pending★★★
Nav Mesh Agent Move To★★★★★
Nav Mesh Agent Pause★★★★
Nav Mesh Agent Reset Path★★
Nav Mesh Agent Resume★★★★
Nav Mesh Agent Set Acceleration★★★★
Nav Mesh Agent Set Angular Speed★★★
Nav Mesh Agent Set Auto Braking★★
Nav Mesh Agent Set Auto Repath★★
Nav Mesh Agent Set Auto Traverse Off Mesh Link★★
Nav Mesh Agent Set Avoidance Priority★★
Nav Mesh Agent Set Base Offset★★
Nav Mesh Agent Set Height★★
Nav Mesh Agent Set Speed★★★
Nav Mesh Agent Set Velocity★★★★
Nav Mesh Agent Warp★★
Nav Mesh Find Closest Point★★★★

2
Feature Requests / HideInInspector-Attribute for custom actions
« on: December 15, 2017, 08:53:09 AM »
It would be great if the [HideInInspector] attribute could also work on custom actions, since it doesn't seem to do anything on variables and it would be helpful when creating custom inspectors to hide certain fields (as I'm also not friends with automated properties).
If you'd do create an extra attribute for that, might as well call it "HideInAction" to differentiate.

3
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.

4
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?

5
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.

6
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.

7
Share New Actions / ...just another big Custom Action collection
« on: July 14, 2017, 02:59:34 PM »
________________________________________

The bulk of my actions is now on the Ecosystem, making this topic
the hub for all related remarks, suggestions and problems. ________________________________________



Since I work on a somewhat larger project for ~3 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 which I'd like to share with this community, because without PlayMaker and people contributing additional functionalities I wouldn't have even come close to an almost complete game.

Most of them can be found in the Ecosystem (Unity 5 and up), but for the ones that aren't feasible for that of if you use an earlier version you'd have to skim through my GitHub Repository and install them manually: https://github.com/justDeek/Useful-Unity-Utilities

I will still add more actions when I see the need for them. If you have any questions or want an action that works in a similar fashion to the prevalent ones, ask right ahead.
If you found any errors or room for improvement, you can also point those out. Any feedback is heartily welcome.


Summary of all currently included actions (their purpose can be derived from their name or action-description):

Ecosystem
Action Name
Usefulness
Animator:
Get Animator Runtime Controller★★
Set Animator Runtime Controller★★
Applications:
Is On Platform Event★★★
Array List:
Array List Get Length★★★
Audio:
Int Switch AudioClip★★★★
Get AudioProgress★★★★★
Get AudioClip Length★★★
Get AudioClip Name★★ (Editor only)
Camera:
Collider Is Visible★★★★
Collider2D Is Visible★★★★
Color:
Compare Colors★★★★
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:
Activate Components★★★★
Activate Game Objects★★★★★
Destroy Children★★★★
Enable Children★★★★★
GameObject Compare Multi★★★★★
Get Child Count Advanced★★★★
Get GameObject Sibling★★★★★
Get Multilevel GameObject★★★★★
Get Object Name★★★
Logic:
Float Compare Range★★★★
Int Compare Range★★★★
Int Switch Advanced★★★
Math:
Float Flip★★★★
Int Flip★★★★
Int Round To Nearest★★★★
Random Float On Slope★★★
Random Point On Slope★★
Physics & Transform:
Enable Collider★★★★
Enable Collider Multi★★★★
Follow Mouse 2D★★★★★
Get Position Add Offset★★★★
Get Scale Add Offset★★★★
Set Positions★★★★
Random:
Random Float Around Range★★★★★
Random Int Around Range★★★★★
Random Wait Custom★★
Random Weighted Vector3★★
Select Random AudioClip★★★★
Select Random Object★★★★★
StateMachine:
Send Event Random Delay★★★★
Send Events★★★★
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:
Debug Variable On Screen★★★★★
Draw Fullscreen Color Advanced★★
Vector:
Vector2 Operator Advanced★★★★
Vector3 Operator Advanced★★★★
______________
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★★

Notes:
- Third Party actions and the like (e.g. NGUI, Array Lists, ...) aren't on the Ecosystem (yet), since they are planned to be bundled in a package (see the uGUI action-package for an example), which then would be put on the Ecosystem, rather than polluting it with actions only a small group of users can use
- the rest of the actions not put on the Ecosystem are either not really useful/interesting for most, only change a little bit of an already existing action, are not tested sufficiently or there is already a similar action available
- the actions are available & supported for Unity 5 and up, because that's the version I mainly use and tested them on, meaning that most if not all of them are likely compatible with earlier Unity versions; but unless there are several people demanding it, it wouldn't be worthwile for me to test them on and provide them for earlier versions (namely Unity 4)

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
|09.12.17|:
- Added: "Random Float On Slope", "Random Point On Slope"
- Updated: "Countup Timer" (now supports to pause the timer, reset and restart on enter),
                  "Debug Variable On Screen" (added option to change the font size)
- Fixed: "Destroy Children"
- Reworked: "GDE Create Item" (removed the convenient custom inspector that showed which Schemas are available, because it brought more harm than good, but at least it works now better and is more performant)
If you still have the "GDECreateItemInspector.cs" file, remove it when you want to use the new "GDE Create Item" script
|23.12.17|:
- Added: "Compare Colors"
- Started uploading most of these onto the Ecosystem (Unity 5 and up)
- Adjusted the list of actions to indicate which action can now be found on the Ecosystem
- Sorted certain actions into better matching categories
- Removed: "Set Sprite Color Custom" and "Remove Fullscreen Color"
|26.12.17|:
- Added: "Follow Mouse 2D"
- Reworked: "Activate Game Objects" (a re-work of the quite deprecated "Activate Multiple Game Objects" with additional options), "Activate Components" (a better version of "Activate Multiple Components", in the same vein as "Activate Game Objects")
- Created info-banner at the top of this post
|30.12.17|:
- Updated: "NGUI Set Sprite Multiple" (added required OnPreprocess() prerequisite for PlayMaker 1.8.5 and up)
- Reworked: "Set Positions" (previously "Set Positions Multi", added ability to set each GameObject's position individually (next to setting them all to one as initially intended), as well as the options to choose the update type)
|19.01.18|:
- Reworked: "Send Events" (previously called "Send Event Multi" and was fairly limited+threw an error when the event, even if global, wasn't used by the current FSM)
- Removed: direct download links since most of the actions are on the Ecosystem anyway and it's one system less that I'd have to maintain whenever I add/update any script
|04.02.18|:
- Added: "Nav Mesh Agent Move To", "Get Child Count Advanced", "Float Compare Range", "Int Compare Range"

8
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.

9
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.

10
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.

11
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]