Best viewed in Firefox

Awesty Productions

Making an RPG type game

October 29th, 2006 by awesty

In this tutorial you will learn how to make a RPG type game in flash. I will only be teaching you how to set up the character and the actionscript, not how to animate the character. You should already know some actionscript and know how to find your way around flash.

The final result will look something like this.

First of all you need to make two movieclips of your main character, the first one is a birds eye view (top, looking down on the character) of him/her standing still. The other one of them walking. Now put them both into one movieclip, with the standing still MC (movieclip) on the first frame and the walking MC on the second frame. Make sure you put the action ’stop();’ without the quotes on each of those frames. Once you have that done give that MC an instance name of ‘man’ and put these actions on it:

onClipEvent(enterFrame){
    if(Key.isDown(65)){
        this._rotation = 270;
        this._x -= 3;
                this.gotoAndStop(2);
    }else if(Key.isDown(68)){
        this._rotation = 90;
        this._x += 3;
                this.gotoAndStop(2);
    }else if(Key.isDown(87)){
        this._y -= 3;
        this._rotation = 0;
                this.gotoAndStop(2);
    }else if(Key.isDown(83)){
        this._y += 3;
        this._rotation = 180;
                this.gotoAndStop(2);
    }else{
                this.gotoAndStop(1);
        }
}

Okay, I will try to explain that as best I can.

onClipEvent(enterFrame){

All that means is ‘every time this frame is entered’. So if you have a frame rate of 30 (which I do) the following script would run 30 times a second.

if(Key.isDown(65)){
this._rotation = 270;
this._x -= 3;
this.gotoAndStop(2);

‘If the key ‘65 is down, this rotates to 270 degrees, this _x decreases by 5 (moves left) and this goes and stops on frame 2 (the walking frame). 65 is the key code for ‘A’. For this tutorial the controls for the character are going to be ‘W’, ‘A’, ‘S’ and ‘D’. Most of the other code is exactly the same as above with a few numbers changed, so I am not going to explain that.

}else{
this.gotoAndStop(1);

If none of the above code is happening (In other words, if none of the keys are down) this MC can go to and stop on frame 1 (the standing frame). Therefore when the MC isn’t moving it will stop on frame 1.

Now, if you haven’t already make an item for you character to pick up, and an inventory for it to go in.

Now, copy and paste your item and place the copied one in the inventory, like so:

But make it’s alpha 0, so you can’t see it. Give it an instance name of ’smallItem’ without the quotes.

Now select your item (the visible one), and put these actions on it:

onClipEvent(enterFrame){
    if(this.hitTest(_root.man)){
        this._alpha = 0;
        _root.smallItem._alpha = 100;
    }
}

All that means is when the ‘man’ MC hits the item (the visible one), that ones alpha goes down to 0 and the one in the inventories alpha goes up to 100. So it looks like you have taken the one of the ground and put it into your inventory.

That is it for this tutorial. Keep coming back for more ;)

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • del.icio.us
  • digg
  • Furl
  • MyShare
  • NewsVine
  • Netscape
  • Reddit
  • Simpy
  • Slashdot
  • StumbleUpon
  • Technorati
  • YahooMyWeb

RSS feed | Trackback URI

218 Comments »

Comment by Bob
2006-11-04 07:18:12

Awsome. I love your tutorials, keep em’ comming.

I made this with the help of some of your tutorials.

http://www.deviantart.com/deviation/42079834/

 
Comment by awesty
2006-11-04 14:39:26

Nice work ;)

 
Comment by Lachy
2006-11-05 18:17:16

Hi,

Are you going to be continueing this tutorial to make like a full game.

Thank

 
Comment by Bob
2006-11-08 21:55:17

How did you program it to make the W,A,S,D keys move? Whenever I try to incorperate those into a game it doesn’t accept them.

 
Comment by awesty
2006-11-09 15:36:01

@Lachy: Yes, but it might not be for a while.

@Bob: What version of flash are you using? If you use the code I used there it should work fine.

 
Comment by Bob
2006-11-09 21:40:30

Flash 8 (basic). I need to be more specific, How do you program letter keys in any flash. Is there a website that will tell you what number is assigned to what letter?

 
Comment by Bob
2006-11-09 21:43:03

Wait that didn’t make much sense either. I mean to say, what numbers for any key.

 
Comment by Ryan
2006-11-10 10:43:07

I don’t get it, just kidding!

 
 
Comment by Bob
2006-11-10 21:36:55

Thanks! That will help.

 
Comment by Mohit
2006-11-25 21:46:25

Hi Awesty,
I was just wondering if there was some way of selecting the sword when you have it in your inventory.

 
Comment by eb264
2006-11-26 08:13:00

@mohit: id say that will be in the next tutorial

 
Comment by David
2006-11-26 20:56:16

when will the next tutorial be out?

 
Comment by iAnimate
2006-11-27 04:51:35

thanks for the tutorial
http://denvish.net/ulf/1164564329_RPG Item example.php

that’s hat i made from it
I made few altercations though
1: for movement i used friction etc from the other tut

2: instead of playing with the MC’s alpha, i used blank keyframes, so my code was like

onClipEvent(enterFrame){
if(this.hitTest(_root.knight)) {
this.gotoAndStop(2);
_root.inventory1.gotoAndStop(2);
}
}

great tut, look forward to more by you

 
Comment by Zach
2006-11-27 10:51:17

How do you make a flash game on your own?Cause I want to make one but I dont know how to…

 
Comment by awesty
2006-11-27 16:20:43

@iAnimate: Nice, I never thought of that. I might have to try it out. ;)
Btw, I don\’t think denvish works anymore.

@Zach: Just apply all your knowledge from tutorials into your game.

 
Comment by awesty
2006-11-27 17:26:03

@Mohit: Yea, what eb264 said. There are so many tutorials I am trying to do at the moment I keep forgetting them.

@David: Do you mean one in particular? Because I try to add at least one every week, plus maybe a few articles or something. But I have been a bit slack lately because I have had other stuff to do.

 
Comment by Bryce K :P
2006-11-29 13:48:01

dude you should make like a Ninja game it would kick ass, you know like running up walls and like sticking to them using a Samurai Sword and some sherikans (ninja stars) that would be sick! (Also if you don’t know wut i mean play Matrix Bullettime Fighting [I furgot wut website it was on but u can search it up on google :)])
Just a though :)

 
Comment by Bryce K :P
2006-11-29 13:48:30

Just a thought*

Comment by Jesse Subscribed to comments via email
2010-07-20 13:13:04

would your name be kittle by any chance

 
 
Comment by awesty
2006-11-29 15:41:40

Do you mean a tutorial about it or actually make it?

 
Comment by Bryce K :P
2006-11-30 01:12:21

actually make it :) then we can all play it :)

 
Comment by Dorian
2006-11-30 02:11:24

Where do you find good life ,of course in the games .beause in the real life ,we have many distresses and pain, only in the games if we have enough gold to buy the good arms,and we can play the games well :)

 
Comment by awesty
2006-11-30 11:11:47

@Bryce: Lol, that would take ages and involve a fair bit of coding. I don’t know if I’m up for it. :P
@Dorain: …

 
Comment by Angel
2006-12-01 15:50:40

I understood the tutorial, but I’d like to know how to make the character throw an object, and how I can make an enemy move and throw an object at random and harm the character on contact.

 
Comment by awesty
2006-12-01 16:19:30

