A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Dialogue trees and allow them to progress

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    2

    Dialogue trees and allow them to progress

    Using Actionscript 2

    As I said once before I'm making a dialogue based flash game.
    I'm relatively new to flash, so I've been having to scavenge for bits of code for what I want to do...

    -------Right now my situation is this -

    When a player "talks" with a character by pressing the "talk" button I want them to be able to pick up at the conversation point they were at last time. Not a save file, but more of a progression,
    so if they were to explore other parts of the world and come back to the same character, they'd have to click on the same "talk" button, but //still// be advanced in their dialogue tree.

    Is there a way to do with with action script code?
    Something that will tell flash, "Oh, this is where we left off, I'll go to the next frame of dialogue" when players click on the "talk" button?

    My only idea to do something like this is quite a hassle -
    make a variable named "times talked to" and have the button depended on this variable, and make it gain a point every time it is pressed,
    but I'm under the impression that this effect can be achieved without something like this.

    Any help and you will be loved forever. D;

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Maybe you can adapt this...
    Code:
    if (initArray == undefined) {
    	initMe();
    }
    
    function initMe() {
    	initArray = new Array();
    	initArray["bobtalk"] = 0;
    	initArray["sallytalk"] = 0;
    	trace("init");
    }
    
    bobtalk.onPress = function() {
    	trace(this._name+" is at "+initArray[this._name]);
    	initArray[this._name]++;
    };
    sallytalk.onPress = function() {
    	trace(this._name+" is at "+initArray[this._name]);
    	initArray[this._name]++;
    };

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center