How would you go about organizing a complex rpg story?

Okay, I've realized how this may be misunderstood. This is a very basic example. So, now I've gone over to my computer. I'll write an edit for you.

public class Path{

private Path a, b;
private Bool[] booleans;
private String[] options;

public Path(Path a, Path b){
    this.a = a;
    this.b = b;
}

public Path(){
}

public Path setOptions(String[] options){
    this.options = options;
}

public void setBoolean(int i, boolean b, String name){
    booleans[i] = new Bool(name, b);
}

public void setBoolean(int i, boolean b, String name, boolean returnsA){
    booleans[i] = new Bool(name, b).setReturnsA(true);
}

public void setBoolean(int i, boolean b, String name, boolean returnsA, String nameRequiredToReturnA){
    booleans[i] = new Bool(name, b).setReturnsA(true).setRequirement(nameRequiredToReturnA);
}

public Path getPath(){
    boolean returnB = false;
    boolean returnA = false;
    for(int i = 0; i < booleans.length; i++){
        if(booleans[i].getValue())
            if(!booleans[i].returnsA){
                returnB = true;
                returnA = false;
            }else if(booleans[i].getValue()){
                returnA = true;
                returnB = false;
            }
    }

    if(returnB)
        return b;

    if(returnA)
        return a;

    return this;

}

class Bool{

     public boolean returnsA = false;
     private String nameRequiredToReturnA;
     private boolean b;
     public String name;

     public Bool(String name, boolean b){
         this.name = name;
         this.b = b;
     }

     public Bool setRequirement(String req){
         nameRequiredToReturnA = req;
     }

     public Bool setReturnsA(String returnsA){
         this.returnsA = returnsA;
     }

     public boolean getValue(){
         if(returnsA){
             if(nameRequiredToReturnA!=null){
                 for(int i = 0; i < booleans.length; i++)
                     if(booleans[i].name==nameRequiredToReturnA)
                         if(nameRequiredToReturnA.getB())
                             return true;
                 return false;
             }
             return true;
         }else
             return b;
     }

}

}

Long, but should work. So you could set "talkedToA" to true, then "onFire" to true IF "talkedToA" is true. So pretty much, you can set multiple scenarios, and still be able to make more if necessary with a few edits.

/r/gamedev Thread Parent