I will do a tutorial on birds eye view AI.

 
Comment by RedV
2006-12-02 11:47:41

how can i make it change character frames when i turn?

 
Comment by awesty
2006-12-03 17:40:43

That script already makes it go to the 2nd frame, if you want it to go to different frame just change the number.

 
Comment by gram669
2006-12-03 23:22:31

this tut is very good but i wanna know more about buying and trading inventory system… anyone has that kind of tut please let me know..? TNX…

 
Comment by =ßoC= Darker
2006-12-04 02:04:24

Nice tut. it helped alot. I know this isnt topic related but does anyone have a tut on how to make a certain key play a certain noise, cause i want to make a game that allows you to play an instrument but you have to hit certain keys to get points, i hop you know what i am talking about.

Thankyou,
Darker :D

 
Comment by Bryce K :P
2006-12-04 02:44:53

Awesty i have a “money shop” but im trying to make it when you have $10 (U.S.A. currency) you cant buy a $100 thing but when i click (buy $100 thing) it will say -$90 then it will say you have no money. this is hard to explain so ill send you a .fla file, (but my e-mail isn’t working to well and doesnt recgonize ur e-mail address so e-mail me then ill reply with the .fla file) my e-mail is ekusnierz@san.rr.com :) ty

 
Comment by Bryce K :P
2006-12-04 02:54:06

also when i e-mail you the .fla file can you give me some advice to? as when you buy the item it goes into your inventory? (ill have to make an inventory tho :))

 
Comment by =ßoC= Darker
2006-12-04 03:14:11

can you show me how to make a currency, cause i really want to make a full flash game, if anyone has a different tutorial site please post it. It wouldnt really work to send me an email tutorial because my email doesnt work.

Much Appreciation,

Darker

 
Comment by awesty
2006-12-04 12:38:10

@Bryce K: I got you email and replied.

@Everyone else: I will try to implement these into future tutorials.

 
Comment by RedV
2006-12-04 13:13:19

ok i got everything working except this… i want my guy to permanently change frame when he pics up a sword so he goes from regular “man” to “sword man” so to speak…. when i step on the sword it changes the frame but when i step off it changes back….

please help me!!!

 
Comment by awesty
2006-12-04 16:52:05

Okay, change this:

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
this._alpha = 0;
_root.smallItem._alpha = 100;
}
}

To this:

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
this._alpha = 0;
_root.smallItem._alpha = 100;
_root.man.gotoAndStop(FRAME);
}
}

Just replace FRAME with the frame number of the “sword” man.

 
Comment by RedV
2006-12-04 17:29:02

well darn it still not working…. do you think i could send it to you and u can try to see whats wrong?
it would be a great help

if so then whats your e-mail?

 
Comment by =ßoC= Darker
2006-12-05 01:23:07

make sure he has the instance name of man. :)

 
Comment by Bryce K :P
2006-12-05 13:41:26

awesty i replied the e-mail :P

 
Comment by awesty
2006-12-05 16:05:05

@RedV: admin[@]awestyproductions[.]com

@Bryce K: Yep. I might not reply tonight, I will when I have time.

 
Comment by gram669
2006-12-05 16:23:50

awesty do you have a tut on rpg inventory.. i mean with trading system or buying items.. please let me know where i could have that kind of tut..

TNX A LOT…

 
Comment by Bryce K :P
2006-12-06 13:09:14

okey dokey :P

 
Comment by awesty
2006-12-07 15:30:47

@gram669: To tell you the truth I have never seen a tutorial like that. Maybe I might do one.

 
Comment by @""£barns£""@
2006-12-09 23:19:38

im sorta new to this flash, is there and easier way to understan this?

 
Comment by RDB2006
2006-12-10 02:30:50

Hi. Good tutorial! Ive got one problem - when i load the game the small sword is already in the inventory box, and the big sword is on the ground (but it can still be picked up) cud u plz help?

 
Comment by eblup
2006-12-10 05:29:01

hey he dosent walk diagnal waaaaaaaaaaaaaa but still nice work

 
Comment by eblup
2006-12-10 07:56:09

plz make him walk diagnal.

 
Comment by awesty
2006-12-10 11:12:11

@@”"£barns£”"@: No.

@RDB2006: Click on the small sword and in the properties panel you should see a drop down menu called Color. Click on it and select alpha. Make it 0.

@ebulp: Maybe.

 
Comment by RDB2006
2006-12-10 21:49:34

i tried it, nd still doesnt work. WHen i change its alpha to 0 it can still be seen when i preview the game, and it also changes every other movie clip’s alpha to 0, and nothing disapears
:S

 
Comment by RDB2006
2006-12-11 00:22:33

Im using all this stuff in ur tuts to put together a wee game, but im stuk, i have 4 drawings of my chacrater, he has his back facing towards you, he is facing you, he is facing left, he is facing right. Do you know how to make it so that when you use the arrow keys, the picture will change? e.g u press the left key and the picture of im facing left comes up, etc?

 
Comment by eb264
2006-12-11 01:23:23

@RDB2006

name each frame of what the picture is of (eg. left, right, front, back)

and use this code:

onClipEvent(load){
if(Key.isDown(Key.LEFT)){
this.gotoAndPlay(”left”);
}
if(Key.isDown(Key.RIGHT)){
this.gotoAndPlay(”right”);
}
if(Key.isDown(Key.UP)){
this.gotoAndPlay(”back”);
}
if(Key.isDown(Key.DOWN)){
this.gotoAndPlay(”front”);
}
}

the last 2 are based on if when you press the UP arrow key, you want his back facing you (eg. he’s moving away from the screen) and when the DOWN arrow key is pressed, you want him to move towards you and face you. Should work

 
Comment by RDB2006
2006-12-11 04:17:14

kk ty eb ill try it soon

 
Comment by awesty
2006-12-11 15:45:29

Yep, eb246 is right. But I prefer to use frame numbers than labels, but that is just a personal choice.

Also you could use

if(something){
do this
}else if(somethign){
do this
}

So then it doesn’t jerk up when someone pushes two buttons at once.

 
Comment by RDB2006
2006-12-11 18:14:58

i made 4 frames with the diff pics, nd i put the code on everyguy. It still doesnt work, but no errors come up :S

 
Comment by awesty
2006-12-12 15:54:23

An error only comes up if there is a problem with the syntax, not if it doesn’t do you want it to since flash can’t tell what you want it to do.

You only need 1 MC, and put that code on it.

 
Comment by Gray
2006-12-12 22:25:05

I’m trying to make an RPG and i’ve run into a problem:

How do you link scenes/frames together so that when you hit a door the scene/frame(which ever is easier) will switch to the inside of a room.

I know it has something to do with the hit.test action script code but I can’t figure it out

 
Comment by RDB2006
2006-12-13 02:53:42

@Gray - Copy and paste this code into the door.
onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
_root.gotoAndStop(41);
}
}

Change 41 to whatever frame number the inside of the building is on. nd make sure the instance name of your char is man.

 
Comment by rrr444
2006-12-13 02:55:01

how do u make it so that when your char hits an object, a picture and text will appear without it changing frame, and when you bring your character off the object, it disapears. Im tryna make a game like the sims…..

 
Comment by rrr444
2006-12-13 02:56:38

and does anybody have a good name for my game? i want a really good name but my mind is completley empty

 
Comment by RDB2006
2006-12-13 03:04:54

