Be a Supporter!

* Hang The Programmers Of Flash *

  • 2,017 Views
  • 51 Replies
New Topic Respond to this Topic
Kinsman
Kinsman
  • Member since: Jul. 15, 2000
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to * Hang The Programmers Of Flash * Jan. 31st, 2004 @ 01:21 PM Reply

I guess I'm a little late to this conversation, and it sounds like you've been solving a fair amount of the problems yourself, but I'll add what I can.

First off, some background - I've written a few RPGs myself, and I'm in the process of writing another, more ambitious one.

The problem you're describing - where a line of code has an implied 'pause' in it - is formally called "blocking for input". Different platforms handle the idea in different ways.

Back in the old days of DOS and BASIC interpreters, when you ran a program, you were actually running two programs - one which was the BASIC code, and another which watched over the code, stopping it when it needed input and then running the code that let the user hit keys and make letters appear next to the blinking '>' cursor.

Flash was always based around the idea of running a movie, so while it was nice enough to give us ActionScript, it wasn't so nice as to give us multithreading for the scripting.

You had two ideas for getting around it - one, splitting code apart into seperate frames, with the first frame ending where the input statement was, and an invisible movie clip watching for keystrokes and starting up the code again on the second frame. The other idea was using a whole lot of movie cips, each one governing various aspects of the game (i.e. the 'monster encounter' movieclip, the 'make text boxes appear with text' movieclip, the 'govern player movement based on keystrokes' moviecip.)

I know you really want to have all your code in one place, but I really recommend the splittling up the code into multiple movie clips, each run a little 'daemon' running its own part of the engine. It's more natural to Flash, and splitting code "across 300 or 400 frames", as you say, would be a nightmare to manage.

It looks like you had another idea, where all the code would be in a single frame that ran a huge checklist of everything that needed to be calculated, moved, or displayed each frame. It's certainly possible, but I have the same misgivings about trying to manage such a juggernaut main_loop() routine.

When you mention a 'switchboard', are you perhaps talking about the field of buttons that manage event scripting in RPG Maker?

Instead of trying to force Flash to resemble BASIC, perhaps what you could do is use Flash's interface to your advantage.

In my own engine, I have each player map as a separate frame in a 'ListOfMaps' movie clip. Peppered across each map are various other movieclips - either instances of a 'Click ToInvestigate' clip or a 'WalkIntoToInvestigate' clip.

Each of the investigation clips loop and wait patiently - either to be clicked, or bumped into by the player movie clip. When that happens, they look up a Smartclip property I gave them - the name of a function - and then run that function, which contains event code.

The event functions themselves are like a little language, by the way, so I agree with your plans of a BASIC-like interpreter. Mine's a little simpler - it uses Flash Actionscript to trip any flags or variables, and then stuffs a 'cutscene engine' clip which various instructions (display this graphic, then display this textbox, etc.)

The cutscene engine is quietly looping like everything else, and when it finds it has something in its 'things-to-do' array, it trips a variable that freezes the game action (which the investigation clips, and the player movement clips are paying attention to as they run) and then goes through its array, line by line, displaying what it needs to. (The player is offered a button to click in order to advance to the next picture or textbox.) Once the array is fully dealt with, it is emptied, the freeze variable is reset, and all the clips go about their business again.

Finally, each map has an 'Info Header' clip. The info header activates from its first frame (i.e. as soon as it realizes it exists, which is when the whole map is first displayed) and does various things like register the platforms and walkable spaces of the map for the player movement clip, and give the name of the map to the 'I display the name of the map for a few seconds when the player arrives in it' clip.

This all takes some setting up, and splitting the code into various clips means you have to pay attention to how it all coordinates; but once everything is set, you can use Flash's interface like a Visual RPG designer. Draw the map; drag the InfoHeader clip onto the map and set its properties; drag some Investigation clips onto the map and set their properties; then open your 'I Keep the Event Code Here' clip and write up the event functions and dialog.


BBS Signature
dw817
dw817
  • Member since: Dec. 16, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to * Hang The Programmers Of Flash * Jan. 31st, 2004 @ 03:49 PM Reply

Hi Kinsman:

* NG is being fussy cause this message is too long.
Standby and I'll truncate some of it.

At 1/31/04 01:21 PM, Kinsman wrote: I guess I'm a little late to this conversation, and it sounds like I'm in the process of writing another, more ambitious one.

* Excellent ! It's nice to find a fellow RPG programmer ! :)

Different platforms handle the idea in different ways.

blinking '>' cursor.

* Mmh.. Yep, and I miss those days at times ..

