playMaker

Author Topic: How to set a global bool in a script?  (Read 3432 times)

Rmbt

  • Playmaker Newbie
  • *
  • Posts: 2
How to set a global bool in a script?
« on: April 18, 2015, 12:08:06 PM »
This seems to be one of the most basic questions you can come up with. And eventhough I've build a bunch of things for games with playmaker I can't seem to find what I am looking for.

The situation:
I'm using the Corgi Engine (Asset Store) in a game. I want to flip a global bool in one of those scripts (CharacterBehavior.cs -> Player.Permissions.JumpEnabled)

Send Message, or a bunch of other things I've tried don't seem to do the trick. What am I missing?

Thanks!

VascBogdan

  • Full Member
  • ***
  • Posts: 118
Re: How to set a global bool in a script?
« Reply #1 on: April 18, 2015, 04:21:24 PM »
I don't know pretty much about this Corgi Engine you are talking about, but this MAY be a solution:
Create an empty game object. In a PlayMaker FSM activate the game object when the boolean value is true, and deactivate it when it's false. If there is a way, with your Corgi Engine check if that empty game object is activated or deactivated, and set the result as a value (again I said I don't know about that Corgi you are talking about, but this may help in some way).

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How to set a global bool in a script?
« Reply #2 on: April 18, 2015, 04:28:20 PM »
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Rmbt

  • Playmaker Newbie
  • *
  • Posts: 2
Re: How to set a global bool in a script?
« Reply #3 on: April 19, 2015, 12:03:13 PM »
Thanks for the reply guys!
I can't seem to be able to use set property as the public booleans I'm looking for don't show in the Property Dropdown. It seems that script is used/triggered as a sub script by another script. Maybe that prevents me from accessing it right away!? (See screenshot)

Is there a way to directly set a boolean value in a script with PlayMaker? Something like Player.Permissions.DashEnabled=true ?

Thanks!!

IEP

  • Playmaker Newbie
  • *
  • Posts: 9
  • Computer Arts
Re: How to set a global bool in a script?
« Reply #4 on: April 19, 2015, 02:33:14 PM »
I don't think you can change these kind of hidden vars directly ... but you can edit the script and make it a usual-normal bool var in the way you can get it's properties.

But if you can't change the var in the corgi script ... then why you shouldn't simply use the unity character controller script and change it in PlayMaker anyway you want?
« Last Edit: April 19, 2015, 02:34:53 PM by IEP »