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 - Jos Yule

Pages: [1]
Share New Actions / ex2D Set Sprite action
« on: May 30, 2012, 11:50:00 AM »
hello all.

I've created an ex2D Set Sprite action. You can use it to, well, set the sprite "image" of an exSprite.

There are 3 parameters:

1. The Game Object with the exSprite component
2. The name of the sprite which you wish to display
3. The name of the atlas which contains that sprite

That is it. Let me know of any problems or questions via this topic!


ps. I've included the actual .cs file - you just need to drop it into your project somewhere. PlayMaker should then be able to pick it up and show it in the action list.

PlayMaker Help / Help with Casting FsmObject to specific type.
« on: May 30, 2012, 09:59:25 AM »

I'm working on an ex2D action - "Set Sprite". The action will allow you to dynamically set the sprite of a Game Object which has an exSprite attached.

I've used the ExSpriteAnimationPlay action code as a base.

My problem is that you need to denote the exAtlas from which the sprite should be taken. This atlas lives in the Project Hierarchy. I've got a var setup to hold this reference:

Code: [Select]
[Tooltip("The Sprite Atlas to pull the new sprite from.")]
public FsmObject spriteAtlas;

I originally had the spriteAtlas var set as an exAtlas type:

Code: [Select]
public exAtlas spriteAtlas;
But then i couldn't drag/drop the actual atlas from the Project tab into this slot.

So, i'm now trying to figure out how to cast from FsmObject to the specific exAtlas type. This is what i'm doing now, which isn't working:

Code: [Select]
var realAtlas = (exAtlas)spriteAtlas.Value;
Any suggestions? Would love to know how to deal with non-fsm specific var's in Actions.


PlayMaker Help / [SOLVED] HashTable - ContainsKey vs. Contains
« on: May 17, 2012, 08:32:53 AM »

Looking at the code, the two only differ in the following method call


Code: [Select]
containsKey.Value = proxy.hashTable.Contains(key.Value);

Code: [Select]
containsKey.Value = proxy.hashTable.ContainsKey(key.Value);
I can't find .Contains() on the msdn site, but .ContainsKey() is here:

What is the difference between the two?

Looking at the assembly browser version, .ContainsKey() actually just calls the .Contains() method under the hood, I think. In which case, can we remove one? I'd suggest the .Contains(), as it isn't in the msdn docs...


It would be great if we could have onApplicationQuit, onApplicationPause and onApplicationFocus as global events in PM.

For iOS dev, it is important to be able to react to the onApplicationPause event (and its parameter), so you can save any state you need to. This is triggered when the user receives an incoming call, or hits the HOME button.

Really, onApplicationPause is the most important to me, then onApplicationQuit and finally onApplicationFocus (i'm not at all sure of what it does or when it fires, at least on iOS).



These, even at the code level, are identical (minus a new line or two). It is confusing knowing which to use.

Perhaps remove the "Start Server", as "Network Initialize Server" seems to more closely match the naming convention of the rest of the Networking Actions.


Action Requests / RegEx String Comparisons
« on: May 14, 2012, 10:39:29 AM »
Hello all.

I'm having to do some string comparisons, and i'm finding the current string compare action too limiting.

I would like to use some kind of RegEx-ish tools in my comparisons. For example, "does the string start with a 'h' character?" or "is the 3rd character an 'a'?".

I don't know if it would just be easier to use the Regex libs, or come up with some other tool/ui/format... Having a RegEx action would be great, but if there is a more friendly way to allow for more complex text comparisons that's cool with me too.


In line 68 of the PlayMakerArrayListProxyInspector.cs file:

Code: [Select]
proxy.showEvents = EditorGUILayout.Foldout(proxy.showEvents, new GUIContent("PLayMaker events" + eventsEnabledString, "Manage PlayMaker events dispatch"));
You can see in the GUIContent() call that "PlayMaker" is improperly capitalized.


Looking at the GUILayoutTextField.cs, it seems you are using the following method signature to call GUILayout.TextField() :

static function TextField (text : String, style : GUIStyle, params options : GUILayoutOption[]) : String

I'd suggest you use the following method signature:

static function TextField (text : String, maxLength : int, style : GUIStyle, params options : GUILayoutOption[]) : String

So, you can send the default maxLength value here, or actually use the value the user has selected.

ps. here is the link to the Unity docs about GUILayout.TextField() -

pps. This is using Unity 3.5 and PM 1.3.3

Hello all.

I'm working on creating a localization/translation action/script(s).

I have something working - ie. i have a script which reads an XML file and i can then call GetText(id) on it to get different translations.

What i was then doing is setting a string variable (translated_text) via a new Set Translation action i created.

Again, this is all working peachy.

I was then using this variable to set the text on a GUI Button.

All good.

However, the issue starts if i have more then 1 GUI Button actions in 1 State, and i am setting the `translated_text` variable in-between those actions. In this case, because of the way OnGUI and the setting of the content to a new instance of GUIContent() in OnGUI (in the GUIContentAction class, parent to GUIButton), both buttons get the same name - the last value `translated_text` was set too.

If the text.Value was cached in a local var (or something), in a OnEnter or some other 1 time fired method, and then used in the OnGUI method, this would not happen.

I'm not sure if anyone takes advantage of the fact that you can change the name on a button dynamically the way it currently is. I just know that having to setup a different variable for each button name takes some of the niceness out of it.

I could also, i suppose, override the GUI Button action and make a GUI Translated Button, which would get the translated value itself.

Anyway, any suggestions or comments about this would be great!


Pages: [1]