as to give us multithreading for the scripting.

movieclip, the 'govern player movement based on keystrokes' moviecip.)

* I'm not going to do that. So far the writing of ALL the primary code on a single frame is working quite well ! My main difficulty now (on hold till I finish the window handler) is to have delays like for scrolling the map, fadein/fadeout, etc. All still done in one frame, I know it can be done.

or 400 frames", as you say, would be a nightmare to manage.

* Definitely not going to do that.

manage such a juggernaut main_loop() routine.

* I'm doing it ! If you would like to try it yourself, you need to consider that you are using a variable like "go" for integer numbers, and at the top of the FRAME IF you are not looking for a keystroke, then go++ , if you are don't increase go and skip over ALL the primary code in a rather fat ELSE statement that handles all code outside reading a single keystroke. Then to piece together your program, have

if(go==10){ .. if(go==20){ .. if(go==30){ .. etc.

Where all the code would be needed for go equaling 10.
To GOTO a new line # simple change the variable "GO" to the "Line #" you want, then skip the rest of the code, BREAK works nicely for that, and on the next iteration it will be where you want. Ah ! GOTO has now been added to Flash !

about the field of buttons that manage event scripting in RPG Maker?

* Not at all. All buttons will be managed internally in the single frame. It is possible I will doodle some off-screen buttons and duplicate them as I need them.

what you could do is use Flash's interface to your advantage.

* Not at this point !
I've already spent nearly a month learning what Flash can and cannot do. I know it can do this single frame so I am "comfortable" in my BASIC niche.

ToInvestigate' clip or a 'WalkIntoToInvestigate' clip.

* You've written some GREAT games ! (I've tried and played them all)
One thing I noticed though is you, like others, don't make grid games. Your games have arrows and marker spots to click on that don't follow exact grids of any kind. QBasic had thousands of grid-games.. A bit of history, the PET computer could write nothing but grid games because although you could do graphics on it, you were actually modifying the fixed font's monospace image. I don't see why grid-games are not made in Flash ? Really puzzles me ..

Curiously enough although I now understand how to insert "sprites" over "tiles," when I started writing this game, I didn't know. So I called it the "Square Kingdom." Yep, and the people are perfect squares too. Ahhm, visually I mean. :)

Their hands meet their feet, their hair on top is the perfect top of a cube, and bright round faces with large eyes. I really like the idea and haven't seen any perfectly CUBED people before so hopefully it'll be a new original artist's niche like XiaoXiao, Poninjas, and Madness.

event code.

* But am I right in saying that if you define a function AFTER code that calls it, then it just doesn't run it ? I would LIKED to have had all my functions just beneath my main code, but when I called them in the main program, it ignored the call completely.

instructions (display this graphic, then display this textbox, etc.)

* Well, mine will have true Random Encounters, but I am REALLY going to try and keep it simple, so when you buy a Potion for instance, then you can drink out of it as much as you want. Similar to the game MiniRPG0 for the Commodore 64 game. Jaws-V did go on to write MiniRPG1 and MiniRPG2 for QBasic however. While I could keep and tally the # of potions carried and use one up every time you asked for a drink, by not doing so, this will simplify things tremendously and I'll still make the game challenging but not impossible and ALWAYS if you die, you are only put back a short ways.

Some people like to finish games without having to start ALL the way over because of bad judgement or luck of the draw ! :)

clips go about their business again.

* Your games remind me of pick-your-own-path, now I know they are more complex than that. But where is the freedom of movement on the map ? With what you are doing it would be very difficult to do indeed, but if things were on a grid, it would be different. Have you written any Flash games that work on a tight grid not yet published on NG ? If so, would love to see them to know that I am not truly pioneering the way to grid-games solo outside of Puzzled and Eternal Illusion.

player arrives in it' clip.

* By using multiple clips though, how do you handle sprite animations ? Or are there any .. That is one thing I am going to have problems with (until I write the pause routine as yet another switchboard operation).

functions and dialog.

* Definitely interesting ! Something I would never have considered.

* Hang The Programmers Of Flash *


BBS Signature
Anhiwa
Anhiwa
  • Member since: Jun. 5, 2003
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to * Hang The Programmers Of Flash * Jan. 31st, 2004 @ 04:47 PM Reply

Goddamn these posts are long hehe.

Hey Dave, are you going to have an internal sprite editor for your RPG editor? Also, will you create "coffee break" mini-games so that budding devs can take a rest every now and then?

^_^

CrookedAsterisk
CrookedAsterisk
  • Member since: Feb. 27, 2002
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to * Hang The Programmers Of Flash * Jan. 31st, 2004 @ 05:46 PM Reply

At 1/31/04 12:11 PM, dw817 wrote: All FUNCTIONS. Did you know you can't call a function if it's
defined AFTER the code that calls it ? Geez, even Pascal, GFABasic, Blitz, QBasic, GFA, DarkBasic, and RapidQ don't have that problem !

You're actually mistaken there. Let me demonstrate...

alert, in this case, can be called before it has been defined:

alert("This is a function.");

function alert(message) {
trace("ALERT:" + newline + message);
}

Now, alert in this case, cannot be called unless it has been declared before it's used:

alert("This is a function.");

alert = function(message) {
trace("ALERT:" + newline + message);
};

dw817
dw817
  • Member since: Dec. 16, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to * Hang The Programmers Of Flash * Jan. 31st, 2004 @ 07:41 PM Reply

At 1/31/04 04:47 PM, Anhiwa wrote: Goddamn these posts are long hehe.

* You betcha ! :)


