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.


Messages - artician

Pages: 1 ... 18 19 [20]
286
PlayMaker Help / Prefabs not retaining settings
« on: June 21, 2011, 02:43:33 PM »
This is driving me nuts. 

I have several prefab objects with FSMs on them.  Whenever I load a different scene, the prefab has dropped half its settings.  Variable assignments, gameobject IDs, whatever.  It's worth mentioning that this is not a case of forgetting to press "Apply" or save the prefab and/or scene.  This is consistent and widespread in my project.  I'd love it if someone could please tell me what I'm doing wrong, because I'm certain it's an issue of ignorance on my part, but it's killing me. 

Here's a very specific scenario:
I have one gameobject that controls my menus, level loading, and variables used throughout the game.  It uses a series of custom events, such as "sys_startGame" which is used in the title menu to begin play.  I made this object a prefab, and it exists in multiple scenes so I can easily assign other gameobjects to its various states. 
Now, if I am editing the title screen ("scene01"), I set everything up with the prefab, hit apply, save the scene, and load the next scene I want to edit ("scene02").  In scene02, the events I assigned in Scene01 are reset to "None".  I am forced to revisit every state that sends an event and reapply the events it should be sending.  It doesn't seem to matter though, because as soon as I return to Scene01, they're reset again.

As always, thank you for any help or advice!

287
PlayMaker Help / Re: Exercise in Saving Data
« on: June 20, 2011, 12:44:50 AM »
I moved to the system you suggested, with unique boolean values dictating the state of each objective, and I ran into an issue regarding this. 
I am storing the boolean values in Ints as 1 or 0.  If I have 20 boolean values in a save-game, is the only way to store them to create 20 separate keys? 

288
PlayMaker Help / Re: Exercise in Saving Data
« on: June 19, 2011, 01:33:24 AM »
Thanks for the reply, and for sharing your thoughts.  You make some really good points.  I did plan to possibly add more objectives as the game grows, so I'm taking your advice on unique booleans.  

Fun being had!


289
PlayMaker Help / Exercise in Saving Data
« on: June 18, 2011, 05:33:21 PM »
Hello all,

I thought I'd post how I'm tackling save-games in my project to see if anyone could learn anything from it, or likewise offer some ideas that might help me out.  This is the first time I'm dealing with data storage through Unity, using the PlayerPrefs actions.  It feels awkward, but doable!  

My project has 5 story objectives within it, with 20 collectible items.  The game saves the progress after an objective is fully completed, or when a collectible item is picked up.  

Progression through story objectives is linear, so I'm using an Int to store the progress for those.  If the Int is 0, the game begins with the intro.  Each time an objective is completed +1 is added to the Int.  This Int is read at runtime and the value determines the state of the world, relative to the objectives completed.  

Collectible items can be acquired in any order at any time, and since they are completely independent of the story and main objectives I was going to use one boolean for each item.

Finally, the way I will process these is to read the main story Int, and each of the 20 booleans at runtime/title screen.  Then I will load the save-game screen and have strings reflect the state of the games progress.  During gameplay, each time an item is acquired or an objective completed, the game will pause momentarily and write to the Int or associated Bool, effectively autosaving the state of the game.

That's as far as I've gotten.  I think it should work fine, but I wonder if I'm going about it wrong.  I hope this encourages discussion to help my situation and hopefully others too.  

As always, thanks for reading!

290
PlayMaker Help / Re: How To Integrate EZGUI Elements Into PlayMaker
« on: June 17, 2011, 01:23:50 PM »
I second this!  ezGUI looks good, but I'm actually assessing if a project can be completed using only PlayMaker functions.  I'd love to have some actions that could utilize it.

291
That is great man.  Thank you very much for taking the time to make this explanation.  I look forward to the screencast too (sorry about the trouble that's kept you from putting them online yet). 

292
PlayMaker Help / PlayerPrefs and Keys
« on: June 14, 2011, 01:07:49 PM »
I'm having trouble understanding the usage of PlayerPrefs in the context of saving data between game sessions.

I've read all material between the unity reference docs, playmaker docs, and both forums, but I haven't found an answer concerning how to create keys.  I may be approaching this incorrectly, but mostly I want to know how to create a Key.  I only see actions for deleting them, and checking if they exist.

I've found no material that discusses how keys are made, what they're used for, etc.  Do I just entirely misunderstand the concept?

As always, thank you for any help on the subject!

293
Action Requests / Re: Save and Load scene or file?
« on: June 14, 2011, 10:55:26 AM »
I was looking for a similar solution, and would love to request some actions related to Moodkie's Easy Save extension.  I'd understand if you don't want to include specific actions that require external tools, though.

Thanks.

294
Action Requests / Re: Advanced Character Controller
« on: June 14, 2011, 10:51:23 AM »
It isn't exactly what you're asking for, but take a look at the CharacterMotor and PlatformController actions I dropped into the New Actions forum.  Coupling those with Alex's AxisEvent action will go a long way to getting you to what you want.

295
PlayMaker Help / Re: Are All PlayMaker Variables Global?
« on: June 14, 2011, 10:49:17 AM »
I might be able to help.  It's easy for things to get out from under you, because this tool has made it so easy to plug things together without fully understanding what's going on.  Frustration is a frequent reward if you're in that position, because when it comes time to actually engineer an efficient, functioning system, you realize that something like PlayMaker can't help you with the discipline and theory.

Sorry for the redundancy, but I'll partially translate MaDDoX's reply. ;)

Quote
all PlayMaker variables are accessible to all states?
Yes, though you have specifically send or request this data between FSMs.  They are not "global" in the sense that a variable Int named "score" on one FSM is treated the same as another Int named "score" on another.  FSMs can have identically named variables without interfering with one another. Anything you store in one FSMs variable, can be grabbed out by another, separate FSM.  You can see the actions used for this as the "Send" or "Get" actions you see within the StateMachine action group within the editor.

