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

Pages: 1 2 [3] 4
Official Action Updates / Re: Conditional Expression Action (BETA)
« on: February 03, 2017, 07:46:47 AM »
It would be grand if this action could be updated with an "Error Event" similar to the "xml select single node" action for when the content of the string variable used to store the condition is invalid.

I'm using the conditional expression action to test conditions read out of xml files and if there's a mistake somewhere in one of them (which happens easily) the fsm simply stops working instead of allowing me to output an error message.

This would help greatly to weed out those errors without bogging down the whole system.

PlayMaker Tips & Tricks / Re: Persistent data-- best practices?
« on: January 30, 2017, 10:11:29 AM »
I consider myself still very much a beginner (though I've been at it for about 2 years now) so I can't give any definite "best practices". What I've come to find, though, is that it depends a lot on how you structure your project and what works best for you in any given situation.

I actually use a mix of different methods for it, depending on the data I need carried over.

I use globals for basic variables that get accessed a lot, because it is easy to add in a state...
... for example an xml file that carries all the data on prerequisites for random events to fire

I use dontdestroyonload objects with arrays/hashtables that carry larger amounts of data that get populated dynamically
... every event has its on xml file with its contents, what texts/images to display etc. couldn't do that with either local nor global variables

And I use easysave save/load for the game settings and new game setup, just because I was getting into es2 at the time I made the settings/game setup menu... still works perfectly fine.

I think the important part is finding a method that works for you and your project and stick to it. I've mostly gone with a focus on ease of access during game creation and so far I've seen no downside in regards to performance or whatnot.

But as I said in the beginning, still very much a beginner imo, so take with a grain of salt.

PlayMaker Tips & Tricks / Re: PlayMaker stats
« on: January 30, 2017, 07:23:29 AM »
FSMs: 507
states: 2230
local variables: 1663
local events: 1870
global events: 122
global variables: 84

... and no end in sight.


I can think of two ways to achieve this.

a) Just build the string you want with a "build string" action... this lets you combine set pieces and variables into a new string or

b) Use "string replace" or "string regex replace", depending on your needs, to replace certain parts of a string. This is more interesting for when you have texts read out of an xml file for example. You'd have an initial string like "You were born on day [z] which was a [y]." and then just replace [z] with the day number variable and [y] with the day name variable.

The second way can get more complicated but is more flexible and better suited for dynamic content imo.


PlayMaker Help / Re: HELP! Smooth Mouse Follow with example
« on: January 23, 2017, 05:27:10 AM »

I've only experimented with this a bit but since I don't need it for my project I didn't get far into it, so I can't tell you exactly what you need/what's wrong.

However, I think the follow mouse action is not what you'd want for character movement like in, because when working correctly it doesn't make the object move towards the pointer but makes it mimic the pointer movement.

For the kind of movement you are trying to achieve you'll have to go with a more complex setup. I'm just taking a quick glance at my actionsbrowser/ecosystem here... as I said, I've never directly worked with this, so I can only give a rough starting point.^^

I'd try for a "get mouse position" action in combination with a "look at direction" to make it look at the pointer and then work with "set velocity" to make it move...

Hope this somewhat helps.

General Discussion / Re: Visual Scripting Talk
« on: January 20, 2017, 04:40:24 AM »
I learned java back in school and lua to - don't laugh- program little robots in minecraft to do my bidding... but I've forgotten pretty much everything of it at this point.

I've been creating a game as a hobby project for the last ~2 years now and since I lacked all the basics in the beginning, I have redone the whole thing a couple of times, like when I learned about new things like ArrayMaker or DataMaker. Actually, at times it felt like redoing things was all I was doing, which can be quite frustrating.

