Forum rules - please read before posting.

adv programming like Switch, object methods etc

aloha - long time coder new to AC, attempting to help a friend with their game.

Is there an ActionList method akin to the 'switch' statement (eg. check value of one variable and offer multiple 'case' actions for different values - if then else else else)?
Current code has 55 different actions depending on value of an ID variable.  The current actionList requires 55 check/branch item pairs.

Is there any regular expression magic to select an asset to invoke (eg  Card_1, Card_2...)?

Is there a way to create a Container object that could hold other GameObjects (or ID) that can be saved & reloaded?

I suppose I could dive deep and create C# scripts but this was supposed to be a quick job.

Comments

  • Welcome to the forum, @jerrisdale.

    This is possible with the Variable: Pop Up switch Action - though only if the Variable in question is of type PopUp.  It allows, as you describe, to reroute to different Actions depending on the selected Variable's current value.

    If you want to create your own Action, it's very simple for long-time coders.  See this tutorial on creating new Actions, though Actions with multiple output sockets derive from ActionCheckMultiple, not Action as in the tutorial.  If you want to make a change to the existing switch Action, it's probably easier to duplicate it, set up new class variables for it, and tweak as required.
  • Thanks Chris.  Popup Variables look like it should do the trick for this... select 1 of N actions based on value set.

    Fitting a game concept to available features of a new language/system is an interesting exercise.  I know how I'd do the logic if I had a full ObjectOrientedProgramming(OOP) system, but Unity/AC only exposes so much of that functionality.  I am liking the Action engine technique for building scripts.

  • AC's Actions generally work by invoking functions in other scripts that do the actual work, meaning interactions can also be written in full C# scripts, see this tutorial.

    Obviously being a coder myself, I appreciate how it can be a bit backwards sometimes to try to fit a game concept into an existing toolset, but AC's strength is that it's geared completely towards non-combat adventure games, meaning it's able to make certain assumptions about games being able to made with it in order to streamline the development process.
  • I appreciate the design trade-offs and the ability to expand functionality into C# scripts.
    I'll start another topic thread to explore some of the design trades for my project.
    Mahalo for your help.

    (Mahalo = thank you in Hawaiian.  I live on Maui)
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.