Hey Dave, are you going to have an internal sprite editor for your RPG editor? Also, will you create "coffee break" mini-games so that budding devs can take a rest every now and then?

^_^

* That would be nice .. There are some Flash tutorials that show how to build and record objects like the editor allows you to do but that will be a LONG ways off.

For one thing, since I still don't have any way to read external / internal files except internet cookies, "saving" your work will consist of one input field with probably close to 7000 random-appearance characters or "password" that is a summation of your work. Early version will have fixed tiles, sprites, and critters. You can clip/paste in new "worlds" or save them in Notepad.

That's all I can do for now.

* Hang The Programmers Of Flash *


BBS Signature
dw817
dw817
  • Member since: Dec. 16, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 1st, 2004 @ 10:09 AM Reply

At 1/31/04 05:46 PM, CrookedAsterisk wrote:
At 1/31/04 12:11 PM, dw817 wrote: All FUNCTIONS. Did you know you can't call a function if it's
defined AFTER the code that calls it ? Geez, even Pascal, GFABasic, Blitz, QBasic, GFA, DarkBasic, and RapidQ don't have that problem !
You're actually mistaken there. Let me demonstrate...

alert, in this case, can be called before it has been defined:

alert("This is a function.");

function alert(message) {
trace("ALERT:" + newline + message);
}

Now, alert in this case, cannot be called unless it has been declared before it's used:

alert("This is a function.");

alert = function(message) {
trace("ALERT:" + newline + message);
};

Ah !
I can't seem to reproduce the error I was having.
I have since written a test program and, you are right, it does seem to recognize it even if it is after the main program. If I come across this discrepancy again, I'll let you know so it can be examined. :)

I've completed the Wdw() library complete with matching overlay text and am now working on the custom delay routine that won't hang Flash. It'll be similar to my GetKkey() routine except that it won't wait for a key and will just "cycle" till the timer I set has run out. Still operating in one frame. Phew !

* Hang The Programmers Of Flash *


BBS Signature
ioi8
ioi8
  • Member since: Jun. 10, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 1st, 2004 @ 10:29 AM Reply

Ok, I know what you say you are doing is something radically new, but it really isnt.

I myself program in the main timline, but here is a different strategy.

I use the first frame to init variables, makes classes, anything that only needs to be done once.

My second frame is my main game engine code.

Frame 3 loops back to frame 2.

Now if frame 2 gets to big with tons and tons of code, put a chunk of code in frame 4, name that frame "mycode". In frame 2, you can reference that code as like call("mycode"); It works exactly as if the code were not there. So my main engine loops are sometimes less than 10 lines of code.

for (index=0; index<=6; index++){
call("playeractions");
call("aiactions");
call("physics");
}

This makes it much easier if you want to skip that code and make the game pause.

Also there is another meathod, which loops around frame 3 and 4, which will work if you havnt made code calls in your frame 2. If the pause is on, frame 3 wont loop to 2, it will encounter frame 4, where it will loop to frame 3, and continue on until pause is off.

Also another thing, dont put all your mcs on your stage. Instead, dynamically call them from the library. Using this meathod _root.atachmovieclip("libraryname", "newname", layer); Now "newname" is a valid mc, and you can place it and use it like an mc that was already on the stage. However, you need to use the removemovieclip command to remove that mc when done, as changing scenes will not make it go away. You can also make arrays of mcs with that meathod as well.

For (index......);
_root.attachmovieclip("name", "newname" + index, index);
}
Reference by _root["newname" + index].whatever;

And instead of having all the code in one frame, use a seperate engine for different game functions. In my game in putting on the portal today, it uses 4 diff types of game engines in this meathod, each in a seperate scene. Your making this way too complicated.

