PDA

View Full Version : [AS2] Decision Based Linear Gameplay


username2046
07-02-2009, 09:46 PM
I want to write code for a game with a storyline that is effected by the choices the main character makes.

Basically, it's a visual novel with effected outcomes that are based on key choices such as,'Pull the switch', or,'Wait and think about it.'

If you choose to pull the switch, you change the storyline completely from that point. If you wait it out, the character stays with the same storyline.

I'm new to this so can someone teach me/help me write code?:confused: I also need to know code so that when you click, a new block of text appears. And in reference to the last question, I need to know how to have images displayed according to script command. I'll be really happy if you can help...

username2046
07-02-2009, 09:49 PM
Need Help On Decision Based Gameplay.

I want to write code for a game with a storyline that is effected by the choices the main character makes.

Basically, it's a visual novel with effected outcomes that are based on key choices such as,'Pull the switch', or,'Wait and think about it.'

If you choose to pull the switch, you change the storyline completely from that point. If you wait it out, the character stays with the same storyline.

I'm new to this so can someone teach me/help me write code? I also need to know code so that when you click, a new block of text appears. And in reference to the last question, I need to know how to have images displayed according to script command. I'll be really happy if you can help...:confused:

rrh
07-02-2009, 10:29 PM
Some people have managed to make this kind of game with nothing but buttons with goToAndStop code attached to them.

So, the bare minimum you would need is:
goToAndStop("targetLabel")
and
http://www.kirupa.com/developer/flash5/button.htm

There's certainly more powerful ways of doing it, but basically the first step is read a bunch of tutorials.

Noct
07-02-2009, 11:01 PM
Welcome aboard,

The best advice I could give you would be to buy a book and/or start doing some online tutorials. You've made it here, which is a great first step; I just think you're misunderstanding what this forum can/will do for you.

If you have a specific question to ask, we're all ears; broad sweeping pleas for help without even really knowing what you're asking for is a whole other animal... Besides, what you're describing would be so based on design choices that it'd be virtually impossible for someone to throw code at you without first knowing the project.

Basically, you're going to either push the timeline along using user events and have your content spread across movieClips (and possibly scenes), or you're going to dynamically generate everything and have no "main timeline" to speak of at all.

If you do everything dynamically, you're going to swap different swfs and strings of text into your movie as needed using dynamic text fields and movieClips. If you go timeline, you'd be looking more at placing all those objects at specific points in time and pushing the timeline to them instead.

Again, this is stuff we really can't decide for you; you need to have a plan, and better still, a file, before you try to ask for in-depth help.

If you're looking for some actual AS2 to start getting your feet wet with, start reading up on event handling, dynamic text fields, variables, timeline control, and intervals/timeOuts. From what you're describing, I would think those would be the foundations of your project.

Good Luck!