Jump to content

riseabovethestorm

Member
  • Content Count

    1
  • Joined

  • Last visited

  • Medals

Posts posted by riseabovethestorm


  1. Okay, so this is something that I'm sure has been addressed in little bits and pieces but never as a whole.

    I've recently got into creating missions and have been slowly learning the ins-and-outs of scripting, but with my lust for knowledge, I can't seem to find the answer fast enough (P.S., please don't tell me to "Use the Search Function," because I have, along with searching off-BIS sites through Google-Fu and still haven't been able to find the answers that I seek. If the answer as a whole is there to begin with, please feel free to link it.)

    So an explanation of what I would like to do:

    I have been making missions lately, and have been using triggers to fire off individual pieces of sideChat dialogue. This obviously makes for a very messy folder for the mission if there is a lot of dialogue, so I have been looking to consolidate the different dialogues down into a single file (if such a thing is even possible,) and fire them off conditionally. I'm very familiar with PHP (which uses a fairly similar syntax,) so I will attempt to illustrate what I want to do:

    if($condition1 == true) {
    echo "message 1";
    }
    elseif($condition2 == true) {
    echo "message 2";
    } else {
    null;
    }

    Now as I read it, the conditional calls for ArmA 2 are (or people seem to think they are,) pretty clearly defined.

    My follow-up is where do I declare the variables to fire off the different messages based off of conditions?

    I ask all of this as if I am sure that it's possible, although with the power of the scripting engine I don't see why it wouldn't.

    ---------- Post added at 02:08 ---------- Previous post was at 01:58 ----------

    I suppose that I should have given a more ArmA 2 specific example, because I'm a putz and didn't think that one through.

    Basically I would like to have a file named, for example, "dialogue.sqf" that operates thusly, with "examplex" signifying waypoints:

    if (example1 == true) then {
    someUnit sideChat "This is the first message";
    }
    elseif(example2 == true) then {
    someUnit sideChat "This is the second message";
    };
    

    I have tried setting "examplex = true" in the Condition field of both triggers and waypoints, and then putting this into a file for each message I'd like to call:

    if (example[i]x[/i]) then { //code }

    As well as:

    if (example[i]x[/i] == true) then { //code }

    And trying:

    example[i]x[/i] = [true] execVM "dialogue.sqf";

    In the OnAct field.

    None of the above returned anything.

×