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 - krmko

Pages: [1] 2 3 4
1
Playmaker Help / Check if a game object has an FSM named "Banana"
« on: November 15, 2017, 07:10:24 AM »
Hi guys,

i have an FSM which is present in some object and in some not (let's call that FSM "Banana"), but every object has an FSM which needs to check if the object has FSM named "Banana" or not on itself so it can continue doing it's stuff.

Any idea on how to do this? I suppose Has Component should do, but i probably got some more stuff to write in the component field since there are few FSM's on that object.

2
Playmaker Help / Ideas for system improvement
« on: November 10, 2017, 10:57:52 PM »
Hi guys,

I remade the weapon, firing, bullet and pickup system into something more universal, so i can just copy/paste FSM's to necessary objects and use local variables to do the necessary stuff, but there's an oversight i made and i need a fix. Here's a quick explanation.

I have weapons which names are structured like this:

PulseGunWeaponLevel1
PulseGunWeaponLevel2
PulseGunWeaponLevel3
PulseGunWeaponLevel4
PulseGunWeaponLevel5

Since i'm using pooling system, (clone 1), (clone 2) etc. string is appended when the weapon is spawned, so the name are actually like this:

PulseGunWeaponLevel1 (clone 1)
PulseGunWeaponLevel2 (clone 1)
PulseGunWeaponLevel3 (clone 1)
PulseGunWeaponLevel4 (clone 1)
PulseGunWeaponLevel5 (clone 1)

Since there will be no more than a few instances in the scene (certainly not more than nine) it made sense to make the folowing hash tables:

PlayerWeapon
PlayerWeapon Key / PlayerWeapon Value
PulseGunLevel1 (string)/PulseGunLevel 1 (object)

To get the true object name out of a spawned object which contains (clone x) appendix, i get the object name, get name length, convert it into string, use the int operator to subtract the last 10 characters (" (clone_1)"), and the get string left to get the name without the (clone 1) appendix. Then i can use that name to get whatever data i need on that weapon on runtime (display name, weapon type display name for the hud and so on).

While not so complicated and applicable to weapons, it is not applicable to bullets since they appear in more than nine instances (clone 10, for example) on the screen and the whole "subtract last 10 characters" idea falls flat. Sure, i could compare the string length and then subtract last 10 or 11 characters depending on the length, but it it unnecessary complicated.

Djaydino had some ideas http://hutonggames.com/playmakerforum/index.php?topic=16064.msg74988#msg74988, and he was pointing to the problem in time, but i'm not sure how to do it, so any suggestions or step-by-steps are welcome.

Maybe using enums? I haven't used them before though. Can i define an enum so that every pooled clone always has the same name actually so i don't have to mess around with string concatenation, building and truncating?

3
Playmaker Help / Set FSM String problem [SOLVED]
« on: November 07, 2017, 01:44:30 AM »
Ok, so i've got this tagged game object in the scene. I get it's tag, and that works fine



When the conditions are met, i set the that value, to variable in another FSM.



I activate the global event that should compare some values including the variable i set, but it's empty



Everything's set alright, Player is a Global variable, FSM name is copy/pasted, string variable is existant, but still set fsm string action doesn't set any value.

4
Playmaker Help / Colliders problem
« on: November 06, 2017, 03:11:38 AM »
I'm having a banal problem, and i can't believe what's happening. I've got the Gunpoint Object that is attached as a child of the player, with these settings:




When it comes in contact with Pickup in the scene




an event should be triggered





I've set the Layer Collision Matrix, Z positions are aligned (2D game, everything uses 1 for Z transform value), i even tagged the Pickup Prefab, but still no collision is detected. I must be missing something banal, i tried all sorts of combinations of rigidbody types, istrigger checked or not, discrete/continuous collision detection and nothing works  >:( >:( >:(



5
Playmaker Help / Help with reactoring FSM [SOLVED]
« on: November 04, 2017, 03:08:18 PM »
Hi guys,

I while ago i made a weapon pickup and upgrade FSM system which was quite complicated and needed to be in every weapon to be functionable. Recently i got an idea to make a centralized system for that, but i'm hitting some walls.

Here's the setup:

I've got a hash table of all player weapons objects with key being their names (PulseGun1, PulseGun2 to PulseGun5...every level of weapon is considered a new weapon, but they share the same tag, PulseGun).

On the player, where the pickup system will be located, i have active and inactive weapon. So, when i hover over the pickup weapon, i compare the active weapon tag (let's say it's PulseGun, but we don't know of what level since levels 1-5 share the same tag) with pickup weapon which is also tagged PulseGun.

In that case, if we have PulseGun3 as active weapon, it should be upgraded to PulseGun4 since we picked up the weapon of the same type/tag.

Now, since we have no idea which tags matched on runtime, we need to to another tag check. Is Active Weapon X tag? No. Is Active Weapon Y tag? No. That would take maximum 30 iterations (total weapon number) until we get to is Active Weapon PulseGun Tag? Yes! Now all we need to do is run another check, this time by name. Is Active weapon name PulseGun1? No. Is active weapon name PulseGun2? No. Is Active Weapon Name PulseGun3? Yes! Despawn Active Weapon and Spawn PulseGun4 as active weapon.

Now this doesn't take much (35+ iterations top for each weapon), but it's a hell of a lot of states. I could make multitag and multistring comparison actions to shorten everything to two states (one for checking weapon tag PulseTag and one for checking weapon String, PulseGun1, PulseGun2...) But it still requires a lot of typing and is poorly scalable, especially if i pickup a weapon that's differently tagged than Active Weapon. In that case i'd need to check tag and name of Active Weapon to get to the information of which level is the Active Weapon and the replace it with the same level of Pickup Weapon, which is horrible.

Any advice on this one?

6
Playmaker Help / Need advice on data driven design
« on: November 03, 2017, 04:40:45 AM »
Hi guys,

A while ago i had a suggestion for the option to export/import global variables into a spreadsheet for easier editing. Jean and Djaydino were appaled by the number of global variables i use at the moment (more than 800). For me, it was the most logical way to store data since i could access it from anywhere in the project. I was a beginner and i felt that using local variables is too limiting, especially when time comes to tweak things like attack or health points of certain enemies for example. Downside to that approach (besides security and naming), as i noted further down the road, is the impossibility to manipulate it in a more meaningful way than variable by variable in a closed Playmaker environment. Besides that, local variables that don't draw data from a data source are easy to mess up and hard to debug sometimes.

In terms of programming, i'm currently in the phase of knowing more each day, but aware that i actually have more and more to learn. As a method of learning, i decompiled a lot of stuff made in Unity by opening .dll files with Resharper. I noticed that majority of games use JSON for data storing (with XML as the second most used format). I also bought Easy Save as a very praised solution which uses neither XML nor JSON, but claims to be faster than both (tho i don't care about the fast part, easy got my attentiom) but i don't know how easy is to edit those files since they are in their own enclosed binary format. They have their own editor, but that seems as handy as editing 800 globals in Playmaker (not handy at all ;D).

Why am i asking this now? I'm starting to bump into limitations. The way i work has 0 reusability and making things interesting and with variety is starting to take too much time copying and pasting the same things over and over to get a sense of controlled randomness.

The game i'm working on is an endless shmup and i want to be able to store everything and just call it as needed.

I want to create an enemy that will draw an image, flying pattern, shooting pattern, hp, attack points, armor type, bezier path points and everything else from a data structure in the format that is easy to store, read and edit. Furthermore, i want to be able to easily make subsets and combinations of data. As far as i have seen, for something like that i need multidimensional arrays (probably) and JSON seems the best suited for something like that.

One last thing i need is the advice on most painless way to refactor the existing FSM's and stored global and local variables (exporting and rearranging to empty data structures).

Any advice is more than welcome. I attached a dummy basic data structure of how enemy objects i imagine to work like, it's basically like deriving classes and adding methods.










7
Playmaker Help / Datamaker not working[SOLVED]
« on: November 01, 2017, 05:11:41 AM »
Hello,

i tried downloading Datamaker package from Ecosystem but it wasn't working

Code: [Select]
ArgumentException: Getting control 2's position in a group with only 2 controls when doing Repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/LayoutGroup.cs:115)
UnityEngine.GUILayoutUtility.BeginLayoutArea (UnityEngine.GUIStyle style, System.Type layoutType) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:344)
UnityEngine.GUILayout.BeginArea (Rect screenRect, UnityEngine.GUIContent content, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:364)
UnityEngine.GUILayout.BeginArea (Rect screenRect) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:346)
Net.FabreJean.PlayMaker.Ecosystem.EcosystemBrowser.OnGUI_ItemList () (at Assets/net.fabrejean/Editor/PlayMaker/Ecosystem/EcosystemBrowser.cs:1977)
Net.FabreJean.PlayMaker.Ecosystem.EcosystemBrowser.OnGUI_Main () (at Assets/net.fabrejean/Editor/PlayMaker/Ecosystem/EcosystemBrowser.cs:836)
Net.FabreJean.PlayMaker.Ecosystem.EcosystemBrowser.OnGUI () (at Assets/net.fabrejean/Editor/PlayMaker/Ecosystem/EcosystemBrowser.cs:1153)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:285)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:278)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:245)

