playMaker

Author Topic: How do I access a playmaker itween action from a script?  (Read 2202 times)

Achexi

  • Playmaker Newbie
  • *
  • Posts: 4
How do I access a playmaker itween action from a script?
« on: October 13, 2014, 09:57:18 AM »
I have a playmaker action that tweens an object around a map. I now need to pause that particular action whenever it goes outside a certain distance. I can't seem to find what I need to reference in order to pause it.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do I access a playmaker itween action from a script?
« Reply #1 on: October 13, 2014, 10:05:32 AM »
Usually just leaving the state is sufficient. If you can't then I usually manage a variable that is a multiplier for the speed or something and set it to zero when I want the action depending on it to stop.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Achexi

  • Playmaker Newbie
  • *
  • Posts: 4
Re: How do I access a playmaker itween action from a script?
« Reply #2 on: October 13, 2014, 10:27:30 AM »
I'm sorry I think I worded it badly. I understand the techniques required to pause an itween, but I never used playmaker with itween before and as such I'ld like to write an external script that calculates the distances between 2 objects and pauses an object appropriately based on it.

So Assuming the play maker action is constantly running at this time what I'm trying to ask is, is there a command like e.g. fsm.state.action.itweenmoveto7.speed = 0? or is there a way i can do itween.pause(fsm.state.action.itweenmoveto7) or if i set the itween speed to a global variable, can i change the global variable through script and if so what do i need to do in order to reference it?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do I access a playmaker itween action from a script?
« Reply #3 on: October 13, 2014, 10:40:28 AM »
I don't think you can specifically target an action like that (might be wrong) but you can target the variables which is the normal approach. So if you set speed to a variable then you can access it normally, here's the wiki example for that.

https://hutonggames.fogbugz.com/default.asp?W329
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Achexi

  • Playmaker Newbie
  • *
  • Posts: 4
Re: How do I access a playmaker itween action from a script?
« Reply #4 on: October 13, 2014, 10:53:36 AM »
I believe that's exactly what I was looking for. Thanks for the speedy reply!

Achexi

  • Playmaker Newbie
  • *
  • Posts: 4
Re: How do I access a playmaker itween action from a script?
« Reply #5 on: October 13, 2014, 11:16:59 AM »
Alright, it is what I'm looking for but just asking incase it will save me googling. It seems Itween sets a speed when its instantiated. So setting its speed equal to a fsmvariable and adjusting the fsmvariables speed at runtime does not seem to change the itweens speed. What can I do to fix this?