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]
I just came up with a great idea that would drastically improve managing variables and save quite a lot of time:

Directly setting the variable value when creating a new one in any action

(emphasis on the field between "animDelay" and the "Create Variable" button)

So whenever you want to add a new local or global variable or convert a hard-coded value to one, you can immediately set the value in the same small pop-up that allows you to set the name of the variable (a similar example would be the pop-up when adding an aspect ratio to the game view where you can specify multiple values).

Like that you wouldn't need to switch to the variables tab, search for the variable, select the variable and select the value field of the variable. That's more than 3 clicks and can add up to quite a lot of time when dealing with lots of variables every user would save with that option. And if you want to replace something with an FsmVariable you would also have to copy over that value to the variable-field in the variables tab, which is neither ideal nor any fun.

If you consider implementing this, here are additional suggestions that would make this most useful:
- the value field should match the type of variable to add (should be even enough space for the 3 fields of an FsmVector3 variable and you don't need to add any label next to it anyway)
- the default value for the variable type should be pre-set, so that it's complete optional to set the value directly
- on an object-field it should detect the type of object to be put in, if defined (e.g. Collider, AudioSource, ...);  it should also be possible to drag and drop matching objects into that field

Link to first half:

Because the main post listing all of my custom actions exceeded the max. char limit of 20000, I had to split it in half.
So here is the second half containing all actions from category M to Z:

Action Name
Float Flip★★★★ (similar to existing action)
Get Unsigned Float★★★
Get Unsigned Int★★★
Int Flip★★★★
Int Round To Nearest★★★★
Find Closest Agent★★★★★
Nav Mesh Find Closest Point★★★★
Nav Mesh Agent Get Area Mask★★★
Nav Mesh Agent Move To★★★★★
Physics & Transform:
Enable Collider★★★★
Enable Collider Multi★★★★
Follow Mouse 2D★★★★★
Get GameObject Screen Position★★★
Get Position Add Offset★★★★
Get Rotation Add Offset★★★★
Get Scale Add Offset★★★★
Reset Transforms★★★
Set Positions★★★★
Random Float Around Range★★★★★
Random Int Around Range★★★★★
Random Point Between GameObjects★★★★
Random Point On Slope★★★★
Random Weighted Vector3★★
Select Random AudioClip★★★★
Select Random Object★★★★★
Disable This FSM★★
Enable Fsms★★★★
Get Fsm Component★★
Get GameObject By Fsm Variable Value★★
Send Event Random Delay★★★★
Send Events★★★★
Send Event Set Value★★★★★
Send Event Set Multi★★★★
Build String Auto Convert★★★★★
Get String Numbers★★★★
String Append★★★★
String Compare Set Multi★★★
String Contains Switch★★★★★
String Remove★★★
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★★★★
Random Wait Around Offset★★★★★
Debug Variable On Screen★★★★★
Draw Fullscreen Color Advanced★★
Vector2 Operator Advanced★★★★
Vector3 Compare★★★
Vector3 Operator Advanced★★★★
Third Party
GDE Add String★★★
GDE Bool Flip★★★★
GDE Bool Test★★★★
GDE Count Occurrences★★
GDE Create Item★★★★★
GDE Find★★★★
GDE Find Item By Value★★
GDE Float Compare★★★
GDE Float Operator★★★★
GDE Get Random Item★★★★★
GDE Get Schema By Item★★★★★
GDE Has Field Value Changed★★★★
GDE Has Item★★★★★
GDE Int Compare★★★
GDE Int Operator★★★★
GDE Load All Items By Schema★★★★
GDE Load All Keys By Schema★★★
GDE Load Schema List★★
GDE Load String List Custom★★★
GDE Remove Item★★★★★
GDE Remove String★★
GDE Reset Item★★
GDE Schema Get Next Item★★★
GDE Swap Field Values★★
GDE Swap Items★★★
GDE Vector2 Operator★★
GDE Vector3 Operator★★★
GDE Vector4 Operator
NGUI Get Widget Details★★★★
NGUI Label Set Text Advanced★★★★
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★★

- Added: "Array List Contains Name", "Array Operator", "Build String Auto Convert", "Enable Children In Range", "Get Fsm Component", "Get GameObject By Fsm Variable Value", "Get Unsigned Float", "Get Unsigned Int", "Has Sibling", "Int Sign Test", "List GameObjects Inside Collider", "List GameObjects Inside Collider2D", "String Compare Set Multi", "Vector3 Compare"
- Created a helper class for all the GDE actions, meaning that the script 'GDEHelpers.cs' will be necessary to operate the GDE actions from now on | Added various new GDE actions | Re-worked most the existing ones | merged Float Add, Int Add, Float Multipy and Int Multiply into the respective Float Operator and Int Operator actions

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.

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

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.

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?

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.

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.

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.


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

Link to second half:

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:

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):

