playMaker

Author Topic: need help  (Read 4970 times)

Roninfang

  • Playmaker Newbie
  • *
  • Posts: 32
need help
« on: August 08, 2015, 06:07:33 PM »
i know get mouse down state basically makes an event
happen when a button is pressed...but
what if i want something to happen when two buttons is pressed
at the same time?

like i want this event to happen if lets say left mouse click and shift
is pressed at the same time

also


its a tutorial for random wandering but what if i specified path i want it to follow
« Last Edit: August 08, 2015, 06:09:49 PM by Roninfang »

crem2002

  • Playmaker Newbie
  • *
  • Posts: 14
Re: need help
« Reply #1 on: August 09, 2015, 02:39:43 AM »
You can use bool all true to check that two or buttons are down and I tween move to action lets you set a path

Roninfang

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need help
« Reply #2 on: August 09, 2015, 04:01:26 PM »
i think i got the idea a bit


so ive made a fsm when i press it once

like point click controls

it sets the bolean value to true

now how to make sure as soon as the fsm is done it sets it back to false


also how do i basically make an fsm cycle back to start when example

a certain key is not active/not pressed is brings the fsm back to the start


----------

also noticed for fsm i could only add one button event
how do i well make one fsm check if two buttons are pressed at the same time hmmm i can only seem to have one on get key down,on mouse down etc on one state
-------------

if i make a global variable in one fsm? i can still access it in other fsm's right?
« Last Edit: August 09, 2015, 04:24:25 PM by Roninfang »

strange_aeons

  • Junior Playmaker
  • **
  • Posts: 62
Re: need help
« Reply #3 on: August 09, 2015, 05:48:58 PM »
i presume that you would use the Get Mouse Button Up action, thats when you let go of the to reset the bool value, have it in the same state as the Get Mouse Button Down so that way it waits for either action to occur (press button or release button).

i dont know if this is a stupid way to do it, but heres how i would do the checking if other button is pressed... create another separate FMS to check when the Shift key is being pressed and store it in a bool variable. now in the original FSM, when this button is pressed use Get FSM Bool and Bool Test. if Bool Test result is 0 then make a an even that returns it to the start or do what it normally does when the other button isnt pressed.

Roninfang

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need help
« Reply #4 on: August 10, 2015, 01:16:39 AM »
hmmm thats the thing i tried placing two action sequence into one fsm state

but doesnt seem to work since the fsm state seem to read only the first one

....

so i tried to place two fsm...one for mouse press left and one for shift press...so that when i press either mouse or shift it will check if both are pressed...but it only seem to read the one attached on the start...the 2nd fsm state the one witht he press on get keydown - shift...it isnt reading it

....

so thinking i might have to place 2 playmaker script into 1 gameobject/character
and make the boolean a global value so that i can access it in both playmaker script

strange_aeons

  • Junior Playmaker
  • **
  • Posts: 62
Re: need help
« Reply #5 on: August 10, 2015, 01:25:46 AM »
that global variable plan sounds like it should work out, i know i will have to setup something like this press soon so i hope it works out.

Roninfang

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need help
« Reply #6 on: August 10, 2015, 01:28:57 AM »
now how about making AI follow a specific path? the tutorial kinda explains making AI go on a random path...but what if i want AI to follow specific path

Roninfang

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need help
« Reply #7 on: August 10, 2015, 01:32:21 AM »
"have it in the same state as the Get Mouse Button Down so that way it waits for either action to occur (press button or release button)."

tried it but doesnt seem to work, the playmaker only reads the first get mouse action sequence....

hmmmm



strange_aeons

  • Junior Playmaker
  • **
  • Posts: 62
Re: need help
« Reply #8 on: August 10, 2015, 02:09:34 AM »
ok i must have assumed it would work like the Trigger actions, sorry about that!

Roninfang

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need help
« Reply #9 on: August 10, 2015, 04:29:00 AM »
basically about the 2 button thing...i want basically playmaker to lets say to make this object move to the area clicked IF player press left mouse click AND shift at the same time

Roninfang

  • Playmaker Newbie
  • *
  • Posts: 32
Re: need help
« Reply #10 on: August 10, 2015, 08:13:09 AM »
wanted to ask

1. how do i access variables from other fsm?

example on mouse click on this fsm

i want to change int value of a variable but its located on another fsm which is attached to a different game object

example:

on scene one i have 2 buttons and maybe 1 text field

now the value of the text field i want it to depend on what button was pressed...

2. also why i wanted to ask about this is lets say i have 2 fsm on a game object

on mouse down which should change a global variable boolean to true

and another fsm

on get key down shift
which also should chnage global variable boolean to true

what if the Boolean Variable is on another i want to be changed

so basically wanted to know how do i access/change/get values from another fsm which is located in a different game object and different fsm?

3. is it possible for fsm to make text field display int value of a variable

example for rpg like games i want to show player stats of player, enemies well you get the idea

4. how do i make well stage reset back to level 1 and back to default stats of a character everytime a stage resets again...lets say i want to make something like an MOBA/RTS style game...so obviously when a new game starts the stats of the characters etc have to reset back to level 1...so at for now whats a general idea on how to go about this?

5. ive noticed some tutorials theyre able to have more than one transition in one state
for some strange reason i cant seem to get mine workign so tried testing for now at least having 2 transitions in one state...

for example one on get keydown A , do this

and another one of get keydown B do this...but it only seem to read the first transition only...everything else after that doesnt seem to work

strange_aeons

  • Junior Playmaker
  • **
  • Posts: 62
Re: need help
« Reply #11 on: August 10, 2015, 08:33:26 AM »
1. first example... use "Get FMS Int" and you will need to have a int to store that into, if you want to return the variable altered, use "Set FSM Int"

second example right so both buttons will send some thing to the text field, you can use "Set Property" or you can use "U Gui Text Set Text"

2. you can use "Get FSM Bool" to grab the bool from a fsm on any object, you need to indicate the object, then you need to specify the targeted fsm and then you need specify the actual variable that you are getting and also you need to have a bool variable to store that variable which you just grabbed from the other fsm. if and when you need to return the bool back to where it came from, you can use "Set FSM Bool" yeah.

3. yeah its possible, but you need to convert it to a string first, so you can use "Convert Int to String" before you can put it in the text field.
« Last Edit: August 10, 2015, 08:44:08 AM by strange_aeons »