Now you see why all the coders think that this problem was a joke to figure out. You still have alot to learn, so please dont think that you are the best, because there will always be someone better. This is only the tip of the iceberg to my knowledge on programming. Try to keep up.

Matt

Kinsman
Kinsman
  • Member since: Jul. 15, 2000
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 1st, 2004 @ 02:23 PM Reply

At 2/1/04 10:29 AM, ioi8 wrote: Ok, I know what you say you are doing is something radically new, but it really isnt.

Actually, what he wants to do is something that's rather old :)


Now you see why all the coders think that this problem was a joke to figure out.

No, you've misinterpreted his problem. He wanted to know how to simulate a language feature that Flash couldn't directly support, which was pausing the calculations in a script for input - which is important if you want to create event coding or other basic scripting that feels natural to the creator to write.

A lot of RPG scripting is written like a flowchart, where in the middle of a cutscene, a player might be asked to make a choice from a menu or type in a special password, or what have you.

"A lot of the coders" here on this thread are missing the subtleties of his question, probably because they're too young to remember the days of simple languages that blocked for input.

You're making this way too complicated.

Well, I agree that he is, and he should make an attempt to embrace the newer tools and paradigms that Flash offers, but I disagree that..

:You still have alot to learn, so please dont think that you are the best, :because there will always be someone better. This is only the tip of :the iceberg to my knowledge on programming. Try to keep up.

I hope that as you grow older, you stop seeing people's respective programming skills as something to clash and player-hate over. It acts as a barrier to learning.

I've looked at both your Flash games, and his Windows games, and I have a healthy respect for both.

Thank you for bringing up the 'call' feature in ActionScript. I'll take a look at it myself sometime.

Anyways..

dw817, handling sprite animations with multiple clips? Well, I usually sort my images so that, say, one clip has All the Monster pictures, another all the CutScene-TalkingHeads pictures, and so forth. I'm using the timeline feature where you can give a label to every frame, and then using that as a string to look up when I want a particular animation (i.e. monster.gotoandplay(attacker[0] + "_Die"); )

I don't tend to write 'grid games' in Flash - probably because while I'm old enough to be remember those old style games like the early Ultima series and Final Fantasy, I'm not old enough to have really gotten into them. I don't think they'd be much harder or easier to write than a tile-less game - all you have to do is make sure that your X and Y placement is always, say divisible by 16 or 32, and write a few routines that can translate X and Y values to a particular grid cell.


BBS Signature
Kinsman
Kinsman
  • Member since: Jul. 15, 2000
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 1st, 2004 @ 02:24 PM Reply

At 2/1/04 10:29 AM, ioi8 wrote:

: Ok, I know what you say you are doing is something radically new, but it really isnt.

Actually, what he wants to do is something that's rather old :)

Now you see why all the coders think that this problem was a joke to : : figure out.

No, you've misinterpreted his problem. He wanted to know how to simulate a language feature that Flash couldn't directly support, which was pausing the calculations in a script for input - which is important if you want to create event coding or other basic scripting that feels natural to the creator to write.

A lot of RPG scripting is written like a flowchart, where in the middle of a cutscene, a player might be asked to make a choice from a menu or type in a special password, or what have you.

"A lot of the coders" here on this thread are missing the subtleties of his question, probably because they're too young to remember the days of simple languages that blocked for input.

: You're making this way too complicated.

Well, I agree that he is, and he should make an attempt to embrace the newer tools and paradigms that Flash offers, but I disagree that..

:You still have alot to learn, so please dont think that you are the best, :because there will always be someone better. This is only the tip of :the iceberg to my knowledge on programming. Try to keep up.

I hope that as you grow older, you stop seeing people's respective programming skills as something to clash and player-hate over. It acts as a barrier to learning.

I've looked at both your Flash games, and his Windows games, and I have a healthy respect for both.

Thank you for bringing up the 'call' feature in ActionScript. I'll take a look at it myself sometime.

Anyways..

dw817, handling sprite animations with multiple clips? Well, I usually sort my images so that, say, one clip has All the Monster pictures, another all the CutScene-TalkingHeads pictures, and so forth. I'm using the timeline feature where you can give a label to every frame, and then using that as a string to look up when I want a particular animation (i.e. monster.gotoandplay(attacker[0] + "_Die"); )

I don't tend to write 'grid games' in Flash - probably because while I'm old enough to be remember those old style games like the early Ultima series and Final Fantasy, I'm not old enough to have really gotten into them. I don't think they'd be much harder or easier to write than a tile-less game - all you have to do is make sure that your X and Y placement is always, say divisible by 16 or 32, and write a few routines that can translate X and Y values to a particular grid cell.


