Skip to main content
Participant
September 5, 2010
Answered

Path branching game, choices, how to make them work?

  • September 5, 2010
  • 1 reply
  • 1939 views

Basically, I want to make a simple frame by frame path branching game. The problem is that I know that writing in and filling in EVERY FRAME going all along for EVERY CHOICE PATH would be an insanely tedious amount of work.

My basic project is reminiscent of japanese visual novels, and I've been looking for turtorials to help me with this style of role playing games, but all of the tutorials concentrated on the adventure RPGs. 😕😕

Being a novice at Actionscript, past working buttons to make it go to the next frame and stopping it, I was wondering if its possible to make a choice you make earlier in the game affect it later. Such as, you keep following the game normally afterwards, but depending on your choice you'll go to a different scene later.

basically, this way I'd like to eliminate the need to make two duplicate paths with only minor variances to show the changes for some choices.

Another thing that I would like to know if its possible to do, though this is less important, as I have yet to look for these things and I'm sure I can find them but.... a save/load system, easy to find I'm sure. And an unlocking system. Something so that once they hit a certain CG I can unlock it in a 'memories' menu on a main screen.

I know my questions seem to be rare, but does anyone know how to accomplish this and can explain it in a way that even an actionscript noob like me can understand?

This topic has been closed for replies.
Correct answer Andrei1-bKoviI

The extent of my knowledge is mainly simple animations. And for actionscript the most I know is just stopping and starting, and configuring buttons to work to take the user to different pages. Past that, I know very little. I could simply make my game with this minimal knowledge, but I know that it would turn out to be a massively large file and a large hassle to make, which is why I'm trying to have a general storyline the person follows while making it so that at certain points, earlier choices may vary the path he takes up towards the end.

Having worked on different programs(namely Warcraft 3 modding) with coding similar to what I'm trying to achieve... I understand basically how variables work.

Question 1: How do I establish the Variable in the first place and where?

Question 2: What kind of code do I add to alter the variables value, and can it be added onto the button the same way as the goto scripts? How would I write it so it does both functions, since I've never had a button with dual functions before.


OK, I will answer your questions but I am not sure it will make a big difference. It feels like you need to read about AS basics first - no one will do this job for you. There is no magic bullet.

Question 1: How do I establish the Variable in the first place and where?

In AS you declare variables by using keyword var:

var myVariable:String = "MY TEXT";

Question 2: What kind of code do I add to alter the variables value, and can it be added onto the button the same way as the goto scripts? How would I write it so it does both functions, since I've never had a button with dual functions before.

myButton.addEventListener(MouseEvent.CLICK, onButtonClick);

function onButtonClick(e:MouseEvent):void{

     myVariable = "Changed Value";

     // more code - what ever you need to do

     // no need for dual function

}

1 reply

Inspiring
September 5, 2010

As far as I could understand your task, everything is definitely possible. BUT I am sure it is extremely tedious to implement this on timeline. I see that the only sensible way is to use OOP with classes and, most importantly, a mechanism that controls business logic, especially game progression.

One of the reasons you cannot find tutorials is that it is not mainly about ActionScript but about software architecture. There are at least two skill sets involved:

  1. ability to envision concept in terms of application logic,
  2. knowledge of language capacities to implement the logic.

With that said, this is not something that novice can easily do. I am not saying that to discourage you but to warn that there is quite a steep learning curve ahead of you.

zinteamAuthor
Participant
September 5, 2010

Well, my plan was to have arrow buttons to go back and forth between frames, with each new frame including the next bit of speech of the characters or actions or whatever. Then, when a choice shows up the person playing chooses one, then the story moves on accordingly.

Is it possible to like, make it set a value to 1 or 2 depending on the choice made, then later have that value be referenced? Thats how it'd work out in my logic, but I have no idea how to do it, or anything really. I didnt understand most of your post to be honest. Steep learning curve indeed.

Inspiring
September 5, 2010

Hmm... okay, thank you very much Andrei1. I'll do just that and look up some actionscript turtorials before I continue, I'll return if I have amy more questions on implementing what you've told me.


You are welcome.

Again, forum is good for specific issues you encounter. The more focused the question, the more complete and fast the answers. This is just a nature of forums.

As for tutorials, beginners are very satisfied with linda.com.