playMaker

Author Topic: Im Making A Game - Help Needed!  (Read 6206 times)

bharatnag

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Im Making A Game - Help Needed!
« on: April 17, 2015, 05:22:26 AM »
01 - CAMERA ZONES

Hi all, I carry an art background and am making a small game on my own. Its a 2D side scrolling game and Im stuck with making camera position zones.

Below is my current system and Im very new to programming.

So the game level is designed floor wise and each floor has trigger volumes that decide the CAMERA Y POSITION. The Camera X position comes from the current player X position (Camera Follow in X axis). The Z position is predefined. So I need a manager that SMOOTHLY moves the camera in the Y AXIS based on some trigger volumes.

Now ill explain my FSMs.

Firstly Im taking Trigger events from the collision volumes and sending global events.The image below is pretty self explainatory.


Then, at the main FSM, based on the event recieved by one of the trigger volumes, Im using itweenMoveTo to SMOOTHLY move the camera to its new position.


Now the problem is coming when im at the transition level of two collision volumes.
Becaus iTweenMoveTo will take some time to move the camera, it wont go back to the listener to check another trigger event. This is causing bugs when my character is jumping between two triggers at the transition level.

Could you guys please suggest me a better way do achieving this? Or correct me on my usage of states.

Thanks.

bharatnag

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Im Making A Game - Help Needed!
« Reply #1 on: April 17, 2015, 03:42:35 PM »
Im trying a second approach which takes in account the player Y position rather than use triggers.
BUT THIS TIME IM GETTING SOME FUNKY BUGS
Im attaching two images below:
01 - the FSM gets disabled when there is a FINISHED transition on the NEXT STATE
02 - the State wont goto the next state after all the actions are done

I know i messed up somewhere so please help.





Flying Robot

  • Sr. Member
  • ****
  • Posts: 293
  • Od ton yebo redro
    • View Profile
    • Flying Robot Studios
Re: Im Making A Game - Help Needed!
« Reply #2 on: April 17, 2015, 10:22:08 PM »
Hello there,

I think your can stick to your first procedure, making trigger zones aka colliders. When the player will touches another collider of another floor do not itween in the same FSM, send an event to a second FSM which will take care of the itween.

This way, in the first FSM which only handles the triggering won't interfere with the moving of the camera.

Hope this helps. Feel free to ask more questions.

bharatnag

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Im Making A Game - Help Needed!
« Reply #3 on: April 18, 2015, 02:38:50 AM »
I think your can stick to your first procedure, making trigger zones aka colliders. When the player will touches another collider of another floor do not itween in the same FSM, send an event to a second FSM which will take care of the itween.

Ya I already did that but I don't think this does the job any better. No mater where the iTween is it will still require an event to trigger it.
Say for example FSM01 sends an event, FSM02 recieves the event in STATE01 and moves to STATE02 for the tween. And say for example the tween is 2 seconds long.
So the FSM02 wont come back to STATE01 to receive another event for these 2 seconds. Which means it wont detect any trigger event for these 2 seconds.



I was thinking is there is a second method to tween something which starts a tween and changes state (not hangs on for the tween to finish in a state).

Or is there any way to break the tween in between based on an input.

bharatnag

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Im Making A Game - Help Needed!
« Reply #4 on: April 18, 2015, 03:02:57 AM »
If my state has just getPosition, it wont just goto the next state. how do i tell it to take positions and move to the next state?

Flying Robot

  • Sr. Member
  • ****
  • Posts: 293
  • Od ton yebo redro
    • View Profile
    • Flying Robot Studios
Re: Im Making A Game - Help Needed!
« Reply #5 on: April 18, 2015, 05:48:40 AM »
I think you are little confused with those state transitions. Remember, you don't have to complete itween and come back after visiting another state.

You can call actions like itween move to over and over again when triggered.

Take a look at the attached scene.

bharatnag

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Im Making A Game - Help Needed!
« Reply #6 on: April 18, 2015, 06:11:31 AM »
I think you are little confused with those state transitions. Remember, you don't have to complete itween and come back after visiting another state.

You can call actions like itween move to over and over again when triggered.

Take a look at the attached scene.

Yes this makes sense. Thanks a lot for that. Ill try rebuilding my system and post doubts if any.
Thanks again

bharatnag

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Im Making A Game - Help Needed!
« Reply #7 on: April 22, 2015, 10:09:08 AM »
Im using playmaker to tweek ferr2D https://www.assetstore.unity3d.com/en/#!/content/11653
vertex colors but i dnt know its not reflecting in the game view. The inspector is showing the color changes though. Can someone help me here?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15060
  • Official Playmaker Support
    • View Profile
Re: Im Making A Game - Help Needed!
« Reply #8 on: April 22, 2015, 11:11:58 AM »
Hi,

 you should contact the author to first make sure of what needs to be done and it what order for vertices to have their color changed, maybe there is a "Refresh" call somewhere, somehow that is missing.

 Bye,

 Jean

bharatnag

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Im Making A Game - Help Needed!
« Reply #9 on: April 29, 2015, 11:46:00 AM »
Hi. So Im stuck with a little problem again.
There is a variable that is changing its value for some time in one fsm.
I need the same changing variable to be accessed by another fsm on another object. So Im doing a simple GetFSMFloat on the other object and the system works just fine. Now I need to make multiple copies of the system. So I make a prefab and when i duplicate everything works accept for that getFSMVariable. I suppose i need to specify the cloned fsm holders in the getFSMVariable. But is there a way to make a system and then replicate wherever you want to.