BBS Signature
dw817
dw817
  • Member since: Dec. 16, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 1st, 2004 @ 05:44 PM Reply

Hi ioi8:

At 2/1/04 10:29 AM, ioi8 wrote: Ok, I know what you say you are doing is something radically new, but it really isnt.

* Well, it certainly does seem new in Flash. I've got a little over 1100 Flash stored away, mostly movies, but from the games I've seen, very little to do with grid movements like in FF1/FF2/FFMQ.


I myself program in the main timline, but here is a different strategy.

I use the first frame to init variables, makes classes, anything that only needs to be done once.

My second frame is my main game engine code.

Frame 3 loops back to frame 2.

Now if frame 2 gets to big with tons and tons of code, put a chunk of code in frame 4, name that frame "mycode". In frame 2, you can reference that code as like call("mycode"); It works exactly as if the code were not there. So my main engine loops are sometimes less than 10 lines of code.

for (index=0; index<=6; index++){
call("playeractions");
call("aiactions");
call("physics");
}

* Phew ! I hope I don't have to do that !
Just what are the limitations on the number of lines you can have maximum per frame ? I found out that you can go up to 500 characters across which is where I'll be storing my data, on frame #4.


This makes it much easier if you want to skip that code and make the game pause.

Also there is another meathod, which loops around frame 3 and 4, which will work if you havnt made code calls in your frame 2. If the pause is on, frame 3 wont loop to 2, it will encounter frame 4, where it will loop to frame 3, and continue on until pause is off.

* That's just not going to work for what I want ..


Also another thing, dont put all your mcs on your stage. Instead, dynamically call them from the library. Using this meathod _root.atachmovieclip("libraryname", "newname", layer);

* I'm keeping them there because it's "comfortable" to see them. Remember I'm still pretty well used to programming in GFABasic and all my graphic editors for it stored the images on hidden screens, then I could just flip pages (there were about 9 for Scenario) to see what all is stored. If the Library were more intelligent so you could lay out your work on a 2x2 grid like a graphic contact page, that would be great. As it is, I keep the main graphics on the stage but hidden from view.

Now "newname" is a valid mc, and you can place it and use it like an mc that was already on the stage. However, you need to use the removemovieclip command to remove that mc when done, as changing scenes will not make it go away. You can also make arrays of mcs with that meathod as well.

* I'm just duplicating the "master" that is off-screen and removing first the duplicate if it already exists.
That works fine.


For (index......);
_root.attachmovieclip("name", "newname" + index, index);
}

Why do it that way ?
- - -
function dupe(a,b,n){
removemovieclip(b)
duplicatemovieclip(_root[a],b,n)
}
- - -

Then just call dupe anytime you need to create a new graphic.
:)

Reference by _root["newname" + index].whatever;

And instead of having all the code in one frame, use a seperate engine for different game functions. In my game in putting on the portal today, it uses 4 diff types of game engines in this meathod, each in a seperate scene. Your making this way too complicated.

* I'm not comfortable with that either. I MAY do that for modules (if I ever get that far in Flash), but for this simple experiment of a RPG, not.


Now you see why all the coders think that this problem was a joke to figure out. You still have alot to learn, so please dont think that you are the best,

* I NEVER DID ! Lor' this is only my first month of programming in Flash ! :)

because there will always be someone better. This is only the tip of the iceberg to my knowledge on programming. Try to keep up.


Matt

* I am not worthy of The Matt !! LOL ! :D

* Hang The Programmers Of Flash *


BBS Signature
dw817
dw817
  • Member since: Dec. 16, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 1st, 2004 @ 06:08 PM Reply

Hi Kinsman:

At 2/1/04 02:23 PM, Kinsman wrote:
At 2/1/04 10:29 AM, ioi8 wrote: Ok, I know what you say you are doing is something radically new, but it really isnt.
Actually, what he wants to do is something that's rather old :)

* Yep, really old ! I miss those SNES days. :)


Now you see why all the coders think that this problem was a joke to figure out.
No, you've misinterpreted his problem. He wanted to know how to simulate a language feature that Flash couldn't directly support, which was pausing the calculations in a script for input - which is important if you want to create event coding or other basic scripting that feels natural to the creator to write.

* Yep .. I'm glad you kids (and I say that with respect) have enough raw obsessiveness to code without using short-cut functions, but I LIVE off writing them. At times I am very lazy in my coding. :)