I downloaded the package from Jeans Github, but i get two error after i import the package.

Code: [Select]
Assets/PlayMaker ArrayMaker/Actions/ArrayList/ArrayListGetType.cs(85,44): error CS0117: `PlayMakerCollectionProxy' does not contain a definition for `GetObjectVariableType'
Code: [Select]
Assets/PlayMaker ArrayMaker/Actions/HashTable/HashTableGetType.cs(86,43): error CS0117: `PlayMakerCollectionProxy' does not contain a definition for `GetObjectVariableType'

Unity 2017.0.2f3, Playmaker 1.8.5.

8
Playmaker Help / Rotating child object towards parent
« on: October 24, 2017, 06:40:45 AM »
Well, it's kinda harder to explain, so i made this neat little drawing, sorry, i'm at my office so i drew it with mouse.



I've got engine jets that are childed to the ship, and they always stay as they are, no matter if the ship moves up or down. What i want is to rotate them slightly when the ship moves up or down, as described in the picture. Now, if it wasn't childed, i could rotate it towards, but as it keeps it's local position, that doesn't work of course.

By the way, i use translate for moving the ship, i don't know what property should i listen to to adjust the rotation of the jet according to the ship movement?

9
Playmaker Bug Reporting / Action Browser Not Working [SOLVED]
« on: October 23, 2017, 01:34:48 PM »


