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
PlayMaker Help / Re: Making NPCs Remember Things
« on: June 19, 2017, 02:41:00 AM »
A simple way to do this would be to work with Arraymaker (can be found on the ecosystem) and use hash tables.

Assign a hash table to every npc that contains that npc's opinion of every other npc. The other npc's IDs would be the key and the value the hash table's owner's opinion.

To then use an npc's (1) opinion of another npc (2) you access the opinion hash table of (1) and get the key [(2) ID].

The important thing here is to be consistent in how you build things from the base up. If you plan on having multiple hash tables for each npc (for example one for opinions, one for general stats etc.) decide early on on a way of organizing things and stick to it.

Action Requests / Hashtable get variable type for key
« on: May 10, 2017, 03:44:17 AM »
I'd like an action that let's you provide the key for an item in a hashtable (Arraymaker package) and returns the variable type (int,bool etc.) in some form, preferably a string or even as events for various types.

Use case/context:

I'm currently building debug tools for my game and would like to do a simple dev console to enable testers to easily change the values for various variables stored in hash tables.

However, since I am currently storing variables of different types in the same hashtables (every character has a table to track their stats + a central hash table for "global" stats) there's no easy way to do this without possibly screwing up the game state by storing the wrong type of variable to a key.

This would also be helpful to keep similar problems when manipulating variables in a way that's not hardcoded but dynamic, when using game events provided by xml for example. It's rather easy to slip up here and provide a wrong variable name, possibly screwing up players' savegames. With this kind of action one could implement a check to see if the variable type of the item in the hash table is the same as the one provided by the game event and stop it from overwriting the item if it isn't.

PlayMaker Help / Re: Loading an link from playmaker?
« on: April 05, 2017, 03:36:59 PM »
I don't know if it will work on an android device, but there is an action on the ecosystem called "application open url" if you haven't tried that one already.


Looks like an error caused by a "set fsm xy"/"get fsm xy" action that tries to access a nonexistent variable. Could it be that you're using a similarly named variable (probably different capitalization) somewhere? If so try finding that one and go from there to other FSMs that should try accessing it.

Action Requests / Array get closest game object (in sight)[SOLVED]
« on: April 02, 2017, 08:22:48 AM »

Those two actions do exist for Arraymaker and seem like a logical addition to the new Playmaker array variables.

I assume using them in combination with a spherecast to get a pool of units in range of a unit and then select the closest one is less heavy on performance than just using "find closest", since that one (I assume) tests against all objects in the scene.

Share New Actions / Re: uGui image fill ammount
« on: March 24, 2017, 08:15:49 AM »
Ah, nice. I was looking for these a while back after Jean mentioned the "ugui xy" actions were preferable over "set properties" and I started replacing all the "set properties" actions in my project. :)

Thanks, appreciated. :)

PlayMaker Help / Re: Convert String to Object
« on: March 21, 2017, 02:25:47 PM »
You could use arraymaker to store all your sprites in a hash table with the reference used in your .xml as their keys. Then, when needed, just use the data from the .xml to pull the appropriate sprite from the hash table.


Official Action Updates / Re: Conditional Expression Action (BETA)
« on: March 15, 2017, 12:22:18 PM »
Yes, it works now. Thank you guys so much. :)

Official Action Updates / Re: Conditional Expression Action (BETA)
« on: March 14, 2017, 07:53:30 AM »
Heya, thanks for taking a look at this.

I've tried it and got the following compiler error:

Assets/PlayMaker Utils/Wizards/LinkerWizard/Editor/LinkerEditorChecks.cs(17,66): error CS0433: The imported type `PlayMaker.ConditionalExpression.ConditionalExpression' is defined multiple times

Can only be resolved by deleting the ConditionalExpressionAction.cs from this package after which the original one still remains but can't actually be located anywhere in the project. :/

When trying to locate it:
Couldn't find Action Script: PlayMaker.ConditionalExpression.ConditionalExpression
HutongGames.PlayMakerEditor.ActionScripts:PingAssetByType(Object) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Editor/Classes/ActionScripts.cs:123)
UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

I also tried it in another project I set up only a couple of days ago with the same result.

Edit: the "couldn't find action script" error occurs before trying to replace the action as well, btw. so it probably wasn't caused by it but rather is connected to the reason why the replacing doesn't work. (I hope I'm not just being dense here... I'm not a programmer myself, so I'm just fishing :D )

Delete only the Action/Script throwing the error. Once the compiler errors have been resolved your Playmaker should show up again.

Official Action Updates / Re: Conditional Expression Action (BETA)
« on: February 22, 2017, 06:44:10 AM »

thanks for the reply Jean. I just set up a small test FSM (see attachement, ignore the error log, those are unrelated) to show the behavior.

Using a bool variable called "Bool":
a) Bool variable value is true, Expression string is initially empty.

-> it will check correctly once after the expression has been changed from empty to "Bool==false" and return "false". It will then just continue to return "false" in a loop even though the expression has changed to "Bool==true" and it should return "true"

b) Bool variable value is true, initial Expression string is "Bool==true"

-> it will continually return "true" in a loop, even though the start state set the Expression string to "Bool==false" and false should be returned.

Similarly if you set the Expression string in the editor initially to "Bool==true", open the state and click "Refresh" on the action it will return "true". If you then change the value of the string to "Bool==false", go back to the state and click "Refresh" it will show the changed expression but still return "true".

Edit: Bug report submitted (I hope this is something that can be resolved quickly, it's causing me a major headache right now)


Official Action Updates / Re: Conditional Expression Action (BETA)
« on: February 20, 2017, 08:28:54 AM »
Okay, I found another problem with this action that kind of makes it not viable anymore for what I actually wanted to use it for.

When using a string variable to change the actual expression (not the values of the variables used) in runtime it just doesn't update properly and continues to use the initial value of the string variable set in the editor.

Edit: it doesn't work properly when you change the value of the string in the editor either, even with the "refresh" button... I can't believe I hadn't noticed that earlier.

Any chance of someone picking work on this action up again? This is actually pretty major for me since I started redesigning "availability checks" of events and other things around this action... probably should've tested it more thoroughly... for some reason I didn't notice this for quite some while.

edit2: Well, turns out when used in a template it works properly the first time around, but afterwards it uses the string value from the first run... and I'd only done a test run with one "item", saw it worked and then started implementing it everywhere.

PlayMaker Help / Re: Trouble dragging GameObjects onto an Action
« on: February 16, 2017, 05:38:47 AM »
You can not directly reference Objects in the scene inside a prefab. You need to either

- Store the object used in a global variable
- Pass the object to the prefab on creation in runtime
- Get the object via a "find object" action (it's recommended to search by tag, not by name... those actions are resource intensive)

Personally, I used a mix of the first two.


PlayMaker Help / Re: Template async?
« on: February 15, 2017, 07:32:42 AM »
When I experimented with this a while back the state didn't finish until it received the "fsm finished" from the template even without a set finished event in the "run fsm" action. The only way around this I found was to have the template send an event to the host fsm to trigger the next state of the host fsm.

(I can't code, so no idea as to what's possible in that regard)

General Discussion / Re: Playmaker and Unity for the first time
« on: February 15, 2017, 06:44:15 AM »
Heya, I started with unity+playmaker without any background/experience in coding as well, about two years ago now.

The one thing I will say, by my own experience and seeing often asked questions on here, is that it is worthwhile to not only focus on playmaker specific tutorials when first starting out.

One of the very first things I actually watched was a tutorial series on the new Unity Gui system which only had a tiny bit of scripting in it, but taught me a bunch about how to use the various inbuilt UI components. I then tried to replicate what had been done via scripting with playmaker actions, so the first thing I actually got was a kind of menu manager I'm still using (with a few tweaks) for my (very ui heavy) management sim.

There are a ton of good tutorials on Unity out there and a solid amount of tutorials on playmaker here (as 600 pointed out) that'll help in adapting techniques for playmaker.

A couple of things that I learned to use rather late and wished I'd learned about earlier are:

- Arraymaker for arrays and hash tables (I use those extensively, even now with the new array variable available)
- Datamaker to use xml for datamanagement
- EasySave2 not only for game saves but also useful for carrying data over between scenes

...and definitely get the ecosystem addon for playmaker, it's pretty much mandatory at this point to get access to a lot of really useful stuff for playmaker. (It might already be included in the playmaker package at this point, I'm not sure)

Pages: [1] 2 3 4