k so i have only once MC (Guy facing towards u) nd put this code on it

onClipEvent(load){
if(Key.isDown(Key.LEFT)){
this.gotoAndPlay(”left”);
}
if(Key.isDown(Key.RIGHT)){
this.gotoAndPlay(”right”);
}
if(Key.isDown(Key.UP)){
this.gotoAndPlay(”back”);
}
if(Key.isDown(Key.DOWN)){
this.gotoAndPlay(”front”);
}
}

nd i replace down nd stuff with numbers? nd leave the guy facing left, right, and back facing you, non movie clips?? :S

 
Comment by Gray
2006-12-13 05:26:14

thanks that really helped

 
Comment by awesty
2006-12-13 17:22:59

@rrr444: You would have to put something like this on it:

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
this._alpha = 100;
}else{
this._alpha = 0;
}
}

Just change man to whatever the MC is called.

@RDB2006: You can replace “LEFT” etc with the numbers of the frames if you like, or you could give the frame facing left the name left, the frame facing right the name right etc.

 
Comment by rrr444
2006-12-13 18:03:39

wouldnt i hav to put code on the text and the person i wana walk into?

 
Comment by yakult
2006-12-13 18:08:27

can somebody help me?
when the player moves the man, and it hits the door, and then also presses a button, then it leads to another frame?

 
Comment by yakult
2006-12-13 18:20:13

hi umm i want to make a game can somebody tell me
i know how to walk into an object and get to a different frame but how do you get it so that when you come out of the frame you went into, (say a shop,) it returns you next to the door, not originally where your character started out on that frame. any help????

 
Comment by mike
2006-12-13 18:29:43

hey im realy looking foward to the next tutorial
keep em coming when is the next one lined up for

 
Comment by gram669
2006-12-14 00:41:13

awesty: tnx so much.. im looking forward on it.

 
Comment by eb264
2006-12-14 02:01:27

@RDB2006

you need to have a movieclip with the four frames inside and a stop(); action on each frame. then on the main scene, click once on the character and put the code in the actions panel. don’t forget to name each frame

 
Comment by no1jock
2006-12-14 03:24:18

thanks for the tut it helped me. Would it work if you sent it by email to your cell phone? I mean would you be able to play it because cell phone games are java but still…

 
Comment by rrr444
2006-12-14 06:12:34

ok. Ive set a specfic text field to alpha 0. When you click a button, i need it to appear. Can you help

 
Comment by ptp
2006-12-14 13:29:38

how do you put to guys in MC and then switch between them.

 
Comment by John
2006-12-15 04:23:18

I need help with mine, How do you make a wall, I mean so you just make like a rectangle and like instance name it wall or w.e and the hole thing turns into a wall? Instead of just keep naming top one top1 bottom one bottom1 and so on. Also if theres actionscript tell please :D

 
Comment by Bryce K :P
2006-12-15 10:32:19

can someone tell me wuts worng with my Xp bar its malfunctioning http://www.swfup.com/swf-view.php?id=3345

 
Comment by awesty
2006-12-15 11:37:46

@rrr444:

on(release){
_root.TEXT._alpha = 100;
}

Just change TEXT to whatever the text MCs instance name is.

@yakult: So you want that to happen?

Once you have the button and the door, put this code on the button:

on(release){
if(_root.man.hitTest(_root.door)){
_root.gotoAndStop(FRAME);
}
}

You would obviously have to change the doors instance name to what it really is and change FRAME to what frame you want it to go to.

About the door thing, you would use a variable, so when it hits the door, door = true. So when it enters the shop if(door = true) it starts off in a certain _x and _y coordinates.

@no1jock: As far as I know, it wouldn’t work.

@ptp: You would need to put them both into 1 movieclip, one on the 1st frame and one on the 2nd. And then to use the first do _root.man.gotoAndStop(1);. Just change the frame number depending on which one it is. Make sure the guy has an instance name of man though.

@John:

http://www.awestyproductions.c.....h-hittests

@Bryce K:

Can you post or send me the code so I can have a look at it?

 
Comment by awesty
2006-12-15 12:12:52

@mike: Hopefully over the next few days.

 
Comment by Bryce K :P
2006-12-17 01:06:56

okay i e-mailed the code to you, plz post it in the forums cause the e-mail isnt workin rite

 
Comment by awesty
2006-12-17 11:27:55

There are no errors anymore, but it doesn’t jump. I wasn’t sure what it was supposed to do so I just left it like that.

onClipEvent(load){
var jump:Number = 0;
var falling:Boolean = false;
var g:Number = 4;
}
onClipEvent(enterFrame){
if(jumping == false){
if(!falling){
jump = 0;
}
if(Key.isDown(Key.UP)){
jump = 15;
jumping = true
}
}
if(jumping == true){
jump -= 1;
}
if(jump <= -10){
jump = -10;
}
for(i=0;i if(jumping == true && this.hitTest(_root[”ground” i])){
//Is there supposed to be some code here?
}
}
if(Key.isDown(Key.LEFT)){
this._x -= 5;
}else if(Key.isDown(Key.RIGHT)){
this._x = 5;
}
for(i=0;i if(!jumping && !this.hitTest(_root[”ground” i]) && !falling){
falling = true;
this._y -= 1;
}
if(falling == true){
for(i=0;i if(this.hitTest(_root[”ground” i])){
falling = false;
}
}
jump -= 1;
}
}
}

 
Comment by Bryce K :P
2006-12-18 00:06:45

wasn’t even close to working had to many errors (and i did fix most of them)

 
Comment by Eddie
2006-12-18 08:33:53

I have problem, everythings right, instances, MCs, all that other stuff but one my character touches the pick-upable object it doesn’t do anything. Help?

 
Comment by awesty
2006-12-18 10:32:49

