Forum rules - please read before posting.

Pass the value of an Integer Variable to a custom method using 'Object : Send Message' Action?

Hiya

I'd like to pass the value of an Integer variable to a custom Method using the Object : Send Message Action (either by selecting the variable name from a dropdown list or entering a replacement token in the 'Integer to send' field).

Is there a way to do this currently?

If not, is it something you'd consider adding?

Thanks!



Comments

  • It would also be useful to be able to pass the value of a variable (e.g. Int) to a parameter in an ActionList Asset.
  • You can - this was introduced in v1.53.  If your Message to send is set to Custom, and Pass integer to method? is checked, you'll have the option to send an integer parameter - provided you've declared on in your ActionList's properties.
  • Hi Chris, thanks for your quick response.

    I've got an ActionList asset set-up as you describe. When I run the ActionList I want to be able to pass the value of a variable into the integer parameter instead of entering a hardcoded value. 

    Is that possible?























  • If you set the parameter using the ActionList: Run Action, then you have to set the value directly.

    However, you can use the ActionList: Set parameter Action to set an individual parmeter's value by copying it from a Global Variable.

    If you're looking to pass an AC variable's value to a custom script, though - you don't need to use parameters, as you can just read the value of the variable directly in that same script:

    int myIntValue = AC.GlobalVariables.GetIntegerValue (myVariableID);

    See the front page of the scripting guide.
  • Thanks Chris. 

    Just want to say that I love Adventure Creator. It's a fantastic tool, and one of the best things I've ever bought from the Unity Asset Store. Thanks for all the hard work you do on it. 
  • No problem, @Toad!  Asset Store reviews are more than welcome.
  • I've already given a 5 star review.  :0)
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.