I have no problem "admitting" that my game was created entirely without me writing a single line of code (unless you count xml, which I don't)... and why should I?

If what you create is fun for people to play and if you enjoy what you're doing... where's the problem? There's nothing embarrassing about it. At. All.

PlayMaker Help / Re: Inpspector Lag with large FSMs
« on: January 20, 2017, 04:29:52 AM »
For breaking up FSMs it does help to decide on a naming scheme early on and stick to it. This way you know exactly where to look later when something doesn't work. I usually go with a "Process/Master" which is used to keep track of everything and name all further steps "Process/StepName".

If you then use the master to initiate each step and have each step loop back to the master on completion you have a way to keep track of everything pretty easily.

And, yea, I can only recommend you look into arraymaker, it makes so many things a lot easier (saving with easy save if you have a lot of variables that need to be saved/loaded as well).

PlayMaker Help / Re: Repetition in FSM's. Is there a simpler way?
« on: December 30, 2016, 09:07:52 AM »
I've moved on from that approach to just store most of my persistent variables in arraymaker arrays and hash tables. As far as I know there's no way to create new variables inside an FSM in runtime. So iterating through variables with an index integer (then int to string + add to the variablename) and getting their values from an array/hash table is the best solution for this imo.

That also makes it easier to save/load with easy save. (you can find arraymaker and actions for easy save/array maker on the ecosystem)

After my last unity update I had a bunch of compiler errors pop up for a couple of playmaker actions, interface was borked and the playmaker dropdown wasn't available.

Resetting UI to factory setting didn't help, but the dropdown returned after I removed the actions throwing the compiler errors. This is also mentioned in the Playmaker troubleshooting guide. Hope this helps salvaging your original project.

This happens when I use the "delete/contains duplicate" actions on array lists created through "create array list" actions in runtime for me. They work fine on arrays created in the editor.

Action Requests / Re: Get weighted random key from hash table
« on: September 13, 2016, 07:52:55 AM »
Alright, thanks for the input. Guess I'll stick to what I've been doing then. :)

Action Requests / Re: Get weighted random key from hash table
« on: September 09, 2016, 04:43:27 AM »
Hey, thanks for the reply. :)

The problem with the "random weighted int" action (unless I am missing something) is that you have to predetermine the number of variables it works with.

However since I am working with a very flexible number of possible events (+allow adding more events through modding) that could potentially get triggered, this doesn't really work for me. (could be 5, could be 50, could be 200+)

I don't want to put a hard limit on it, which would enable me to work with the random weighted int action. I currently use the workaround of assigning each event to a rarity group array according to its weight (which can change due to other variables) and then choosing first a rarity group with the random weighted int action and then a random event from said rarity group array.

As I mentioned in my first post I have no programming background and haven't been working with playmaker for too long yet, so maybe I'm just not thinking right here.^^

Action Requests / Get weighted random key from hash table
« on: September 07, 2016, 07:11:43 AM »

I'm currently working on a random event system for my game and an action to pick a random key from an arraymaker hash table with all the keys' values used as weights for the random pick would help greatly in reducing the overall complexity of the mechanic.

At the moment I work around this by assigning values to each event according to a variety of variables/flags and then sorting the events into categories from common to rare and then pick randomly from those subgroups which does work but isn't really as flexible as I would like it to be.


edit: alternatively if somebody has an idea for a similarly flexible way to do this with currently available actions/addons (which is doable for an amateur without programming background), I'd be very thankful for that as well.^^

Hey, yea sorry... I kind of forgot about this so I didn't reply.^^

@JellyHair: The main problem this caused me was that I wasn't able to have FSMs on objects created from prefabs read out xml proxies on other objects/xml data stored in global variables. So I added separate xml proxies to the prefab objects and had them populate them on generation. Not the smoothest way to do it I guess, but it works.

This is due to the "Xml Save in Proxy" action still working fine with variables. So you can store the xml data (I have my .xmls in the streamingassets folder to enable modding) in global variables and then use those to fill xml proxies in runtime.

I have no programming background so a lot of this is trial and error for me.^^

Heya, I am getting this error, when trying to use a string variable as a source for datamaker xml actions:

(the same with a GameObject variable with proxy reference)


ArgumentException: Object type HutongGames.PlayMaker.FsmString cannot be converted to target type: HutongGames.PlayMaker.FsmEvent
Parameter name: val
System.Reflection.MonoField.SetValue (System.Object obj, System.Object val, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoField.cs:133)
System.Reflection.FieldInfo.SetValue (System.Object obj, System.Object value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/FieldInfo.cs:150)
HutongGames.PlayMakerEditor.ActionEditor.DoVariableSelection (System.Object userdata) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionEditor.cs:2779)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/artifacts/generated/common/editor/GenericMenuBindings.gen.cs:122)


I am using Unity 5.3.4f1 with Playmaker 1.8.0f43. I have created a completely new project and tried an older version of unity, but the problem persists. This has me kind of in a bind since I need a few FSMs on prefab gameobjects to get data from xmls. A fix for this or if anyone can come up with a good workaround for this and let me know would be much, much appreciated.


Pages: 1 2 [3] 4