Action Name
Ease Int★★★
Get Animator Runtime Controller★★
Set Animator Runtime Controller★★
Is On Platform Event★★★
Array List:
Array List Contains Name★★★
Array List Get Length★★★★★
List GameObjects Inside Collider★★★★★
List GameObjects Inside Collider2D★★★★★
Array Get Random Advanced★★
Array Operator★★★
Int Switch AudioClip★★★★
Get AudioProgress★★★★★
Get AudioClip Length★★★
Get AudioClip Name★★ (Editor only)
Collider Is Visible★★★★
Collider2D Is Visible★★★★
Compare Colors★★★★
Get Device Linear Acceleration★★ (untested)
Get Device Roll Custom★★★ (untested)
Swipe Gesture Event Advanced★★★★
Enum Get Random★★
Get Enum As Array★★★★
Random Weighted Enum★★★
GameObject & UnityObject:
Activate Components★★★★
Activate Game Objects★★★★★
Activate Game Objects Advanced★★★★★
Destroy Children★★★★
Enable Children★★★★★
Enable Children In Range★★★★★
GameObject Compare Multi★★★★★
GameObject Keep Active★★★★★
Get Child Count Advanced★★★★
Get GameObject Sibling★★★★★
Get Last Child★★
Get Multilevel GameObject★★★★★
Get Object Name★★★
Has Sibling★★★★
Set GameObject If Not Null★★★
Toggle Component★★★★
Toggle GameObject★★★★
Float Compare Range★★★★
Int Compare Range★★★★
Int Sign Test★★★
Int Switch Advanced★★★ (similar to existing action)

The rest of my collection can be found on this post here.

- Third Party actions and the like (e.g. NGUI, GDE, ...) aren't on the Ecosystem (yet), since they are planned to be bundled in a package (like the uGUI action-package for example), which then would be put on the Ecosystem, rather than polluting it with each single 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)

- Added: Direct-Download Links since you can't download single files in GitHub
- Added: Actions "Countup Timer", "Swipe Gesture Event Advanced" & Custom Menu options to quickly change between scenes with shortcuts
- 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
- Added: "Activate Multiple Components" and several GDE-related Actions
- Added: "GDE Find Item By Value", "NGUI Tools Destroy Multi", "Enum Get Random", "Get Enum As Array", "Random Weighted Enum", "Random Weighted Vector3"
- 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
- 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"
- Re-worked: "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
- 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"
- Added: "Follow Mouse 2D"
- Re-worked: "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
- Updated: "NGUI Set Sprite Multiple" (added required OnPreprocess() prerequisite for PlayMaker 1.8.5 and up)
- Re-worked: "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)
- Re-worked: "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
- Added: "Nav Mesh Agent Move To", "Get Child Count Advanced", "Float Compare Range", "Int Compare Range"
- had to split this post in half because of max char limit
- Added: "Activate Game Objects Advanced", "Game Object Keep Active", "Get Last Child", "Toggle Component", "Toggle Game Object", "Reset Transforms", "String Append", "String Remove"
- Added: "Enable Fsms", "Disable This FSM", "Restart This FSM", "Ease Int",  "Get Rotation Add Offset", "Nav Mesh Agent Get Area Mask", "Ngui Label Set Text Advanced"
- Re-worked: "List Game Objects Inside Collider", "List Game Objects Inside Collider 2D" (both contained a restriction that didn't allow to filter by the 'Untagged'-tag), "Get Position Add Offset", "Get Scale Add Offset" (the variable 'Apply Offset to GO' now allows for a direct GameObject to apply the offset to a different GameObject than the specified one; also added the selection of the update type), "Reset Transforms" (now allows to specify which part of the transform (position, rotation and/or scale) to include or exclude)
- Added: "Array Get Random Advanced", "Set GameObject If Not Null", "Random Point Between GameObjects", "Get GameObject Screen Position", "Random Wait Around Offset", "GDE Float Compare", "GDE Int Compare", "GDEResetItem", "GDE Schema Get Next Item"
- Re-worked: "Send Event Set Multi" (added 'Enable' and made 'Send Event' optional), "Send Event Set Value" (added 'Enable'), moved the Item and Field Names of my GDE actions to the top

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.

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.

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.

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:

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.

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]