A lot of RPG scripting is written like a flowchart, where in the middle of a cutscene, a player might be asked to make a choice from a menu or type in a special password, or what have you.

* Exactly, like inputting a 16-character password to continue your game for instance. All other tasks in Flash need to "shup" while this task is running. Now I'll be honest, I do have scripts on duplicated buttons in the code, but all they do is tweak sound and set a string "butn= " the name of the button. I see that as an additional input to the key-reader. I MAY move the key-reader to a different frame entirely so it is always active in case things do get difficult in that single frame.


"A lot of the coders" here on this thread are missing the subtleties of his question, probably because they're too young to remember the days of simple languages that blocked for input.

* I'm probably a GRANDPA compared to most of you teenagers on here. :D


You're making this way too complicated.
Well, I agree that he is, and he should make an attempt to embrace the newer tools and paradigms that Flash offers, but I disagree that..

* I'm doing what I can. For instance, I wanted to be able to use
button.text="attack!" So it would change my duplicated button's text to that, but the two are separated. So I am doodling all the instances of buttons I need, all the same size for easy reference, and labeled "butn-okay" "butn-no" "butn-potion" etc.


You still have alot to learn, so please dont think that you are the best, :because there will always be someone better. This is only the tip of :the iceberg to my knowledge on programming. Try to keep up.
I hope that as you grow older, you stop seeing people's respective programming skills as something to clash and player-hate over. It acts as a barrier to learning.

* That you. Lor' I REALLY had that problem with teenagers and pre-teens when I presented Scenario years ago to a Forum that was dedicated to RPGMakers. Their initial impressions were YAH don't make me laugh, what you wrote is real crap, you'll never amount to RPG95/2000. Geez I never said I was TRYING to compete against those guys. But I think what I did is comperable to RPGKit and RabidGerbil. :)


I've looked at both your Flash games, and his Windows games, and I have a healthy respect for both.

* Thank You ! I've also written quite a few screen-teasers you can find on my site (when it's back up!) I see the allocated file transfer (bandwidth) got annihilated again today. Phew !

* I even put together a Flash tutorial (mostly for myself) to learn from in Flash. My 2nd project.


Thank you for bringing up the 'call' feature in ActionScript. I'll take a look at it myself sometime.

Anyways..

dw817, handling sprite animations with multiple clips? Well, I usually sort my images so that, say, one clip has All the Monster pictures,

* How do you do that ?

another all the CutScene-TalkingHeads pictures, and so forth.

* No talking heads here. I now see how you do voice animations, by keeping in a separate layer and looking for V arcs to signify speech where to put the animation. Phew ! Might be a LONG TIME before I make a true Flash movie with lip-sync !

I'm using the timeline feature where you can give a label to every frame, and then using that as a string to look up when I want a particular animation (i.e. monster.gotoandplay(attacker[0] + "_Die"); )

* I haven't done that yet and I really didn't understand that .. what does it do ?

I don't tend to write 'grid games' in Flash - probably because while I'm old enough to be remember those old style games like the early Ultima series and Final Fantasy, I'm not old enough to have really gotten into them. I don't think they'd be much harder or easier to write than a tile-less game

* Considerably easier. Just create a map like mine where the screen is exactly 9x7 tiles, and you'll find it's a snap to lock in those warp and script points. :)

- all you have to do is make sure that your X and Y placement is always, say divisible by 16 or 32, and write a few routines that can translate X and Y values to a particular grid cell.

* Yep. In this case they stretch 32x32 (or as close as I could since everything was vectored!)

* Hang The Programmers Of Flash *


BBS Signature
CrookedAsterisk
CrookedAsterisk
  • Member since: Feb. 27, 2002
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 4th, 2004 @ 07:29 PM Reply

At 2/1/04 05:44 PM, dw817 wrote:
For (index......);
_root.attachmovieclip("name", "newname" + index, index);
}
Why do it that way ?
- - -
function dupe(a,b,n){
removemovieclip(b)
duplicatemovieclip(_root[a],b,n)
}
- - -

Then just call dupe anytime you need to create a new graphic.

That function is really badly done. It should look like this:

MovieClip.prototype.dupe = function(newName, depth, initObject) {
removeMovieClip(newName);
this.duplicateMovieClip(newName, depth, initObject);
};

There's no need to make function for a function that is already built into ActionScript. You seem like a good programmer, I just think you have a lot to learn about AS/Flash.

dw817
dw817
  • Member since: Dec. 16, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 5th, 2004 @ 07:02 AM Reply

Hi CrookedAsterisk:

That function is really badly done. It should look like this:

MovieClip.prototype.dupe = function(newName, depth, initObject) {
removeMovieClip(newName);
this.duplicateMovieClip(newName, depth, initObject);
};

* I can, but you ask me.
What is the "prototype" for ?
And I have found you don't need to use "_root" or "movieclip."
What gives ?

There's no need to make function for a function that is already built into ActionScript. You seem like a good programmer, I just think you have a lot to learn about AS/Flash.

* No, there's no NEED, but it helps. It's easier for me to type
dupe() than duplicatemovieclip(). Once again, this is a short-cut just like this one:

function rnd(a){
return random(a)
}

Sure you can use random() a hundred times over, but W H Y when you can use rnd() instead ? :)

Also, is there a way to seed a random number ?

RANDOMIZE (seed)

So that the set of random numbers that follow are based upon the seed entered ? I'd like to use this as part of the password system for a checksum.

And MOST important, IS there a way to LOAD/SAVE a local text file at all in Flash ? Here is how it's done for GFA and most other BASIC languages.

open"i",1,"readme.txt"
while eof(1)=0
line input#1,text
print#1,text
wend
close #1

* Hang The Programmers Of Flash *


BBS Signature
Kinsman
Kinsman
  • Member since: Jul. 15, 2000
  • Offline.
Forum Stats
Member
Level 14
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 5th, 2004 @ 09:14 AM Reply

'prototype' is a way to access the definition of an object. By adding a function to 'MovieClip.prototype', he's expanded what a movieclip is capable of in his project.

MovieClip refers to an object type - the various movie-clip objects that make up a Flash movie.


BBS Signature
dw817
dw817
  • Member since: Dec. 16, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to * Hang The Programmers Of Flash * Feb. 6th, 2004 @ 10:34 PM Reply

Hi Kinsman:

* Well, I FINALLY got the password function to work correctly for Square Kingdom ! It will use 16-characters letters A - P separated by a dash every 4 characters.

At 2/5/04 09:14 AM, Kinsman wrote: 'prototype' is a way to access the definition of an object. By adding a function to 'MovieClip.prototype', he's expanded what a movieclip is capable of in his project.

* I'm not sure I understand this entirely ?
Oh, and I just discovered what a SCENE is. Yep, I'm that far back as far as learning FLASH goes. :)


MovieClip refers to an object type - the various movie-clip objects that make up a Flash movie.

Well, I make objects, there's lots of them in Square Kingdom.
I can save or use them as buttons, movies, or pictures.
Pictures aren't too useful, and I never know when I want to edit that picture later so I make all my pictures into "movie" format.

Now with this Scene thingie, I think I can make a Scene that has all my images on it. In truth, I REALLY don't need my images on all the edges outside the main window (1st Scene). I just do that so I have a "comfort" feeling that they are there, and when I edit them, it does update the library recording automatically. I'm not very happy with the Library yet and it won't tile-view multiple library items.

Does Macromedia Flash #7 do that ? In any case, I can't get my FLA to load up in 7. Nor can I load up sources from Flash 5 in 6 ??

Hasn't Macromedia heard of downwards compatibility ?
Ah well.

Since I've added a LOT more critters, items, and scripts, I think it's going to take a-while for me to finish up Square Kingdom.

I'm also going to release the sourcecode to Scenario to Sourceforge.net for anyone who wants to continue the Scenario RPGMaker line. I won't be programming back in GFA again.
Of this I am certain.

* Hang The Programmers Of Flash *


BBS Signature
dw817
dw817
  • Member since: Dec. 16, 2003
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to * Hang The Programmers Of Flash * May. 7th, 2010 @ 09:38 PM Reply

Hello.
Hopefully I am entitled to BUMP my own topic.
I'm getting back into Flash again. Going to try anyways. I'm still fighting that old devil of getting everything to work in a single Actionscript frame although now I have separated it for convenience.

Frames:
[1] REM statement, program version, and notes to myself
[2] Variable definitions, data statements, array setup, and stuff that runs ONETIME like screen setup
[3] all functions
[4] Main Program (trying to keep it all self-contained)
[5] Grr .. hopefully I don't need this to GOTO 4 which is what Square Kingdom does.

I have recovered the source to my Square Kingdom work, and while I don't understand a lot of it, oddly enough it runs perfect in current Flash. I noticed that neat Asteroids demo doesn't run now it seems and just gives a white screen. I tried pasting the code for either Actionscript 2 or 3 with no results.

I am using Adobe Flash CS3 Professional. I am not coding in Actionscript 3 as it does not seem to appear in Mozilla Firefox browser window. I am coding in Actionscript 2 which does.

