playMaker

Author Topic: Stop Blink  (Read 3577 times)

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
    • View Profile
Stop Blink
« on: January 09, 2013, 04:54:08 AM »
Hello,

I have been following the tutorial at 3D Buzz http://www.3dbuzz.com/vbforum/sv_showvideo.php?v=3616 and in the tutorial it adds a feature where the player would blink and slide into screen when the player is destroyed by an asteroid.

I was able to successfully manage the blink and slide over time and all that what I can't do however is stop the object from blinking, how do I stop an action or stop the blinking after a certain amount of time.

Thank you very much
 

KozTheBoss

  • Full Member
  • ***
  • Posts: 150
  • You dont fail unless you give up trying to succeed
    • View Profile
    • Pixel Life - portfolio
Re: Stop Blink
« Reply #1 on: January 09, 2013, 08:30:15 AM »
can you tell me about the setup for the blinking action? did you put it in a state by itself? what other actions are in that state, and what action are you using for blinking?
Remember, you don't fail unless you give up trying to succeed!

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • View Profile
    • Rage Quit Games - Coming Soon
Re: Stop Blink
« Reply #2 on: January 09, 2013, 09:01:00 AM »
I've been messing with Blink recently and what i've found effective is to put a Wait action in the State and simply time it correctly so that your game object is either visible or invisible when the Wait action moves to the next State.

I hope this makes sense, if not let me know :)

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
    • View Profile
Re: Stop Blink
« Reply #3 on: January 11, 2013, 04:25:32 AM »
Thank you very much for the replies, it seems I don't get any e-mails when the reply is created for some reason that is why I didn't reply for so long, I am sorry about this. Seems I have to subscribe to the thread manually.

@Mr.Mitch, I tried your solution it did work, the problem however with this solution that the state is locked to where the Blink action is, in which case I can't fire while I Blink. I want that the player would be able to still fire his weapon while blinking (like old arcade games) and get some score.

@ KozTheBoss:

It isn't alone in the state. The state is used to reset the player (which will be hit by an asteroid and trigger this  state).
The state has the following:

1- Set Visibility and that would be to make it invisible to emulate death and reset once the action is done so that the player would be visible when it resets
2- Get Position of the player before death.
3- Create explosion prefab in the position I just saved a second ago.
4- Set the position of the player outside the screen (bottom of the screen but not visible).
5- iTween motion to move to a position (center of screen so that the player would play again after the death).
6- Blink so that the player would keep blinking while this motion is active (and would like to keep this action active for at least 4 seconds to make the player invincible and able to shoot like the video).

The problem is here when the player blinks he can't shoot for some reason and the blinking never stops.

I thought of creating a state for this with Set Visible then wait 0.1 second then Set Visible again and another wait for 0.1 second for a total of 4 seconds so that I would emulate blink but this is incredibly counter intuitive.

I hope the above helps in anyway.
« Last Edit: January 12, 2013, 03:06:35 AM by Vallar »

MrMitch

  • Full Member
  • ***
  • Posts: 131
    • View Profile
    • Rage Quit Games - Coming Soon
Re: Stop Blink
« Reply #4 on: January 12, 2013, 05:24:11 AM »
The only thing i can think of without asking to see your project as i've no idea how everything is set up is that you use Send Event to activate the blinking which could be contained on a different FSM.

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
    • View Profile
Re: Stop Blink
« Reply #5 on: January 12, 2013, 06:28:01 AM »
I don't mind sending you the project at all. Though what I can see is that once the blinking starts it locks it to the State that has the action in it and then it doesn't move out of that state until the Wait action you suggested finishes.

I believe however, I would have to restructure the whole thing so that the FSM that has the firing wouldn't be the same FSM that has the blinking (which is the case now as I was following the video).

As for the project here is the link to download it:

http://www.4shared.com/rar/GOgYz19L/Test2D.html

Alio

  • Playmaker Newbie
  • *
  • Posts: 19
    • View Profile
Re: Stop Blink
« Reply #6 on: January 14, 2013, 03:12:42 PM »
Yeah you whould more than likely have to put them in sperate states this way your blinking does't loop and interfear with your firing ability.  just set to where in x state of death firing is inactive.  Create global inactive ---> listen/idle and active ---> play input = fire.  While dead before player spawn back to location = inactive fire, once blinking til dead again = active fire state.  apply Get FSM states to correct states.  should have seperate fsm for movement, blink, spawn, fire. makes for more work but in the end less conflict thats what i believe.
I just frankenstein it.

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
    • View Profile
Re: Stop Blink
« Reply #7 on: January 15, 2013, 12:38:09 AM »
Definitely a good point Alio, just the first time without guidancevthat is why I did it this way. I believe not used to doing "OOP" in Playmaker :p.

Thanks, I will definitely get around to that.