@Bryce K: That is very weird, it didn’t have any errors for me. :(
@Eddie: What version of flash are you using?

 
Comment by Bulletluigi
2006-12-18 11:57:25

Awesty this tutorial is really good, but since you use alpha you would have to have a different inventory slot for every item in the game right?
I’m not saying it isn’t still a good idea, but I searched a lot and found a pretty cool way to make a little bit better one, though it takes a whole lot more scripting.

For each of your item slots you name them, itemSlot1, itemSlot2, itemSlot3, and so on..

this is the script for the items -
onClipEvent (enterFrame) {
if (_root.character.hitTest (this)) {
_root.addToslot (this);
}
}

this is for frame one -
currentslotnum = 1;
stop ();
function addToslot (item) {
if (!item.found) {
item._x = eval (”itemSlot” currentslotnum)._x;
item._y = eval (”itemSlot” currentslotnum)._y;
item.found = true;
currentslotnum ;
}
}

make sure that your moving symbol is instance named - character

It worked perfectly for me and i give praise to the person that thought of this beautiful actionscript.

P.S. - Awesty I still think you are the best ^.^

 
Comment by no1jock
2006-12-18 22:28:11

how do you make a flash button link to a html link?

 
Comment by awesty
2006-12-19 17:56:00

@BulletLuigi: Yes, that is a much better code. I will be using that from now on.

@no1jock:

on(release){
getURL(”URL”);
}

 
Comment by Bulletluigi
2006-12-19 18:57:39

Yea it is awsome, I have been doing adjustments like, making the “I” key change the alpha of the items in the slots and the inventory from 0% to 100% its great.

 
Comment by Bulletluigi
2006-12-19 18:59:20

Oh yea, hate to double post like this, but i wanted to ask you something about the script that i posted for the inventory. I understand all of the script, but I am not familiar with “eval” could you explain that to me?

 
Comment by no1jock
2006-12-19 22:16:23

ty for the code, but this error came up. What do i do?

**Error** Scene=Scene 1, layer=menu, frame=1:Line 2: ‘)’ or ‘,’ expected
getURL(http://www.awestyproductions.com/tutorials/flash-tutorials/making-an-rpg-type-game/#more-33);

 
Comment by Bobkins
2006-12-19 22:19:41

good tutorial awesty. Im making an rpg, and i need help with some code. Im having it on my game that when you walk into an object (movieclip,) if you have variables, then it will take you to another frame. I tried this code:

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
if _root.kill = 3;
‘(’
if _root.drug = 14;
‘(’
_root.gotoAndStop(207);
}

is it something like that? cuz it isnt working for me. If it isn’t plz post me the exact code if it isnt 2 much trouble becuz im rubbish at following detailed intrsuctions.. lol :S

thanks

 
Comment by eb264
2006-12-20 00:45:14

@no1jock

put inverted commas (” or ‘) at the start and end of the web address. it would be something like:
on(release){
getURL(”http://www.awestyproductions.com/tutorials/flash-tutorials/making-an-rpg-type-game/#more-33″);
}

i think thats it

 
Comment by no1jock
2006-12-20 02:28:25

ty for ur help

 
Comment by ???
2006-12-20 21:02:48

there is a problem with my game. When you press the W,A,S,D, keys it rotates weird. one minute its in the centre, then when you press the keys, it rotates around the centre can anybody help me pleez?

Comment by Nicholas Subscribed to comments via email
2007-11-30 05:02:18

if you open up your mc the little crosshair is the pivot point so basicly you have to put the midlle of the charecter on the pivot point.

 
 
Comment by grimm_88
2006-12-20 21:08:58

hi, im making an RPG game aswell, does anyone know how to make a shop so that you can click on something that costs £10 and you have £15 it goes into your inventory, and your money goes down to £5, but if you try and click on something that costs £20 it will say ‘not enough money’ and i also need to know how to make it so you can’t buy something more than once, because that would just waste your money.

I also need to know how to make it so that if you buy some gloves and equip them only your gloves change but the rest of your character stays the same. And you can buy everything like chestplates and plate-legs and gloves and weapons and shields and boots and helmets and leather armour all separately and equip the seperately, but still make the character walk right and attack and stuff.

the only way i can think of doing this is to make each part of the body a seperate movieclip, but that takes a very long time and i have to animate them all seperately and position them in the right place on the body. but this leaves the problem of how to make the bodyparts move to the right place when you equip another item. I suppose i could keep them all in the same place and change the alpha of the equipped item to 100% and the alpha of all the other items to 0%

any help is greatly appreciated and i will put your name in the credits of my game.

 
Comment by bulletluigi
2006-12-21 01:02:59

@??? if you send me the .fla file ill check it out for you. My email is bulletluigi@hotmail.com

@grimm_88 While i am typing this i have flash open and i am trying to make a whole currency system for buying and selling. I’ll post when i figure it out if awesty doesn’t post the exact script when he reads your question.

 
Comment by eb264
2006-12-21 01:29:14

@grim_88 ive done somthing like that, ill find it for you now. this is the code that i would use, it should work.

on(release){
if(_root.euroe >=10){
_root.inventory.torch.gotoAndPlay(2);
_root.euroe -= 10;
}else _root.euroe =0;
_root.info = “not enough money”;
}

put that on a button of something. the way i have it is that the inventory is a movieclip with a blank first frame and the second frame is full of whatever is in the inventory. when you press a button it opens the inventory and you can choos whatever you want. change euroe to whatever is the variable for your money (ive used a dynamic textbox), torch is the name of the item, that is built the same way as my inventory and awesty’s sword above. info is a dynamic text box i have which tells the player hints and stuff throughout the game. if you want any help or can’t get it to work, email me at: eoin264[at]hotmail[dot]com

 
Comment by eb264
2006-12-21 01:32:05

sorry, that should be:

}else _root.euroe -= 0;

 
Comment by grimm_88
2006-12-21 06:33:58

thanks to both of you bulletluigi and eb264, that helps a lot. to be honest i didn’t expect such a quick reply since i could never find a tutorial on how to do it.

 
Comment by Bulletluigi
2006-12-21 07:21:40

Alright.. I have created a pretty nifty shop/merchant system. Its a pretty long explination ,but with the smallest amount of and the most simple of actionscript. I love actionscript, but i’m not very advanced in it. I am really proud of my creation though. If you would like to see my shop/merchant system .fla or .swf and or an explination of it just send me an e-mail. - bulletluigi@hotmail.com -
(I try not to steal glory off of awesty’s site, you know let the pro explain the stuff on the site. I’ll just tell those or you that are interested in seeing new ways of doing small programs for games in my e-mail. If you are terrified at the idea of making your own shop/merchant program for your game just send me an e-mail and i’ll be more than happy to send it your way with any explaining you need)

 
Comment by awesty
2006-12-21 11:25:25

@BulletLuigi: Copied right from the flash help:

In Flash 4, eval() was used to simulate arrays; in Flash 5 or later, you should use the Array class to simulate arrays.

“In Flash 4, you can also use eval() to dynamically set and retrieve the value of a variable or instance name. However, you can also do this with the array access operator ([]).

In Flash 5 or later, you cannot use eval() to dynamically set and retrieve the value of a variable or instance name, because you cannot useeval() on the left side of an equation.”

I think you are better off using this[] instead of eval() in the more recent versions of flash. But eval() is still accepted.

@???: Send it to bulletluigi if you want. If he can’t help you, feel free to send it to me.

awestyproductions[@]gmail[.]com.

@grim_88: You are asking alot. I am going to continue this tutorial, so you can equip the sword, and maybe you can figure it out from there.

For the shop, I will try and do a tutorial.

Wait, I just read the other two posts, if bulletluigi and eb264 have solved the problem, I won’t worry about the tutorial.

Btw thank you bulletluigi and eb264, you guys are helping alot. It is hard to answer and solve all these peoples problems.

 
Comment by awesty
2006-12-21 11:51:07

@Bobkins:

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
if(_root.kill = 3){
if(_root.drug = 14){
_root.gotoAndStop(207);
}
}
}
}

That might work, but Im not really sure what it is supposed to do.

 
Comment by Bobkins
2006-12-21 23:38:39

just for my rpg, if you have drestroyed enough drugs and killed enough criminals it just says u win :D

 
Comment by RDB2006
2006-12-22 01:50:45

oi:@ thats my game ur copyin

 
Comment by Bulletluigi
2006-12-22 05:39:52

Awesty couldn’t you just make it this? -
onClipEvent(enterFrame){
if(this.hitTest(_root.man) && _root.kill = 3 && _root.drug = 14){
gotoAndStop(207);}
}

 
Comment by awesty
2006-12-22 11:04:38

You could, but then if you wanted to put some code if you only wanted it to hit man, you would have to write another line, when for mine, you don’t.

It just depends on what suits you best.

 
Comment by Bulletluigi
2006-12-22 14:30:09