If anyone wants to add (hopefully) answers to some of my questions, like a REALLY quick working example of a single Actionscript line (say <20 lines) that can wait and retrieve keystrokes without hanging the system, or some new command in current Flash that updates the display and releases time to the rest of the system I didn't know about, please let me know.

dw817


BBS Signature
Johnny
Johnny
  • Member since: Apr. 17, 2004
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to * Hang The Programmers Of Flash * May. 7th, 2010 @ 09:57 PM Reply

At 5/7/10 09:38 PM, dw817 wrote: Frames:
[1] REM statement, program version, and notes to myself
[2] Variable definitions, data statements, array setup, and stuff that runs ONETIME like screen setup
[3] all functions
[4] Main Program (trying to keep it all self-contained)
[5] Grr .. hopefully I don't need this to GOTO 4 which is what Square Kingdom does.

I know you're used to a procedural programming language, but if you read up on OOP languages, it will make your life much easier. Use classes or external .as files.

Classes:
-Global class that defines variables, data structures ect.. (and your initilization functions)
-Game class that handles all of the game logic.
-Place all functions (if you'd like) in a separate as file.

In frame 1) Call the initialization function, which can call the game class. 1 line of code.

I am using Adobe Flash CS3 Professional. I am not coding in Actionscript 3 as it does not seem to appear in Mozilla Firefox browser window. I am coding in Actionscript 2 which does.

Classes and external files both work with AS2, and are key to organizing. Fix your flash player if AS3 isn't working in your browser.

Above and beyond that, if you're creating an RPG, classes are the way to go. Enemies, players, items and quests can all be thought of as objects, and all be kept in separate classes.


Perpetually looking for time to return to the arts.

BBS Signature
dELtaluca
dELtaluca
  • Member since: Apr. 16, 2004
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to * Hang The Programmers Of Flash * May. 7th, 2010 @ 10:00 PM Reply

OMFG WHAT IS WRONG WITH YOU PEOPLE

to the topic starter, you're problems are you do not understand the way programming in flash works, programming in flash is strictly event based, and single threaded, you handle events raised by flash player and control is not released until the handler has exited. It's a totally different paradigm from what you appear to be used to working with.

you're 3 line example, when written as an event based program would consist of (assuming you're programming on frames in flash, and assuming AS3, otherwise there is a few name changes to work with AS2, but the principal is exactly the same)

trace("here");
stage.addEventListener(KeyboardEvent.KEY _DOWN,keyDownHandler);
function keyDownHandler(ev:KeyboardEvent):void {
if(ev.keyCode == 75) { //75 is virtual keycode for K
trace("there");
stage.removeEventListener(KeyboardEvent.
KEY_DOWN,keyDownHandler);
}
}

when the frame executes, the first trace command is executed, and a handler is assigned for the KEY_DOWN event,

flash player then goes about it's normal business, until a key is pressed, and at that point the handler for KEY_DOWN is invoked, and should they key that was pressed have been the K key, the next trace command is executed, and the handler is removed so that pressing k again would not cause the trace call to be executed once more.


using ShamelessPlug; NapePhysicsEngine.advertise();

BBS Signature
fwe
fwe
  • Member since: Jul. 24, 2003
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to * Hang The Programmers Of Flash * May. 7th, 2010 @ 10:02 PM Reply

At 5/7/10 10:00 PM, dELtaluca wrote: poop

You do realize you're answering a 6 1/2 year old post?


wtfbbqhax

dELtaluca
dELtaluca
  • Member since: Apr. 16, 2004
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to * Hang The Programmers Of Flash * May. 7th, 2010 @ 10:05 PM Reply

At 5/7/10 10:02 PM, fwe wrote:
At 5/7/10 10:00 PM, dELtaluca wrote: poop
You do realize you're answering a 6 1/2 year old post?

yes, but the topic starter has very recently bumped it reiterating his years old question that i answered.


using ShamelessPlug; NapePhysicsEngine.advertise();

BBS Signature
LesPaulPlayer
LesPaulPlayer
  • Member since: May. 18, 2006
  • Offline.
Forum Stats
Member
Level 12
Blank Slate
Response to * Hang The Programmers Of Flash * May. 8th, 2010 @ 12:01 AM Reply

Seriously, coding a game on one frame is not hard at all. If your looking to pause something, just make a function called Advance or Run or something and only call it when you want to.

meneldil
meneldil
  • Member since: May. 27, 2004
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to * Hang The Programmers Of Flash * May. 8th, 2010 @ 12:34 PM Reply

You need to learn about event-driven programming.


Indescriptive topic names have left me in despair!