Playmaker 1.8.3
Unity 5.6.3f1 personal

I opened the action browser, started typing "bool" to filter out an action, but everything disappears and i can't click anything. I get this error:

Code: [Select]
InvalidCastException: Cannot cast from source type to destination type.
OnAnimatorUpdateActionEditorBase.EditEveryFrameField () (at Assets/PlayMaker/Actions/Animator/Editor/BaseClasses/OnAnimatorUpdateActionEditorBase.cs:18)
GetAnimatorBoolActionEditor.OnGUI () (at Assets/PlayMaker/Actions/Animator/Editor/GetAnimatorBoolActionEditor.cs:19)
HutongGames.PlayMakerEditor.ActionEditor.OnGUI (HutongGames.PlayMaker.FsmStateAction action) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionEditor.cs:196)
HutongGames.PlayMakerEditor.ActionSelector.DoSelectedActionPreview () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionSelector.cs:589)
HutongGames.PlayMakerEditor.ActionSelector.DoBottomPanel () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionSelector.cs:546)
HutongGames.PlayMakerEditor.ActionSelector.DoGUI () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionSelector.cs:158)
HutongGames.PlayMakerEditor.BaseEditorWindow.OnGUI () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/BaseEditorWindow.cs:72)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

I tried restarting Unity, opening Action Browser in another FSM, but nothing.

Any idea how to solve it? It's screwed up and i need to work. I see this guy had the same problem:

http://hutonggames.com/playmakerforum/index.php?topic=14137.msg71250#msg71250

Not really into reinstalling Playmaker if that's the solution.

10
Playmaker Help / Help on basic animations[SOLVED]
« on: October 14, 2017, 08:52:04 AM »
Hi, i'm using a prefab which contains an event proxy for receiving a callback event from another component, but it doesn't instantiate with the prefab. Any solutions how to set it up?

