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

Pages: 1 ... 3 4 [5]
61
PlayMaker Help / Rolling a Ball [solved]
« on: July 10, 2011, 12:41:26 PM »
Bah.  I need help again.

I am rolling a ball in my game.  The player is a normal, bipedal character controlled through the PlatformInputController and CharacterMotor scripts.  The player needs to "push" the ball in front of them.

For the ball I am using a sphere with a really high Drag value (so it stops immediately), and applying forces to the ball.  My problem is that I can't get the vector right.  Since this is a rolling object axes are prone to rotation, so local coordinates aren't reliable for applying a force.  What I would like to do is simply apply a force relative to the games camera, however I cant figure out the combination of transforms and calculations in order to get that vector, transform it to world-space, and apply it to my sphere.

As always, help is MUCH appreciated!


62
Feature Requests / State Action Options and Convenience Requests
« on: July 10, 2011, 11:56:19 AM »
Hello PlayMakers.  I wrote up a list of some things I'd really like to see in PlayMaker:

Color-coding for State Actions
- This would let me assign a basic color to each action within a state, for ease of access and identification at a glance
Drag and drop Action rearrangement
- I'd love to just grab the header of an action and drag it to where I want it ordered within the state.  Similar to rearranging assets in the hierarchy view.
Collapsible State Graphs
- I'd like to draw a box around some of my more complex state networks, and then collapse them for better organization.  See WorldMachine2 or Virtools Dev for an example of what I'm talking about.  Bonus if it's color coded too!
Individual State Action Renaming/Labeling
- Similar to color-coding the actions, I wish I could double click the header of my, say, "Get Position" Action in a state, and rename it to whatever I want.  "Get Player Pos" or something.  Better organization, info at a glance.  Of course the original Action name can be displayed on mouse-over or something.
Copy and paste individual Actions within an existing State while retaining their variables.
I always find myself reusing individual actions, sometimes in the same state.  I'd love to highlight an action (click on its header or something), and CTRL-C/CTRL-V that sumnabitch elsewhere in that state or another one in the same FSM.
Add the third Spacially relative option of 'Parent'
This is a feature request for any Action that has the variable of "Space" for spacial relativity.  (Get/Set Position, etc).  I'd love a "Parent" option within the space drop-down, so the action knew it perform its function in the space of whatever parent the object was beneath.  BIG help there.

That's all.  I hope some of these are doable.  Keep up the awesome work!

63
PlayMaker Help / Tag Inheritance
« on: July 08, 2011, 04:21:30 PM »
Simple question: do child objects inherit the tag of their parent? 

My game features snow.  The player walks through it, and the snow drifts disappear (scale down, spawn fx, etc). 

I have a large object parented to the player which is about 8 meters in front of it.  It has no FSM, and is tagged as something other than "Player".

There is an FSM on the player which waits for an OnTriggerEnter event with the snowdrifts tag, and then triggers a state where the contacted snowdrift performs it's actions.

Now, when I walk into a field of snowdrifts, they will begin to disappear when this large object touches them. 

If there is no unknown tag-relative hierarchy in Unity, I think this may be a bug.  Can anyone help me with this?

64
PlayMaker Help / Buffered States
« on: July 08, 2011, 01:29:38 PM »
Another allegedly simple question from moi:

I have an FSM with a branching states, which leads to two child-states, which in turn return to the original when they're complete. 

Child-stateA is triggered by holding a key and walking through a trigger.

Child-stateB is triggered by only holding the same key (and not moving).

I will trigger child-stateA by holding the key down and moving through the trigger.  I will release the key at this time and persist in this state for several seconds.  Then I will hit another key to exit from child-StateA and return to the parent state.  As soon as I do this, the FSM goes through the parent state and immediately jumps to child-StateB, as though I had been holding the key the whole time.

It appears as though it's buffering my actions, which is unexpected.

It's worth mentioning that I use "key" as a general term.  I'm using joystick buttons at this time.

Any ideas?

65
PlayMaker Help / Action Malfunction [solved]
« on: July 07, 2011, 07:24:44 PM »
I'm having a hard time figuring this issue out.  

I have an object in my scene that tracks the player.  It has two states: moveToPlayer, and atPlayer.  It is designed to move toward the player when over a specified distance away, and when it's within the specified distance it waits.  When the player moves out of range it returns to it's moveToPlayer state and tracks it until its within range again.

The issue seems to be that it just decides to stop using the Move Towards action randomly.  I have no idea why this is, but at some point it will be in the moveToPlayer state, and the Move Towards action will grey out, and while the debug info clearly notes that it's out of range from the player (and should be moving toward it in this state), it no longer moves.

Here is an image of the two states along with their specified actions:


You will notice that the Target Object in both states is set to a gameobject variable known as "activePlayer".  My first thought was that this variable was being changed to something else, but this is not the case, (which means don't look there, it's not the answer).

The only other hypothesis I have is this: I set the speed at which the tracking object travels to the target object via a distance variable.  I believe it's possible that at some point the target object will be at a distance of 0 to the player, and thus set the Max Speed variable of the Move Towards action becomes 0.  The issue with this is that I have NO IDEA why this would "shut off" the action itself.

EDIT: I just tested this theory, it was not correct.  The action "shuts off" when the target object is well away from the tracking object.  Oh well!

Any help is much appreciated!  Thanks in advance.


66
PlayMaker Bug Reporting / Undo causes stuck FSM [FIXED]
« on: July 06, 2011, 01:11:17 PM »
Subject line is probably not the best description, but here's how to reproduce:

Select an object without an FSM.
In the FSM editor window, right click and select "Add FSM Component"
Hit CTRL-Z (or your OS's undo shortcut).

Notice the component is removed from the object in the inspector, but the FSM and initial state is still displayed in the FSM Editor window.  Right clicking in the FSM Editor window and selecting "Remove FSM Component" does not cause the initial FSM graph to disappear.  FSM still displays when deselecting and reselecting the object.

I was unable to find a way to fix the FSM Editor window from reporting an FSM on the object in question.

67
PlayMaker Help / Trigger Events on other Gameobjects
« on: July 06, 2011, 12:40:01 PM »
Hey all, I have a project where I'm controlling a character from the third person.  Some mechanics I integrated to the game ended up requiring me to deactivate my character at some points in order to work in the manner I want it to.

Currently I have my player control FSM attached to the player object, so I can't deactivate it without wierdness.  My solution for this is to move the player control FSM to another game object, so I can safely deactivate and reactivate the player when needed.  

The issue I have now is that the Trigger Event action, which I use frequently, is only set up to monitor the trigger events for the object it's currently on, and the object I created as a "system player manager" is just an empty game object used for holding the control FSMs for the game.  

Is there any way to create a Trigger Event Action for PlayMaker that can target another gameobject, so I can simply point it at the player object that has the rigidbody, and which interacts with triggers?  

Thanks for any help!

--

Additional thoughts - I considered leaving the Trigger Events on the player object and having them flip a bool on my player control object.  Then I'd bool test on the player control object every frame to see when the player triggered an event.  I was concerned this might not be efficient though, so if anyone can speak to that it might help a help.  If it's not going to be a perf hit of any kind I could go that route and problem solved!

68
PlayMaker Help / Cut to Camera does not allow Variable assignment?
« on: June 21, 2011, 04:21:13 PM »
Just a quick question: Why does the "Cut To Camera" action not allow variable assignment?  A limit of Unity? 

Alex: May I PM you when I have a simple question like this?  Couldn't find any mention of why in the forums, etc.

Thanks.

69
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!

70
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!

71
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!

72
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!

73
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 ... 3 4 [5]