playMaker

Author Topic: talking to a script?  (Read 998 times)

Buster

  • Playmaker Newbie
  • *
  • Posts: 6
talking to a script?
« on: October 17, 2022, 05:22:45 AM »
OK, I'm using a script on an object that has a couple of different variables that I want to be able to communicate with.

if in the script it says say  "public float XYZ" and I want to add 25 to the float on trigger, which action am I looking for. I thought it was send message but.. yeah thats not what I thought it was. I know how to handle the trigger event all in playmaker but not how to do it in conjunction with the script.


**** bonus question. if I want this "boost" to be temporary do I just toss a -wait- in there then add -25 or is there a more efficient way to do it?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: talking to a script?
« Reply #1 on: October 17, 2022, 06:15:13 AM »
Hi.
You can use Get/Set Properties action, but for mobile you will probably need to use Linker Wizard then.

The best way would be making a custom action script for it.


Buster

  • Playmaker Newbie
  • *
  • Posts: 6
Re: talking to a script?
« Reply #2 on: October 17, 2022, 07:01:07 AM »
Ok thanks for pointing out that action :) I played with it and easy to get working but I can only set a specific value? No way to add to it?

The script is used on 8 different chars each starting with a different value (same variable.) So to apply the power-up Id have to turn duplicate objects on/off depending on which char is in the scene. I figure that would take a horrible hit on performance.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: talking to a script?
« Reply #3 on: October 17, 2022, 07:06:24 AM »
Hi.
Look for example to the Int Add or Float Add Action or Float Operator.

in code you can set for example :

variableA = variableA + AddedAmount.Value

or a shorter way

variableA += AddedAmount.Value


If you 'Add' -25 , it will subtract 25

Buster

  • Playmaker Newbie
  • *
  • Posts: 6
Re: talking to a script?
« Reply #4 on: October 17, 2022, 07:38:04 AM »
your a great help as always :)