Here's the image, i'm using it forward the callback event to the parent  to play the animation


Well, i sorted things out with the event proxy without using it, i'm just invoking the method when shooting. But i have a different problem. Animations were always confusing for me, animator, animation, animation controller, bwah.

The idea is to have the invoked method trigger the animation on the ship when it shoots, but i have no idea how to set it up right. I've set up the FSM to play the animation, but what should the prefab of the object that is to play the animation contain?

I've got the animation and animation controller, what should i do to make it happen :P

Here's the setup, but it doesn't work:

Animation is on the object that should be animated



And this is the FSM



Nothing out of the ordinary, but it doesn't work. I tried setting the animation to legacy too, but nothing.

Edit: I checked the debug log of the FSM that is supposed to play the animation, no errors.

11
As the title says, i need get random from a hash table, but Collections base action - don't use! is in the description. Does it work?

12
Playmaker Help / Making a dispersable particle system shot with Playmaker
« on: October 07, 2017, 04:37:32 AM »
At the beginning of my dev tenure i bought a cute little asset that has an amazing effect integrated



As you can see, a spaceship fires a laser, and then it gets kind of dispersed. I've got the script for it, but i'm not sure how to translate it into an FSM as it's quite complicated. If anyone wants to give it a shot let me know :)

13
Action Requests / Get global position
« on: October 01, 2017, 10:29:34 AM »
Hi,

any chance of someone making this action? I've got a debug script for it, just needs to be put in an action, something i'm not quite confident in yet and i think it will be useful to many :)

Here's the script:

Code: [Select]
using UnityEngine;
 using UnityEditor;
 
 public static class DebugMenu
 {
     [MenuItem("Debug/Print Global Position")]
     public static void PrintGlobalPosition()
     {
         if (Selection.activeGameObject != null)
         {
             Debug.Log(Selection.activeGameObject.name + " is at " + Selection.activeGameObject.transform.position);

         }
Vector3 pos = Selection.activeGameObject.transform.position;
Debug.Log("pos is now " + pos.ToString("f3"));
     }
 }

14
Hi,

first of all i'd like to say that i started using Playmaker 1,5 years ago with some small previous programming knowledge in Java and i made a huge progress in that time. With progress comes further knowledge and the need to do stuff faster and simpler, which is the goal for all of us. Sure, i've got a lot more to learn as you have seen on the forums, but some things really started to hinder the progress.

I'm satisfied with global variables editor, though it can be tedious to work in it. How can i be satisfied if it's tedious to work with? Well, the principle is good, it is fast, but there are simply too many variables in use in any decent project to handle them in the editor. I've got about 800 global variables (for now), editing them in a meaningful manner is not viable without exporting and importing from a spreadsheet.

Easy Save (and Game Data Editor too) does a great job in exporting globals to a comma delimited file which can be easily manipulated in any spreadsheet software. Unfortunately, there's no way of reimporting it, so the export is only good for analysis purposes and you have to do any variable modification inside the engine. Easy Save 3 will probably have csv importer as far as i have seen, but i don't see why wouldn't Playmaker have such a feature natively? All the globals are saved in playmakerglobals anyway, just not delimited.

There's also been a discussion on "local global" variables (which can be seen between different FSM's on same object) but i see that discussion is from 2012., and though that would make things harder for rookies i think that would definitely cut the amount of work and number of variables needed later on in the development.

Another thing that i find a bit problematic are local variables. I don't think it would be easy or fast to make it possible, but viewing and editing those OUTSIDE the FSM with a pointer to the object they're attached to would be an enormous time saver. As of now, going from FSM to FSM is really time consuming.

With all that and some workflow stuff like grouping states it could became the ultimate all-in-one powerhouse.

15
Hello,

I made a 2D 15*21 grid (A1/A21-O1/O21) of gameobjects that will be added to arraylist and used for random spawning locations by getting a random arraylist item and using its location. But i also need the possibility to target the exact gameobject i wish to use as a target location (for example G13).

Normally, i would use get owner action and store the gameobject in a gameobject variable under its name, but when i think of the work needed to create FSM on each object to get owner and store it under a different variable, my head hurts.

Any elegant way of solving this?

Pages: [1] 2 3 4