Quote
What kind of code does PlayMaker generate?
None.  However it uses[/] whatever code or script its actions were initially written in, usually C#.  You can see this for yourself by looking at the .CS files in the Playmaker Actions subdirectory.

Quote
PlayMaker is starting a very new and lasting paradigm
It's actually not!  Though it's an extremely robust initial offering for Unity.  Tools like Motivate, Virtools Dev, Multimedia Fusion (to a lesser degree) and more recently Kismet (unreal engine) have been around for 5-15 years.  The coupling of such a usable interactive development environment (IDE) like Unity with it though has given it a very wide visibility that is new to it.  I get a good feeling from it too!

Quote
I like the PlayMaker concept of doing everything in small "chunks"...
Just in case you aren't familiar with it you may want to read up on http://en.wikipedia.org/wiki/Object_oriented_programming, as it's mostly what you're talking about when you describe the method of working with PlayMaker.  It's a simple concept to understand and goes a long way to helping you design efficient statemachines and systems.

Sorry for the redundancy again, but I hope that helped.

296
PlayMaker Help / GUI with Joystick Input
« on: June 13, 2011, 02:33:35 PM »
Hello all, I am working on a project that is designed with console controllers in mind.  I have successfully gotten the GUI interface actions to work just fine in the past, using mouse input and whatnot, however I'm not certain where to start for joystick input.  I would like to use the joystick to highlight each menu option, and select them with the press of a button, but I can find no natural way to do this aside from making the thumbstick simply control the mouse (which is awkward for a console-style presentation).

I have a few theories about ways to attempt this, but I'd really like to know if anyone here has prior experience they could relate, or suggestions they could throw my way.

Many thanks in advance for the help!

297
@mrbdrm: did you ever solve your problem?  I'm afraid I can't offer much help.  I can say that the addition of a script or other component in my project has forced me to reimport Playmaker several times in the past, which was the only solution that I could find to similar issues.  It doesn't appear that the obstacle you're having a problem with is PlayMaker though.  I hope you figured it out!

298
I am in over my head with the amount of information I've been absorbing lately, to such a point that I only discovered this forum, which I have been wishing for for months, today.  Well!  Time to share some actions!

Here is an action that exposes all the variables within the CharacterMotor script:

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;

[ActionCategory(ActionCategory.Character)]
[Tooltip("Interface to CharacterMotor component")]
public class CharacterMotorAction : FsmStateAction {
    [RequiredField]
[CheckForComponent(typeof(CharacterMotor))]
public FsmOwnerDefault owner;

CharacterMotor motor;
GameObject previousGameObject;

public FsmBool CanControl = true;
public FsmFloat ForwardSpeed = 10f;
public FsmFloat SidewaysSpeed = 10f;
public FsmFloat BackwardsSpeed = 10f;
public FsmFloat MaxGroundAcceleration = 30f;
public FsmFloat MaxAirAcceleration = 20f;
public FsmFloat Gravity = 10f;
public FsmFloat MaxFallSpeed = 20f;
public FsmBool JumpingEnabled = true;
public FsmFloat BaseHeight = 1f;
public FsmFloat ExtraHeight = 4.1f;

public override void Reset()
{
owner = null;
}

public override void OnEnter ()
{
GameObject gameObject = Fsm.GetOwnerDefaultTarget(owner);
if (gameObject == null)
return;

if (gameObject != previousGameObject) {
motor = gameObject.GetComponent<CharacterMotor>();
previousGameObject = gameObject;
}

if (motor == null)
return;

CharacterMotorMovement movement = motor.movement;
CharacterMotorJumping jumping = motor.jumping;

motor.canControl = CanControl.Value;
movement.maxForwardSpeed = ForwardSpeed.Value;
movement.maxSidewaysSpeed = SidewaysSpeed.Value;
movement.maxBackwardsSpeed = BackwardsSpeed.Value;
movement.maxGroundAcceleration = MaxGroundAcceleration.Value;
movement.maxAirAcceleration = MaxAirAcceleration.Value;
movement.gravity = Gravity.Value;
movement.maxFallSpeed = MaxFallSpeed.Value;
jumping.enabled = JumpingEnabled.Value;
jumping.baseHeight = BaseHeight.Value;
jumping.extraHeight = ExtraHeight.Value;
}
}

Just look at it.  It's so beautiful.

Here is another action which exposes the variables within the Platform Input Controller:

Code: [Select]
using UnityEngine;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;

[ActionCategory(ActionCategory.Character)]
[Tooltip("Interface to PlatformInputController component")]
public class PlatformInputControllerAction : FsmStateAction {
    [RequiredField]
[CheckForComponent(typeof(PlatformInputController))]
public FsmOwnerDefault owner;

PlatformInputController controller;
GameObject previousGameObject;

public FsmBool AutoRotate = true;
public FsmFloat MaxRotationSpeed = 360f;

public override void Reset()
{
owner = null;
}

public override void OnEnter ()
{
GameObject gameObject = Fsm.GetOwnerDefaultTarget(owner);
if (gameObject == null)
return;

if (gameObject != previousGameObject) {
controller = gameObject.GetComponent<PlatformInputController>();
previousGameObject = gameObject;
}

if (controller == null)
return;

controller.autoRotate = AutoRotate.Value;
controller.maxRotationSpeed = MaxRotationSpeed.Value;
}
}

They're like a cute couple, aren't they?  They go well together, which is why I had my swell friend Martijn Zandvliet write them up for me.  (I'm a pathetic scripter, but I blame PlayMaker for it).

I hope these are as useful for you all as they have been for me.  Cheers!  :)

Pages: 1 ... 18 19 [20]