playMaker

Author Topic: How do you change a PM variable from c#? [SOLVED]  (Read 2292 times)

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
How do you change a PM variable from c#? [SOLVED]
« on: February 15, 2016, 09:19:56 AM »
I know this has probably been asked before but I can't find a answer.  I am writing a game that uses some c#, javascript and playmaker.  I want the variables to be in playmaker, so was wondering if you could change a playmaker global variable from c#.

The other option is just to make all variables in c# script and access then from playmaker.  I can do this as well, but am trying to move more towards playmaker for everything.
« Last Edit: February 18, 2016, 02:34:14 PM by Alex Chouls »

basuki

  • Playmaker Newbie
  • *
  • Posts: 4
Re: How do you change a PM variable from c#?
« Reply #1 on: February 15, 2016, 12:38:10 PM »
Make it global?

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: How do you change a PM variable from c#?
« Reply #2 on: February 16, 2016, 11:53:01 AM »
but how???

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do you change a PM variable from c#?
« Reply #3 on: February 16, 2016, 11:59:55 AM »
There is an API Reference here. Examples are also provided here.

There is a lot of useful information on the Wiki.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
Re: How do you change a PM variable from c#?
« Reply #4 on: February 18, 2016, 11:13:30 AM »
Thanks

ergin

  • Junior Playmaker
  • **
  • Posts: 86
Re: How do you change a PM variable from c#? [SOLVED]
« Reply #5 on: February 18, 2016, 03:41:51 PM »
although solved,
you must add(include) :
using HutongGames.Playmaker;

and use this code:
FsmVariables.GlobalVariables.GetFsmString("nameoftheglobalfsmstring").Value = yourvalue;

you should use GetFsmString for strings GetFsmInt for ints and so on...