Forum rules - please read before posting.

[Custom Action] Variables: MultiBoolCheck

Hi,

after not coding in C# for at least 10 years I sat myself down yesterday to code my first custom action. I call it "MultiBoolCheck" and it is used to check a unlimited number of global boolean variables if they meet given conditions. I need this to clean up my action lists if there are to many variable state checks.

Or simply said, it can turn this:
image
into this:
image

The Action is based on the "Variable: Check" Action. It only works with global boolean variables and does not support ActionList parameters. Maybe someone else has a use for it.

Comments

  • Oops. I wanted to post the code here but it tells me "Body is 82371 characters too long.". Any ideas how to share the code?
  • I made up a wiki page for this.
  • Thanks for posting!  The page can be found here.
  • Thank you! :)
  • This is very useful indeed! Thank's :)
  • edited August 2018
    @MAC

    This does not work for me in Unity 2018.2
    I put the MultiBoolCheck.cs where the AC scripts are and nothing ...
    Anything changed in scripting for 2018 this file ?
  • Custom Actions must be correctly installed following the guidelines outlined in the Manual's "Custom Actions" chapter as well as this tutorial.
  • 1. "If it is, choose to another platform, such as PC, Mac & Linux Standalone temporarily." checked
    2. "Within the Custom Action scripts panel, click Set directory." checked

    I do not think it is something I did wrong. What else should I check ?
  • I found the problem: I put the cs file in the Actionlist folder instead of Actions. And this is why it was not finding my new Action :)
  • This is such an amazing script...I've used it a lot in my game, which has several puzzle pieces that need to be positioned correctly over markers.  It's a great way to check if all the pieces are in the right spot.

    Can anyone help me modify this script to check Integer variables instead of Boolean variables? (I know just enough C# to get me into trouble!)
  • @sonicjoy: This won't do it completely, but you'll have a good start by renaming all instances of MultiBool to MultiInt, BoolValue to int, and boolValue to intValue (all case-sensitive).

    From there, it should mostly be a case of correcting errors that then appear in the Console.
  • Thanks Chris! I'll give it a go.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.