alright thanks, just wanted to see if it would work.

 
Comment by mark
2006-12-23 00:08:39

how do u apply code the movie clips to the frame of a mc timeline

 
Comment by awesty
2006-12-23 12:34:59

Do you mean how to you apply code to a frame inside a MC?

Just double click the MC, click the frame and open the actions panel.

 
Comment by jake02
2006-12-23 20:45:41

hi does anybody no the code that you put on the man mc that when you press the right arrow key it faces right, and when you press the left arrow key it also faces left, and walks?

 
Comment by Tom
2006-12-23 20:58:59

hi,

i have just used your RPG movement tutorial to find that when i move the character they didnt just move on the spot it moved up slightly as well, is there a way i can make the character turn on the spot?

Thank You

 
Comment by Bulletluigi
2006-12-24 14:58:49

@jake02- If you mean in a platform type game then this would be the code :

onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
this._x = 5;
this._xscale = 100;
gotoAndStop(2);
} else if (Key.isDown(Key.LEFT)){ this._x -= 5
this._xscale = -100;
gotoAndStop(2);
} else if (!Key.isDown(Key.RIGHT) &&
!Key.isDown(Key.LEFT){
gotoAndStop(1);
}

that code only works if you have the second frame of the mc a walking clip and the first frame of that mc an idol position.

@Tom- You probably don’t have your rotation point in the center of your characters head. You can move it by using the Free Transform Tool and selecting your character. Then you should see a white dot. Drag that dot to the center of the characters head.

 
Comment by jake02
2006-12-24 20:43:18

@Bulletluigi
no i mean like this tutorial, it uses the W,A,S,D keys to rotate and move. I need the same code but i do not have a walking animation, and using the arrow keys.

 
Comment by dragonguy
2006-12-24 20:49:35

hi could some1 explain to me what the code is to get the drag and drop function.

 
Comment by RDB2006
2006-12-24 20:50:17

@dragonguy
Paste this code on the item(s) you want to drag

on(rollOver)
{
Mouse.hide();
}

on(press) {
startDrag(this);
}

on(release) {
stopDrag();
Mouse.show();
}

on(rollOut)
{
Mouse.show();
}

 
Comment by Bulletluigi
2006-12-25 04:15:30

@jake02 - k in that case you would just do this:

onClipEvent (enterFrame) {
if (Key.isDown(Key.LEFT)) {
this._rotation = 0;
this._x -= 3;
} else if (Key.isDown(Key.RIGHT)) {
this._rotation = 180;
this._x = 3;
} else if (Key.isDown(Key.UP)) {
this._y -= 3;
this._rotation = 90;
} else if (Key.isDown(Key.DOWN)) {
this._y = 3;
this._rotation = 270;
}
}

For this code to work properly your man should be facing left. You only need 1 MC for this, no extra frames needed. just paste this on the MC’s actions panel that you want to move. Good Luck !

=^.^=

 
Comment by KatyS
2006-12-27 00:15:23

hello i know some stuff about flash.. around intermediate level. I was wondering if somebody could help me make a pet game, where you get money and buy pets, feed them etc and try and keep them alive. Is that a bit too complicated or hard? can some1 please msg back and help me. thnx.

 
Comment by Bulletluigi
2006-12-27 03:01:05

KatyS that is a really awsome idea. Mainly because I haven’t seen one made in flash before. The idea takes me back to those little games that were on keychains. Really the only hard part in making it would be giving the pet the AI to get hungry at a certain time, when it uses the bathroom , ect. It is a really great idea though. I will look into finding a way to make that AI if awesty doesn’t already know. =^.^=

 
Comment by KatyS
2006-12-27 05:51:02

thnx :]

 
Comment by eb264
2006-12-28 08:33:42

@KatyS: if you wanted, i could try my hand at the AI, I havent done AI before so it mightnt be successful, but I’ll give it a try.

 
Comment by eb264
2006-12-28 08:40:16

actually, forget about that, its too advanced for me

 
Comment by Bulletluigi
2006-12-28 12:23:58

lmao, sorry for laughing, but both of these posts are in the same day.

@KatyS: Most of the people that post on this site are here learning (mainly the basics), besides Awesty of course. The Flash Teen Prodegy, i’m sure he could help you out if you needed it.

 
Comment by awesty
2006-12-28 17:53:22

@KatyS: I started to make one of those, but never finished it. You can have the .fla if you want, Im not sure how much I have done (I don’t think it is very much at all).

@BulletLuigi: lol, I am still learning. I have taken some tutorials today. Btw, if you think I am good at flash, have a look at this. It is done by a 14 year old with no use of 3d programs, all actionscript.

http://img176.imageshack.us/my.....ter4ee.swf

 
Comment by awesty
2006-12-28 17:54:06

Btw, thanks for helping out with answering the comments.

 
Comment by Bulletluigi
2006-12-31 02:06:36

Yea, that cube would be freaking hard to make with actionscript. If he did it without any help that is amazing.

 
Comment by RDB2006
2007-01-01 00:46:59

@KatyS: I would think almost all of it would work by variables, apart from the AI part. You would have hunger variables, hunger xp varibles etc. I imagne everything apart from the AI part will be beginner level. You could even make it loose weight by taking it on walks etc etc.

 
Comment by david
2007-01-01 12:59:58

your tuts are great there a godsend but i was wondering how do you make it when you press the x key it triggers a command. like to attack with a sword?

 
Comment by RDB2006
2007-01-02 01:01:55

@David: The code would be something like this:

if(Key.isDown(88)){
this.gotoAndPlay(2);
}
}

and on frame two you would have a stop(); action and then on frame 3 you would start the animation of attack. The attack could last two frames, twenty, one hundred, ten, etc, etc.

 
Comment by awesty
2007-01-02 10:44:49

Or you could have a MC on frame two, that contained the animation, so you could have,

if(Key.isDown(88)){
this.gotoAndStop(2);
}
}

 
Comment by awesty
2007-01-03 01:55:17

Hey Awesty,

Nice Explanation !

I used a similar (though more complex) system for the RPG I am developing.

Working on new battle system at the moment which will call the attack function on an interval for each PC or Monster in the initiative array. Then call child functions also on intervals to move the attacker to the target x and y, hit them, then move back again.
calling functions on intervals which call other functions on intervals is certainly interesting anyway.

PS. Fash8 AS2 are awesome !!
though saying that can’t wait to get on AS3 with the inbuilt timer class and other added goodies.

Good luck with your further tutorials.

Tom

 
Comment by awesty
2007-01-03 01:58:07

If you want to look for yourself you can check it out on www.bathwebdesign.com

Please bare in mind that this is still in the early stages of development and is no where near finished.

Other than that enjoy, and I appreciate any comments !

Thanks Awesty !

Tom

 
Comment by awesty
2007-01-03 11:28:36

That is really cool. I can’t wait to see the finished version.

 
2007-01-04 12:12:16

[…] In this tutorial, we will be continuing the last RPG game tutorial. If you haven’t already taken it, you can find it HERE. […]

 
Comment by tom
2007-01-05 12:50:25

Wow thanks Awesty!

blatantly keep you posted for the final version.

Ps. Part 2 tut was great btw!

keep ‘em coming !

 
Comment by Pedro
2007-01-08 12:22:03

