playMaker

Author Topic: Bitmask operations? [SOLVED]  (Read 2688 times)

pneill

  • Playmaker Newbie
  • *
  • Posts: 32
Bitmask operations? [SOLVED]
« on: April 01, 2012, 03:20:57 PM »
I'm using the new navmesh actions and I need to do a bitmask operation to determine if a sampled position contains a certain navmesh layer.

So I'm trying to do a bitmask operation.

At first I tried writing a custom action, but when I tried to do the bitmask operation on the FsmInt variables, I got the error message - "Operator '&' cannot be used with a left hand side of type 'HutongGames.PlayMaker.FsmInt' and a right hand side of type 'HutongGames.PlayMaker.FsmInt'.

Alternatively, I tried to do this operation in an external script, but I then got the following error message - "The best overload for the method 'wayPointFunctions.isBitPresentInMask(int, int)' is not compatible with the argument list '(HutongGames.PlayMaker.FsmInt, HutongGames.PlayMaker.FsmInt)'.

Is there a recommended approach for handling bitmasks?

Thanks!


 
« Last Edit: April 05, 2012, 08:17:10 PM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Bitmask operations?
« Reply #1 on: April 01, 2012, 10:31:14 PM »
Use the Value property to get/set the int wrapped by FsmInt.

E.g. lives.Value = 3;

pneill

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Bitmask operations? [Solved]
« Reply #2 on: April 04, 2012, 10:51:47 PM »
Doh!

Worked like a charm.  Thanks!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Bitmask operations? [SOLVED]
« Reply #3 on: April 05, 2012, 08:18:02 PM »
Cool! Perhaps you'll share the custom action on the forums...?  :)