hi, your turtorials r good but…. i cant figure out the invintory pick up thing??? when my “man” goes to the item on the ground nothing happens, and i put the coad in that…

 
Comment by Pedro
2007-01-08 13:56:39

lol, ok i kinda figured it out, i made my “man” “pick up the item” but the “small item” is visible before i pick anything up so it dosnt look like i picked up the “item”

 
Comment by Pedro
2007-01-10 00:52:47

lol srry bout all the questions but how do you mae a wall lol like im makinf an RPG game and i need to make houses and stuff so i want to be able to not like walk on the house. sooo yea loluuuh bye

 
Comment by eb264
2007-01-11 01:31:35

bloomin grammer and spelling these days

 
Comment by awesty
2007-01-13 15:53:38

@Pedro: On the first frame, try putting this:

_root.smallItem._alpha = 0;

Also try this tutorial:

http://www.awestyproductions.c.....ts-part-2/

By the way, please stop murdering English.

 
Comment by Pedro
2007-01-15 02:44:00

AH! Its not working? Hey awesty, can i have the file that you made to help me because im lost.. :(

 
Comment by awesty
2007-01-15 14:33:55

Can you just send the .fla to

awestyproductions[@]gmail[.]com

 
Comment by Seerex
2007-01-16 01:35:27

hi, PLEASE awesty help me here, i got everything right but when the char picks the item up, it perfectly goes to 0 alpha, but the item in the inventory doesnt go to 100..

can u help me?

 
Comment by somebody
2007-01-17 06:52:54

whenever I try to maek the guy walking into amovie clip it only makes a movie clip of one frame

 
Comment by Davo
2007-01-17 17:14:36

Hey i know this is probly pretty stupid but i havent done alot of making games in flash and i want to get into it.

Here is my problem.

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Clip events are permitted only for movie clip instances
onClipEvent(enterFrame){

Im pretty sure i have everything as you said. please help.

 
Comment by awesty
2007-01-18 11:12:22

@Seerex: Make sure all the instance names are right.

@somebody: I dont know what you mean.

@Davo: You have to put that on a MC, not the frame. ;)

 
Comment by Crapface
2007-01-26 09:37:04

what? ;)

 
Comment by Crap_Face
2007-01-26 09:38:57

(T)

 
Comment by awesty
2007-01-26 11:23:47

You keep making less and less sense everytime you post.

 
Comment by Tobit
2007-02-03 10:16:10

for some reason I cant get the walking animation to work. Can someone help me. I dont quite understand how you can add actionscript to two differnt Movie pics on one movie pic.

 
Comment by awesty
2007-02-03 10:53:25

Okay… You make one MC of him standing still, and one of him walking. Then you make another blank MC (ctrl+F8). On the first frame of this put the idle MC on it. On the second frame put the walking MC.

 
Comment by Jake
2007-02-04 12:23:16

this ws really helpful but, can you tell me or direct me to a site that will teach me how to make a game like Mario Bros?

 
Comment by awesty
2007-02-05 20:12:46

@Jake: There are tutorials on this site that will teach you all you need to know the make a simple game like that.

 
Comment by callum
2007-02-06 15:41:15

i would really like to make a rpg game but the prob is i dont under stand where u make the game under

 
Comment by Levi
2007-02-13 11:26:27

How do you add the actions for the items that you select?

 
Comment by to levi..
2007-02-17 01:29:36

u have to convert the items u select into movie clips and then right click the item and select actions where you will add actions for it

 
Comment by fb
2007-02-21 15:59:46

i cant pick up the item but every thing else works

 
Comment by lars
2007-02-24 01:08:17

hello awesty, my man just walks right over the item..

tryed reading if others had same problem, but couldnt find anyone… please help me, got everything just as u said, but man just walks over it.. or actually the item is above the man, but he dont pick it up?

 
Comment by Kurt
2007-02-24 09:11:45

How really do i set the alpha to 0???

 
Comment by Kurt
2007-02-24 09:15:03

and lars i don’t think you gave the small item an alpha of 0 and if you did change this :

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
this._alpha = 0;
_root.smallItem._alpha = 100;
}
}

To this:

onClipEvent(enterFrame){
if(this.hitTest(_root.man)){
this._alpha = 0;
_root.smallItem._alpha = 100;
_root.man.gotoAndStop(FRAME);
}
}

well Awesty said that way above.

 
Comment by Kurt
2007-02-24 09:16:49

oops nvm thats if you want your gut to have a sword in his hand when he gets the sword.

 
Comment by Kurt
2007-02-24 09:17:20

lol guy! not gut.

 
Comment by Kurt
2007-02-24 09:28:57

Awesty i have the exact problem as “lars” I know about alpha thing now though it was pretty obvious to find it though.

 
Comment by awesty
2007-02-24 10:07:02

@Callum: You need Macromedia/Adobe Flash.

@Levi: You have to open the actions panel.

@fb: Make sure you havent missed anything.

@Kurt & Lars: Make sure you have the alpha level right.

 
Comment by Kurt
2007-02-24 12:09:35

I do…

 
Comment by Kurt
2007-02-24 12:10:20

what should the instance name of the big sword be though?

 
Comment by Kurt
2007-02-24 12:23:28

Who ever likes using the arrow keys here is the code you put in the man.

onClipEvent(enterFrame){
if(Key.isDown(Key.LEFT)){
this._rotation = 270;
this._x -= 10;
this.gotoAndStop(2);
}else if(Key.isDown(Key.RIGHT)){
this._rotation = 90;
this._x += 10;
this.gotoAndStop(2);
}else if(Key.isDown(Key.UP)){
this._y -= 10;
this._rotation = 0;
this.gotoAndStop(2);
}else if(Key.isDown(Key.DOWN)){
this._y += 10;
this._rotation = 180;
this.gotoAndStop(2);
}else{
this.gotoAndStop(1);
}
}

 
Comment by Kurt
2007-02-24 12:24:03

instead of letters.

 
Comment by awesty
2007-02-25 13:02:11

@Kurt: It should say in the tutorial, but I have a feeling it doesnt need one.

 
Comment by Kurt
2007-02-26 02:58:00

Me too. I’m making a game half adventure quest half runescape so when you attack something it’s like attacking in adventure quest and you walk around lie in runescape but it would be different places and different graphics and this tutorial is helping alot.

 
Comment by Kurt
2007-02-26 03:11:51

I didn’t really need the timer though lol.

 
Comment by Kurt
2007-02-26 11:35:07

Lol i had instance name and the name you name something when you convert something into a symbol, mixed up.

 
Comment by xenofixus
2007-03-02 06:04:07

hey i am working on a flash RPG (with a bit of help from you :D) and I was having trouble with something. I am looking for a way to have the character follow through with the animation even after. I am making my character jump, attack, etc but I can not figure out a way for it to follow through with the animation after you hit the key once (not hold it down). any help will be appreciated.

 
Comment by xenofixus
2007-03-02 13:59:40

well i figured out how 2 make it follow through but now i have a problem with jumps, i cant get the jumps to follow through without holding the button and when i can get them through, i cant have the character move with them >

 
Comment by xenofixus
2007-03-03 14:20:14

ahh nevermind, fixed all the problems i had with my own jumping system

 
Comment by Lavco
2007-03-08 07:31:05

could you put a download of this flash game?

 
Comment by Sean
2007-03-09 22:20:12

hey, im stupid can u explain to me what i do after i make a character, i made a sword then i gave it the:
1.
onClipEvent(enterFrame){
2.
if(this.hitTest(_root.man)){
3.
this._alpha = 0;
4.
_root.smallItem._alpha = 100;
5.
}
6.
}

now whats the inventory system a MC? and what action script do i give it? im confusled

 
Comment by Moulay
2007-03-24 04:57:55

I can’t do the thing when you pick up the weapon it doesn’t pop up in the Inventory and i can’t make the copyed one go away.How do i change the alpha also.How do you

 
Comment by Moulay
2007-03-24 04:57:55

I can’t do the thing when you pick up the weapon it doesn’t pop up in the Inventory and i can’t make the copyed one go away.How do i change the alpha also.

 
Comment by awesty
2007-04-05 13:30:33

@sean: If you follow the tutorial step by step you should be able to figure it out.

@Moulay: Make sure all the instance names and stuff are correct.

 
Comment by connor
2007-04-27 07:10:59

Can you send me a Step by Step guide?

Comment by awesty
2007-05-01 20:35:09

No. That is the whole point of the tutorial. If you find it too hard maybe try something easier first.

 
 
Comment by Trunk Monkey
2007-06-04 05:37:06

i want to make the sword a key or a switch to open a door when you get it how can I do it

 
Comment by Snablet Dandy Subscribed to comments via email
2007-06-06 14:12:01

WHy do you still put AS on MCs? You can’t do that in CS3 so you should start preparing for it.

Comment by awesty
2007-06-15 13:53:03

This tutorial was written a long time ago. I don’t script on MCs anymore and I dont recommend anyone to do so.

 
 
Comment by Trunk Monkey
2007-06-14 02:32:49

When my character goes through a door he ends up on the wrong side of the room how can I fix it?

Comment by awesty
2007-06-15 14:01:36

You need to set his _x and _y again when he enters the room. So if he needs to appear in the middle of the left side you could put:

man._x = 0;
man._y = Stage.height/2;

 
 
Comment by Derek Dacosta Subscribed to comments via email
2007-06-20 11:30:00

Need Some Help Makin em run!

I’ve gotten the character to move perfectly but now im wondering how i would make my character run when the ctrl key is held. i’ve made my running frame (3) in my “man” movieclip but i need to know how to make him move faster when he’s running and how to make it so that shift has to be held while the arrow key is pressed to make him move.

Thanks, much appreciated.
I’ll check back for your reply.

Comment by SaroVati Subscribed to comments via email
2007-06-24 11:27:52

Hm, I don’t think I get your question completely but I’m going to tell you how to make him run if your holding the CTRL key.
Type on your character:

onClipEvent(enterFrame) {
if (Key.isDown(Key.CTRL)) {
gotoAndPlay(3);
this._”A” “B”= “C”;
}
}

“A” - either x or y, depending on moving up or down.

“B” - either - or +, depending on moving left/right or up/down.

“C” - speed that you want your character to move. If normal speed of walking was like 5 or something, make this at least 8-10.

 
 
Comment by SaroVati Subscribed to comments via email
2007-06-25 07:50:11

I’m making an RPG game and would like some help in a few categories =)

What I have done:
-Sound on/off
-Stat editor (Add stats to different categories and stuff)
-Custom cursor
-Shop system
-all the walls/hitTest
-all the movement
-the hp/mp, and all the other stats
-the guy who heals u for 10 gold xD
-inventory system
-alot of other minor details =)

In-progress:
-battle system, I got all the movement, jumping, and AI down in the battle system, all I need is equiping the items from the inventory to the guy. I can finish the damage stuff from there.
-maps, I’ve gotten the entire map for about 30 minutes - 1 hour of gameplay (when im done with battle system) but need a lil bit more, since the file is still TINY.

Trying to implement, but can’t find the codes/resources:
-pictures, mine are just squares, triangles, circles at the moment…. if u could gimme pictures, would b great xD Btw, I need a picture for main character… all help with images and stuff will be added to credits =)
-hehe how do I test out my preloader? I’ve tried pressing CTRL+enter twice but the screen just goes blank after that lmao. Anywhere to upload to test out the preloader? =)

Comment by SaroVati Subscribed to comments via email
2007-06-25 07:53:04

ooooo 2 things btw:
1. My email is xbzhaox(@)hotmail(dot)com
2. I’ll be able to respond quickly on most days, since apparently Gr. 8 is going to be easier than Gr. 7 xD (Gr. 7 was quite easy in my opinion xD)

 
 
Comment by SaroVati Subscribed to comments via email
2007-06-25 10:53:51

Hm…. after like 2-3 hours of trying to work it out, I FINALLY got the equip thingy to work xD Now, I need to know how to put it “on” the guy in combat. Seems it was quite easy acctually lol.

All i did was make the inside of the inventoryitem MC a button, then add:
on(release) {
_root.inventorywand1._x = _root.equipSlot1._x;
_root.inventorywand1._y = _root.equipSlot1._y;
}

Hehe then I put that code all my other items =)

Comment by awesty
2007-07-03 18:51:34

Well you could upload your .swf to http://www.swfup.com to test out your preloader. ;)

 
 
Comment by Derek Dacosta Subscribed to comments via email
2007-06-27 06:36:52

By make him run when control is held i ment, when control and the arrow key (left/right/up/down) is held then he’ll run in either direction.

 
Comment by Derek Dacosta Subscribed to comments via email
2007-06-27 06:37:34

meaning both keys need to be held for him to run.

 
Comment by SaroVati Subscribed to comments via email
2007-06-27 09:16:48

Omg I give up, typed out something 4 times and its not showing up. -.-

Comment by SaroVati Subscribed to comments via email
2007-06-27 09:19:22

“A” - the new frame of your guy standing still or running position.
“B” - the key that you want pressed down, e.g. LEFT,RIGHT,UP,DOWN etc.
“C” - instance name of your “man”
“D” - either x or y, depending on up or down.
“E” - either - or +, depending on up/down or left/right.
“F” - the new speed you want your guy to run at.

This hasn’t been tested and off the top of my head, so don’t be mad if it doesn’t work lol =)

Hope this helps =)

 
 
Comment by SaroVati Subscribed to comments via email
2007-06-27 09:23:07

Heres the first part
You could try:

onClipEvent(enterFrame) {
if (Key.isDown(Key.CTRL)) {
gotoAndStop(”A”);
}
}

 
Comment by SaroVati Subscribed to comments via email
2007-06-27 09:24:44

Heres the 2nd part LOL I had to split up, 3rd part is the first message up there.

//now, go to the inside of your “man”, and make a new frame of him standing still or in a running position, doesen’t matter. Make it a MC and type this on him://
onClipEvent(enterFrame) {
if (Key.isDown(Key.”B”)) {
_root.”C”._”D” “E”= “F”;
}
}

 
Comment by Derek Dacosta Subscribed to comments via email
2007-07-04 07:22:47

k SaroVati, i understand all the code i just have no idea where it goes :/

 
Comment by Derek Dacosta Subscribed to comments via email
2007-07-04 09:19:10

k well i figured it out in my own way
thanks for the helpthough.

 
Comment by Derek Dacosta Subscribed to comments via email
2007-07-04 09:20:52

If anyone wants to make there character walk on a angle and move faster when control is pressed heres the actionscript code (just substitute this for the one awesty has) also you’ll need to make a running movie clip and make that the frame after your walking one. kthx

LOOK AT POST BELOW FOR CODE.

 
Comment by Derek Dacosta Subscribed to comments via email
2007-07-04 09:23:07

onClipEvent(enterFrame){
if(Key.isDown(Key.CONTROL)){
runn = true;
}if(Key.isDown(Key.LEFT) && (Key.isDown(Key.UP) && (Key.isDown(Key.CONTROL)))){
this._rotation = 315;
this._y -= 5;
this._x -= 5;
}else if(Key.isDown(Key.LEFT) && (Key.isDown(Key.DOWN) && (Key.isDown(Key.CONTROL)))){
this._rotation = 225;
this._y += 5;
this._x -= 5;
}else if(Key.isDown(Key.RIGHT) && (Key.isDown(Key.DOWN) && (Key.isDown(Key.CONTROL)))){
this._rotation = 135;
this._y += 5;
this._x += 5;
this.gotoAndStop(3);
}else if(Key.isDown(Key.RIGHT) && (Key.isDown(Key.UP) && (Key.isDown(Key.CONTROL)))){
this._rotation = 45;
this._y -= 5;
this._x += 5;
this.gotoAndStop(3);
}else if(Key.isDown(Key.LEFT) && (Key.isDown(Key.CONTROL))){
this._rotation = 270;
this._x -= 5;
this.gotoAndStop(3);
}else if(Key.isDown(Key.RIGHT) && (Key.isDown(Key.DOWN))){
this._rotation = 135;
this._y += 3;
this._x += 3;
this.gotoAndStop(2);
}else if(Key.isDown(Key.RIGHT) && (Key.isDown(Key.UP))){
this._rotation = 45;
this._y -= 3;
this._x += 3;
this.gotoAndStop(2);
}else if(Key.isDown(Key.LEFT) && (Key.isDown(Key.DOWN))){
this._rotation = 225;
this._y += 3;
this._x -= 3;
this.gotoAndStop(2);
}else if(Key.isDown(Key.LEFT) && (Key.isDown(Key.UP))){
this._rotation = 315;
this._y -= 3;
this._x -= 3;
this.gotoAndStop(2);
}else if(Key.isDown(Key.LEFT)){
this._rotation = 270;
this._x -= 3;
this.gotoAndStop(2);
}else if(Key.isDown(Key.RIGHT) && (Key.isDown(Key.CONTROL))){
this._rotation = 90;
this._x += 5;
this.gotoAndStop(3);
}else if(Key.isDown(Key.RIGHT)){
this._rotation = 90;
this._x += 3;
this.gotoAndStop(2);
}else if(Key.isDown(Key.UP) && (Key.isDown(Key.CONTROL))){
this._rotation = 0;
this._y -= 5;
this.gotoAndStop(3);
}else if(Key.isDown(Key.UP)){
this._rotation = 0;
this._y -= 3;
this.gotoAndStop(2);
}else if(Key.isDown(Key.DOWN) && (Key.isDown(Key.CONTROL))){
this._rotation = 180;
this._y += 5;
this.gotoAndStop(3);
}else if(Key.isDown(Key.DOWN)){
this._rotation = 180;
this._y += 3;
this.gotoAndStop(2);
}else{
this.gotoAndStop(1);
}
}

 
 
Comment by Uzi Subscribed to comments via email
2007-07-25 05:51:28

hey SaroVati could you pleeeeeeeeeaaaseeee help me with the shopping system and the equiping system?? pretty please with sugar, cherry or whatever you like on top??

 
Comment by SaroVati Subscribed to comments via email
2007-07-27 07:34:13

Lol I’m just back from vacation o.O, plus im thinking of making a new RTS game lol. Already got most of it planned out =) I’ll try finishing my rpg tho hehe. The shopping + equiping system = EXTREMELY LONG LOL. It’s really easy once you know the easy stuff, so you should try figuring it out yourself =) It’s pretty much a bunch of:
on(release) {
statements… + u need to look up how to make your item go to inventory once bought. Just takes a long time.

 
Comment by SaroVati Subscribed to comments via email
2007-07-27 07:36:28

Oh, if you wanna see my game atm, go to this website. It’s me and my friends website for a book we had to make last year in gr. 6 o.O Anyways, the screen will be white for like a year, but then u can play it xD. Hope you enjoy =)

www.freewebs.com/SaroVati/secret.htm

 
Comment by SaroVati Subscribed to comments via email
2007-07-27 07:42:05

Omfg forgot to tell you again. THE SCREEN IS TOO SMALL!!!!!!!!!! I’m going to make some adjustments soon but right now, you have to click on the screen and drag to see everything…. sry bout that =( YOU WILL NOT SEE THE STATUS BAR IF YOU DO NOT DRAG LOL. Anyways, thats a heads up =)

 
Comment by Uzi Subscribed to comments via email
2007-07-27 07:45:19

umm… thanks for telling me that but… your link doesn’t work xD

 
Comment by SaroVati Subscribed to comments via email
2007-07-27 07:58:12
 
Comment by Uzi Subscribed to comments via email
2007-10-16 04:31:02

umm… can you explain to me WHY is the screen white for 1 year?

Comment by awesty
2007-10-16 16:49:40

What screen?

 
 
Comment by Uzi Subscribed to comments via email
2007-10-20 18:49:20

sorry, I was talking to SaroVati about that link up there :P http://www.freewebs.com/sarovati/secret.htm

 
Comment by Jared Subscribed to comments via email
2007-11-23 17:45:29

I got lost at
“Once you have that done give that MC an instance name of ‘man’ and put these actions on it”

on which one?

 
Comment by Bobby Subscribed to comments via email
2008-01-22 07:41:43

How can I make the character able to travel through an area larger than the Flash stage (essentially a town)?
Sorry if this has already been asked, but I didn’t see it anywhere. Thanks in advance.

 
Comment by B_Gwra Subscribed to comments via email
2008-06-02 22:38:31

sir,
i m trying to make a rpg game but i dnt know how make enemy and attack my hero on contact. i tryed much bt they dont react. btw thanks for ur inventory tutorial, it helped me a lot.

 
Comment by alex Subscribed to comments via email
2009-04-23 17:33:21

Code doesent work.

 
Comment by Eric Subscribed to comments via email
2009-12-19 10:11:50

Why do alphas? why not simple
visibles

onClipEvent(enterFrame){
if(_root.man.hitTest(this)){
this._visible=false;
_root.smallitem._visible=true;
}
}

 
Comment by Vincent Subscribed to comments via email
2010-06-23 20:36:26

Hey, I tried to make this but it goes wrong.

I have an walking man
a standing man
put it together in 1 MC
noticed that on both frame has a stop in script

but now the tricky part where its going wrong… the script… it isnt working.. where should i put it. Cause it cant be put on the man and if i do it on a clear frame, he gives an error and the man flips out!

 
Comment by Vincent Subscribed to comments via email
2010-06-23 21:07:28

oke, i fixed it myself..
But could you tell next time wich AS you use xD
Cuz you needed to make it in AS 2.0
and im always using 3.0

thx anyway ^^

 
Comment by AKPXDestroyer Subscribed to comments via email
2011-02-04 19:40:03

Instead of make the alpha turn to 0, we can just make it invisible like _visible = false;

Anyway, where are you? Where have you been? I miss you so much. :( Are you watching us? Or you aren’t there now?

 
Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> in your comment.