PDA

View Full Version : The basics of an RPG (role-playing game)



Pages : [1] 2

denacioust
April 18th, 2004, 04:06 PM
The basics of an RPG (role-playing game)
Taken from flashbox.proboards15.com (my site)
__________________________________________________ _____

http://mars.walagata.com/w/denacioust/RPGimage.jpg

Note: This is based on the Stick RPG game but I’ve added in some other stuff too.
Now bear with me I'm not sure if this will work because I just wrote this all without testing it so please report any errors.


First-of-all what you want to do is decide:
1. Your characters occupation(s) – Start off by deciding what you want your Playable Character to do. Pick a job that blends in with your characters surroundings e.g. it would work well if you had your character being a Mafia Hit man if he/she lived Italy

2. The characters appearance and personality – Decide now what your character should look like and their distinguishing character traits e.g. shifty eyes, giant head, Red, strawberry blonde, hair etc. Now pick a personality to match the look i.e. a person with shifty eyes could be a criminal or a drug dealer etc. And lastly pick a name for your character, a suitable name one which almost gives away the characters personality.

3. Pick your enemies, decide your friends – Your character will definitely need an enemy, pick a reason why and how that person is your enemy. If you’re going to have a no. of enemies you’ll need friends, someone to help you get the job done…

4. The Character’s Background – Lastly what you want to do is to decide the following questions:
• Where does your character come from?
• Who does he/she interact with? (Mafia stuff like that)
• Why is your character in the position they are in? (Unpaid debts to the Mafia etc.)


Now that you’ve got the background it’s time to open up Flash. Open up a new flash document. To start off draw out your character, from a birds-eye-view (from the top), animate it walking in an upward direction, the other directions will be handled in the action script of the game. Label the character “man.”
With your character done it would be best just to draw the background now and keep all the drawing and animating together. Draw your map; ignore logic when drawing it by showing the front and top of every building so you know what’s going on in each building. Your map should be several times the size of the visible screen in your game so that the map can scroll, the map only will move and not the character. You’ll need to add in some extra frames to show the inside of the buildings.

Now what you need to do is an inventory for your game. At the bottom of the screen draw any number of boxes i.e. these boxes will show up your items when you find them. Give these boxes the instances slot1, slot2 etc. With these boxes you’ll want to put in around five textboxes, one for health, occupation, days into the game, name, strength, charm and intelligence. Give each of the textboxes the variable (not instance name!) of what they are (just the one word.)

Now to start off your game insert a new scene (Insert --> Scene) above the existing scene(s) name this scene “Setup”. Name the already existing scene “game” This scene will be used to set-up all the variables. Insert an input text-box give it the variable “name.” The user then can input their own name into the textbox. Make sure you click the box labelled “show border around text” and Max. characters to seven, or whatever you want. Insert another input textbox for Days into the game and do the same for that but set the maximum characters to two and the allowed characters to just be numbers. Insert three more dynamic textboxes for Strength, Charm and Intelligence. Now for some action script insert this into the first frame:


function randomise () {
_root.strength=random(10)
_root.charm=random(10)
_root.intelligence=random(10)
}
By declaring it as a function it can be used again with a randomising button. Draw a “roll again” button. Give it actions.

on (release) { randomise(); }
That will randomise the values by the click of that button. Place another button on the stage with the writing “Go” or “Play” or something to that extent in it. Give the button actions


on (release) {
gotoAndStop("Game", 1);

}

And for the actual game…
Go to your “Game” scene and place in your character and the background. Select align (ctrl + k ) and centre your character on stage. Give the background the following actions.


onClipEvent (load) {
movespeed = 2;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
_x-= movespeed;
}
if (Key.isDown(Key.LEFT)) {
_x+= movespeed;
}
if (Key.isDown(Key.UP)) {
_y+= movespeed;
}
if (Key.isDown(Key.DOWN)) {
_y-= movespeed;
}
}


And give your character these actions

onClipEvent (load){movespeed = 0;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
play();
_rotation = 90;
_x+= movespeed;
}
if (Key.isDown(Key.LEFT)) {
play();
_rotation = 270;
_x-= movespeed;
}
if (Key.isDown(Key.UP)) {
play();
_rotation = 0;
_y-= movespeed;
}
if (Key.isDown(Key.DOWN)) {
play();
_rotation = 180;
_y+= movespeed;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.UP)) {
_rotation = 45;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.UP)) {
_rotation = 315;
}
if (Key.isDown(Key.RIGHT) && Key.isDown(Key.DOWN)) {
_rotation = 135;
}
if (Key.isDown(Key.LEFT) && Key.isDown(Key.DOWN)) {
_rotation = 225;
}
}

Now place these actions in the frame.


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++;
}
}

And give the items that can be found these actions



onClipEvent (enterFrame) {
if (_root.character.hitTest (this)) {
_root.addToslot (this);
}
}

Now place a button somewhere, it should be one to add on to your intelligence e.g. a study button in a school. Place these actions in the frame that button is placed in:


if (moneyneeded>=moneyrequired) {
money=1
}
And give the button these actions

on (release) {
strength+=(10*money)
}

And that can be used for all the different things required for the game e.g. Buying beer and stuff.

Moving into buildings. Inside the map place a square outside the door with an instance of "step"

onClipEvent (enterFrame) {
if (_parent.man.hitTest (this)) {
_parent.gotoAndStop("insidebuildingframe");

}
}

Thats really all I need to show you without repeating myself or others.
Here are a few extra tutorials which may help you.

http://forums.xgenstudios.com/viewtopic.php?t=355 - Saving games
http://forums.xgenstudios.com/viewtopic.php?t=242 - Preloaders
http://forums.xgenstudios.com/viewtopic.php?t=7751 - Functions
http://forums.xgenstudios.com/viewtopic.php?t=8395 - Actionscript basics

zeka
April 19th, 2004, 12:57 AM
Thanks! I have been looking for a tutorial on RPG Games for ages. I couldn't get mine to work, and had to gather scraps of info from all around. Now there is this-a great tutorial. :Thumb:

Zeka

denacioust
April 24th, 2004, 04:06 PM
Thanks!

r1cem4n
April 28th, 2004, 09:11 AM
excellent tutorial! a lot of help. thanx

BlueBoots
May 2nd, 2004, 11:30 PM
Isn't there already a Kirupian Tutorial about RPGs? One that doesn't just hand it to yall on a plate?

signifer123
May 7th, 2004, 03:53 PM
can you teach how to make it so you don't walk through the buildings?

zeka
May 7th, 2004, 11:10 PM
ya was gonna ask the same question :puzzled:

Jabird
May 10th, 2004, 03:52 PM
Thanks alot, I was interested in game design for some time, until i realized i needed to know alot more, once i get home, i will try some of this.

Thanks,
Jabird

Robman1
May 27th, 2004, 09:31 PM
its a good tutorial! however newbs need a bit more explanation rather than just here u go. i was wondering if you could go a bit more into depth with the inventory, skills, and not walking through buildings

signifer123
May 28th, 2004, 07:38 AM
once i remeber how i got it to stop going through buiolding this way i'll post here

signifer123
June 3rd, 2004, 05:06 PM
This is for stopping when a guy hits a building:"place this on the guy"


onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)) {
play();
_x+= 5;
if (_root.guy.hitTest(_root.stop,)) {
this._x -= 5;
}
}
if (Key.isDown(Key.LEFT)) {
play();
_x-= 5;
if (_root.guy.hitTest(_root.stop)) {
this._x += 5;
}
}
if (Key.isDown(Key.DOWN)) {
play();
_y+= 5;
if (_root.guy.hitTest(_root.stop)) {
this._y -= 5;
}
}
if (Key.isDown(Key.UP)) {
play();
_y-= 5;
if (_root.guy.hitTest(_root.stop)) {
this._y += 5;
}
}
}

lucas92
June 5th, 2004, 11:53 AM
How do i make it so when you release the key the main character movie will go back to the first frame. Thanx

signifer123
June 5th, 2004, 03:30 PM
use this on the button to go back to the main screen:

on (release) {
gotoAndStop("Game", 1);

}

lucas92
June 5th, 2004, 09:26 PM
I am talking about the guy you move around and i am talking about a key, not a button

signifer123
June 6th, 2004, 06:58 AM
ok:

onClipEvent(keyDown) {
if (Key.isDown(87)) {
gotoAndStop("Game", 1)
}
}

ohh ya thats the "w" key becasue you never specified

lucas92
June 6th, 2004, 10:01 AM
no that isnt what i wanted. when the arrow keys are down the character will start moving his arms and legs like he is walking. wjen you let up on the arrow keys i want him to stop swinging his arms nd legs

signifer123
June 6th, 2004, 11:47 AM
theres a diffrent thread on this

lucas92
June 6th, 2004, 06:16 PM
which one

lucas92
June 6th, 2004, 09:20 PM
I am trying to get it but i am fairly new to AS.

onClipEvent (keyUp) {
_root.this.gotoAndStop(1);
}

What is wrong with this code

denacioust
June 10th, 2004, 04:58 PM
Well firtly you don't need the root, that makes it look for an MC named this
onClipEvent (keyUp) {
this.gotoAndStop(1);
}

good560
July 13th, 2004, 02:13 PM
how do you make it

lucas92
July 13th, 2004, 06:25 PM
what do you want

cooleyo
July 14th, 2004, 09:40 AM
Actually it's on keyup. If you did it on key down it'd play the animation while the character is moving. But, yeah it points in the right direction. On key up (left/right/up/down) you gotoAndStop(theFrameYouNeed).

mlk
July 14th, 2004, 11:27 AM
hey lucas92 change you're footer dude, maximum size allowed is 300x60 !!!

Imagine - your footer on a 800x600 screen takes more than half of the screen !

jugglinggoalie
July 27th, 2004, 03:21 PM
Can anyone show me how to use the items

colin2003
August 13th, 2004, 03:53 PM
Can someone PLEASE finish this and make it work...like christ...when you try to step on a hotspot to go inside a building, nothin happens and those stop moving codes dont work....like omg

denacioust
August 14th, 2004, 05:02 PM
Liek OMG try do it yourself I was only givin you a basis to work off of

SeiferTim
August 14th, 2004, 06:10 PM
"Give someone an inch, and they'll beat the other mile out of you with it."

firecicle2
August 27th, 2004, 04:55 PM
Hi

hey i tryed that anti walking through walls thing on my guy, but it didn't work. Do u know what i may have done wrong???
and i jave my own map, do i have to do extra script for each building.

Dunga
August 27th, 2004, 06:17 PM
Oh god, this is full of people who really do not know what they are doing.

Anyway... just use an "else" after whatever function you use for movement... eg,
if(Key.isDown(*whatever key*<LEFT>)){
//movement stuffs
} else {
char.gotoAndStop(1);
}

Simple stuff.

SeiferTim
August 27th, 2004, 06:30 PM
It's not so much that they don't know what they're doing, but that it seems like they don't really want to know - they want to copy off someone else's homework...
or worse, they just want to click, enter a word or two, and then be done, and call it their own.
Its a plague of Mac Users.

j/k ;)

signifer123
August 27th, 2004, 07:44 PM
thats how mos of us started i mean seifer did yuo look at the actionscripit dictionary and just look at the words not what they do and go hey bet this works (if yuo did sorry)

elPooter
August 27th, 2004, 08:45 PM
thats how mos of us started i mean seifer did yuo look at the actionscripit dictionary and just look at the words not what they do and go hey bet this works (if yuo did sorry)
Well said. what I do, is I take the code (copy it), then study it and figure out how it works. It's a very good way to do things ;).

Bahamutzero
August 28th, 2004, 02:33 AM
yeah i agree...open source to me is better than any tut file. i learn mostly from open source. some times other ppl help me out too (This forum...heh)

Skribble
August 28th, 2004, 03:55 AM
Originally Posted by signifer123
thats how mos of us started i mean seifer did yuo look at the actionscripit dictionary and just look at the words not what they do and go hey bet this works (if yuo did sorry)

yeah i agree...open source to me is better than any tut file. i learn mostly from open source. some times other ppl help me out too (This forum...heh)
SeiferTim wasnt talking about learning off the code, he was talking about people wanting full source FLA files to change a few things and say its theres. And i think you will find that most good actionscripters DID infact read and learn from the actionscript dictionary, if your not willing to do that then you wont be learning actionscript for a while because the dictionary tells u things that sum tutorials dont.

And how can open source be better than a tut. The tut supplys what your finished product should look like, an explanation of what the code means, where u can use it, where to put it and other stuff that a person that is new to actionscript wouldnt understand.

signifer123
August 28th, 2004, 09:29 AM
no what i ment was i bet he didn't learn purley on his own no extra source, i think everone should use the actionscript dictionary

firecicle2
August 29th, 2004, 12:22 PM
Hey i agree with all these guys.
i had flash for about 2 weeks i can't do a single thing, so yeah i am pretty useless but where did u start, making a puppy that nodded it's head??

cause i have never used a animation beofre, while u lot ave probably been using it for years.

hey but at the end of the day u gotta learn from somewhere right.
i mean u can't guss action script :P

Skribble
August 29th, 2004, 12:53 PM
no what i ment was i bet he didn't learn purley on his own no extra source, i think everone should use the actionscript dictionary
yeh i know what u meant, but did u read seifers post properly? He is talking about people who just want to copy and paste the code. Its all well and good to ask for help with actionscript but u cant just keep asking people how to do stuff. You have to take the initiative and learn it. And open source is not the best way because u are not told what the code does.

Once you are fluent in basic/intermediate actionscript then FLA's are good because u can evaluate the code and see how people do things. But right now u would just copy and paste without knowing wot it duz, and then u would end up coming back to the person for help again.

firecicle2
August 29th, 2004, 05:26 PM
hey you lot are claerly more expeoreced at me than this.
so does anyone know where to go to get utterly basic help.
like blh blah blah does this and this does this.
I mean if i get a problem i don't have a clue whats wrong.

I'm just going round blind on this one.
so if anyone has any really basic action scripts sites could yah gimmie a post. thanks.

Skribble
August 29th, 2004, 05:30 PM
ur looking at it ^.^

Just go to the tutorial section.

Dr Warm
September 10th, 2004, 04:10 AM
I find that a tute with a fla is a lot better than a tute without, just because if you don't understand a step at least you will have a working fla and you can trace back a few steps to see what it is ur actually supposed to do, btw fantastic tute though

Shortie
September 29th, 2004, 02:23 PM
Ok guys im a newb to actionscript (please don't get mad if i don't understand). Do you create a frame where you make a character, make him sway his arms and legs when he moves and save it as a movie clip?

xinjinbei
October 1st, 2004, 01:48 PM
But how i put buildings?
It still walks from everytihing(everything)

xinjinbei
October 1st, 2004, 01:50 PM
Yes.
And then right-click it and select actions.

xinjinbei
October 1st, 2004, 01:57 PM
it walks still throught buildings. how can i made buildings from buildings?
Other question is where i put those buttons (goto class(buy beer)
is there something movie clip or just frame

Shortie
October 1st, 2004, 08:02 PM
I animated my guy to walk forward and sway his arms, but when i test it, he doesn't sway.

giggleguy
October 3rd, 2004, 06:58 AM
hey lucas92 you dont need any actionscript to make the guy stop his animation when you let go of the key, i thought of trying something and it worked! i edited the mans symbol, making it that on the first frame of his animation, i put stop();
on the first frame of his animation, apart from that, this tutorial is really bloody awesome, thanks denacioust!

bpalermo
October 6th, 2004, 10:13 AM
(...)
if (Key.isDown(Key.RIGHT)) {
play();
_x+= 5;
if (_root.guy.hitTest(_root.stop,)) {
this._x -= 5;
}
}
(...)
Hi all.

I don't know if its just me, but I can't understand what this "_root.guy.hitTest(_root.stop)) {" is supposed to do.... Since "_root.stop" is not an object, how can it hitTest anything?! No wonder the code was useless...

If you want to make your buildings tangible, you could take a look at file maze.fla, which is a sample in Flash MX, that shows how to do it...

Or you can just take a look at this small fla I made to show it.

http://jd.nlink.com.br/~bruno/flash/tangible.buildings.fla
http://jd.nlink.com.br/~bruno/flash/tangible.buildings.swf

Regards,

Bruno Palermo

Mellow
October 12th, 2004, 07:59 AM
bpalermo, just a quick question.

What exactly does this mean?
if (map.hitTest(getBounds(_root).xMax, _y, true)) {
_x -= _root.paceSpeed; }

I know what map.hitTest is trying to do. But I'm not too sure about the rest of it. Why did you place "_y" and "true"? I tried removing them to see what would happen to your .fla file, and noticed that removing them would cause me to go through the walls. But I still don't know why "_y" and "true" prevents that bug.

If anyone else could explain that to me, that would be great.

bpalermo
October 13th, 2004, 07:52 PM
bpalermo, just a quick question.

What exactly does this mean?
if (map.hitTest(getBounds(_root).xMax, _y, true)) {
_x -= _root.paceSpeed; }

I know what map.hitTest is trying to do. But I'm not too sure about the rest of it. Why did you place "_y" and "true"? I tried removing them to see what would happen to your .fla file, and noticed that removing them would cause me to go through the walls. But I still don't know why "_y" and "true" prevents that bug.

If anyone else could explain that to me, that would be great.Sorry for the delay. I was on vacations.

Now... Let's see...
As we know, hitTest is used to detect object colision. People tend to think it can only be used to check if object A hits object B like in the following line:

objA.hitTest(objB);

But most people forget it can also be used to check if a given pixel, with coordinates x and y hit an object (shapeFlag="true") or its bounding box (shapeFlag="false"). Some people might ask what is a "bounding box". Well. A bounding box is the smallest square (or rectangle) where a given object fits.

This second usage is: objA.hitTest(x, y, shapeflag);

That's the reason for the "_y" and the "true". Now you'd probably ask about the getBounds...

Let's take a look at the line you mentioned and try to understand what exactly is it saying.

map.hitTest(getBounds(_root).xMax, _y, true)

It checks if object "map" hits a pixel with coordinates x="getBounds(_root) and y="_y", where _y is the y coordinate of the object where the code is in. In this case, the object "guy".

Now. What the hell is this getbounds thing? getBounds is a great tool which simply returns an object with the values xMin, xMax, yMin, yMax relative to another object. For example: guy.getBounds(_root) (which is equivalent to type just getBounds in the code for "guy", as I did.) returns those coordinates relative to _root. Normaly, in Flash, an object x and y are in the center midle of the object. What getBounds does is to return the maximum and minimum x and y coordinates of an object which can be referred as:

guy.getBounds(_root).xMin
guy.getBounds(_root).xMax
guy.getBounds(_root).yMin
guy.getBounds(_root).yMax

or, if you prefer, using something like this:

coord = guy.getBounds(_root);

coord.xMax
coord.xMin
coord.yMax
coord.yMin

Since those coordinates, contrary to the x and y of the object, are on the edges of the object and not inside it, they can be used to check colision with more precision.

You could, of course, just use _x + (_width/2) for xMax and _x - (_width/2) for xMin, but I prefer using getBounds.

Hope it helped. I'll make some images to help you understand as soon as I have the time. Anyway, the following files may help you get it:

http://jd.nlink.com.br/~bruno/flash/getbounds.example.swf
http://jd.nlink.com.br/~bruno/flash/getbounds.example.fla

Mellow
October 13th, 2004, 09:05 PM
Thanks, that helps a lot.

I have one more question if anyone can help answering it. Say, for instance, I have 2 scenes. Does anyone remember zelda on the snes? I want to be able to do scene transitions like that.

Like, if my character reaches the borders of scene1, I would like the next scene to play.
Say, for instance, I go up and hit the border. I would like the scene that's "up" of the current scene to play.

I think there are 2 ways of doing this.
1) Change the code that codes the guy to something like this:
if (_y < (_root.paceSpeed)){
gotoAndStop("up2"); //where up2 is the scene name I wish to go to
_y = screenHeight - _y - _root.paceSpeed;
}
2) Create a collision box around every edge, and if the character hits it, then change the scene.

However, I can't seem to get the scene change to occur. I put gotoAndStop(<scenename>), but once I hit the border, the scene doesn't change. Can anyone give me a hint as to what the problem may be? Sorry for all the questions. I only started to learn flash 2 days ago, so I don't know much about flash.

bpalermo
October 13th, 2004, 10:57 PM
If you send me the .fla I may give it a try... Reference problems are better solved when we can visualize them.

Mellow
October 14th, 2004, 12:04 AM
Thanks Bpalermo. I just figured it out though. Instead of using separate scenes, I just created labels instead.

This is what I have:
##############################################

//Standard moving about, copied and pasted from Bpalerma
onClipEvent(enterFrame){
// Movement
if (Key.isDown(Key.DOWN)) {
_y += _root.paceSpeed;
}
if (Key.isDown(Key.UP)) {
_y -= _root.paceSpeed;
}
if (Key.isDown(Key.LEFT)) {
_x -= _root.paceSpeed;
}
if (Key.isDown(Key.RIGHT)) {
_x += _root.paceSpeed;
}
// City Boundaries

//changed it so that once you hit the boundaries, it saves the x,y coordinates
//of your char. it then uses the coordinates to position your guy correctly
//in the next screen.
if (_x < (_root.paceSpeed)){
_root.x = _root.screenWidth - _x - _root.paceSpeed;
_root.y = _y;
//_root.gotoAndStop("");
}
if (_x > (_root.screenWidth - _root.paceSpeed)){
_root.x = _root.screenWidth - _x + _root.paceSpeed;
_root.y = _y;
//_root.gotoAndStop("");
}
if (_y < (_root.paceSpeed)){
_root.x = _x;
_root.y = _root.screenHeight - _y - _root.paceSpeed;
//_root.gotoAndStop("");
}
if (_y > (_root.screenHeight - _root.paceSpeed)){
_root.x = _x;
_root.y = _root.screenHeight - _y + _root.paceSpeed;
//_root.gotoAndStop("");
}
}

You then need to save the var. In each new scene, you place this on the first frame so that your guy is positioned correctly:
_root.guy._x = _root.x;
_root.guy._y = _root.y;

####################################

At the moment, I am stuck on a couple of new problems. Say, for instance, there is an item on the ground. When I walk over the item, I want a message box to appear. I also want a picture of the item to pop up also. I read a couple of tutorials, but it doesn't specify my problem. It comes close, but when I try to write the code, it doesn't work.

If anyone has any hints on how I can solve my problem, or a link on a tutorial, that would be great.

signifer123
October 14th, 2004, 06:37 AM
Here is my version when you walk over the small box the screen on the bottom goes to the "chips" screen and shows info on chips i'm not quite sure how you wanted it.

Mellow
October 14th, 2004, 09:32 PM
Signifer, that's exactly what I needed. I'll have to tweak the code a bit to make it work with my game, but the basic code you gave is perfect.

bpalermo
October 14th, 2004, 09:56 PM
Strange... Couldn't open it here... :(

signifer123
October 15th, 2004, 04:58 AM
Its Flash MX 2004 sorry heres just flash mx

Mellow
October 20th, 2004, 06:00 PM
Alright, I'm desperate. I can't seem to find a tutorial that will show me how to display the content of my variable on screen.

Say, for instance, I have :
var money = 1000;

How could I display the current value of money on screen? And say, for instance, I buy something for 140. How would I then display 860 on screen?

SeiferTim
October 20th, 2004, 06:52 PM
You can simply make a TextField, which is tied to the money variable.
Just make a textField, and when it says: "var", type the name of the variable you want it to display.

bpalermo
October 20th, 2004, 08:27 PM
You can simply make a TextField, which is tied to the money variable.
Just make a textField, and when it says: "var", type the name of the variable you want it to display.I know it may sound stupid, but some people sometimes forget about this. Make a Dynamic TextField, ok? When you're creating it there's a dropdown box which says "Static Text", "Dynamic Text" or "Input Text". Choose Dynamic option and a box with "Var:" near it will appear at the Properties inspector. Just fill in with the variable you want the field to show.

Mellow
October 20th, 2004, 10:57 PM
Thanks, I knew it had to be something simple. You guys are a lot of help.

SeiferTim
October 21st, 2004, 08:59 AM
I know it may sound stupid, but some people sometimes forget about this. Make a Dynamic TextField, ok? When you're creating it there's a dropdown box which says "Static Text", "Dynamic Text" or "Input Text". Choose Dynamic option and a box with "Var:" near it will appear at the Properties inspector. Just fill in with the variable you want the field to show.

:P

I stand corrected ;)

giggleguy
October 23rd, 2004, 03:40 AM
GRRAAARRR!!! HOW DO I MAKE IT SO HE DOESN'T WALK THROUGH BUILDINGS?

Mellow
October 23rd, 2004, 10:50 AM
Hi giggle. Please post your code. It is hard to help someone when you don't know the cause of the problem.

Think of it like this. For example, you go to a doctor and say "I'm sick, cure me." The doctor would have no idea on how to cure you. He knows you are sick, but he doesn't know the cause of your sickness. In order for him to help you, he needs more information.

It's the same in this situation. In order for us to help you, you need to provide us with more information. Providing the code(copy and paste here), or .fla file would be perfect.

giggleguy
October 26th, 2004, 02:11 AM
seifertim theres nothing there and mellow I need a code for making my guy not walk through walls!!

Mellow
October 26th, 2004, 05:57 AM
?
Bpalermo wrote an awesome example for collision detection(read: not walking through walls or buildings) earlier in this thread. It's on page 4, just look at the code.

hitman1131
October 27th, 2004, 04:13 AM
ok i have just followed this tut it rocks, good for us noobs out there.
how do i get the character to move when i click somewhere.... like say warcraft.

also

i also cant get my character to stop going through the buildings....

i have tried to use this posted on pg 4 and also earlier

if (Key.isDown(Key.RIGHT)) {
play();
_x+= 5;
if (_root.guy.hitTest(_root.stop,)) {
this._x -= 5;
}
}

but if i put this is it then disables the whole rotations and walk effect i have on my character.

am i putting it in the wrong spot? do i put it on the man, or the background?
or on each individual building?

and i take it for the buildings i have to put them in the background mc right.... so that they move with the background...

giggleguy
October 27th, 2004, 04:28 AM
but i dont get it

SeiferTim
October 27th, 2004, 08:48 AM
:x

hitman1131
October 27th, 2004, 09:09 AM
lol seifertim, that really dont help :(

Mellow
October 27th, 2004, 10:58 AM
if (Key.isDown(Key.RIGHT)) {
play();
_x+= 5;
if (_root.guy.hitTest(_root.stop,)) {
this._x -= 5;
}
}


Edit: why don't you try removing the comma after "_root.stop" Also, change the 5 into a variable, so later on, you can change your character speed easier. And you place this on the thing you want to move, which is your guy.


Try:

onClipEvent(enterFrame){
if (Key.isDown(Key.RIGHT)) {
play();
_x+= _root.pace;
if (this.hitTest(_root.stop)) {
_x -= _root.pace;
}}}


where "stop" is the instance name for the building movie clip. "pace" is the character speed. You will want to initialize it at the beginning of the movie. Personally, I like bpalermo's way of doing it as it seems to give a more accurate hittest.

SeiferTim
October 27th, 2004, 01:41 PM
lol seifertim, that really dont help :(
Sorry, but somehow it begins to occur to me (again) that you can spell out every little detail to someone, and pretty much hold their hand, then turn around and ask them to do something similar, and all they can give you is: :h:

It seems to me that our world has become one of: "Can someone give me the answer?" - and frankly, it frightens me.

Sammo
October 27th, 2004, 04:22 PM
Telling them the answer is often the way forward, you tell them what to do, then tell them how the answer solves the puzzle, then they can use the answer of that problem to solve a similar problem.

bpalermo
October 27th, 2004, 06:47 PM
Hi everyone. Been away for a while... Someone has to study 'round here! :p

First of all, sorry for posting only one msg to answer so many people, but I've been to busy these days...

Mellow: nice that you liked the code.

Giggle: If your buildings are still intangible, check this file, the coding for the walls is also here. Can't help any more than that. It works fine with me and it seems to work for other people too. If you send me your code I may take a look at it an try and find the problem.

Hitman: There's a sample file which comes with Flash MX and explains how to move things Warcraft style. The code shows even the calculations to find the correct rotation for the "guy" movieclip... The name of the file is Movement-pointer_or_click.fla and it's located at C:\Program Files\Macromedia\Flash MX\Samples\FLA or something like that. Depends if you installed it in its default folder or not.

Anyway, I had some free time a while ago and made this much simpler (and also limited, since it's simpler) demo code for Warcraft style moving. It's still bugged and won't walk around walls when it has already got to one of the coordinates (x or y), but gives an idea of how the thing works... I had no time to correct the bug, but it's very simple, as soon as I can I will post it.

http://bpalermo.hollosite.com/flash/click.tangible.buildings.fla
http://bpalermo.hollosite.com/flash/click.tangible.buildings.swf

Hope it helps...

How can we attach files to posts?!

signifer123
October 27th, 2004, 08:10 PM
when your in advanced posting mode under additonal proporites you select the button manage attachments

giggleguy
October 28th, 2004, 02:01 AM
please help! cause i dont know how or where to make them tangible and how to make a scrollable background stop scrolling!

hitman1131
October 28th, 2004, 02:35 AM
Bpalermo: i had a look at that tut before i posted but the prob im have is i am using flash 5. i couldnt get that to save as a flash 5 project so i tryed using the code and make my own flash 5 version of it but the hittest didnt work =\

does this sort of hittest everone is trying to show me not work in flash 5???

hitman1131
October 28th, 2004, 02:52 AM
ok i have had another atempt to get the hittest to work but nothing =\ i aint 100% shaw that i am using the code properly off the original tutorial... so if sumone could have a look at my fla. file and see if its alright.

http://home.ripway.com/2004-6/134081/RPG_Me.fla

and well after u have a look, is it possible to explain how i get a hittest to work for the box.... its just a small example i am trying to use for the border of the rpg. and im guessing that i could use the same hittest for buildings.... or should buildings and border be done diferently?

again. im using flash 5... so any help is mostly appreciated (<---i cant spell that word :()

giggleguy
October 28th, 2004, 03:29 AM
um that fla wont work

hitman1131
October 28th, 2004, 04:09 AM
really try this one

giggleguy
October 28th, 2004, 06:15 PM
yeah that wlill work

hitman1131
October 28th, 2004, 08:04 PM
yeah so now that the file works could someone have a look at it and just explain in simple terms how i put a border hittest in.

bpalermo
October 29th, 2004, 09:45 AM
I'll take a look at it right now. By the way... Did you test the Warcraft Style moving thing? It should work, since it's not related to the hitTest problem...

hitman1131
October 29th, 2004, 10:08 AM
ok i have worked this much out...
yeah i didnt try that warraft 3 style movement yet cause i figured i may as well wait till i get the hittest to work.

hitman1131
October 29th, 2004, 10:14 AM
just had a quick look at it. it looks pritty easy to understand but what does this actually tell the movement?

if (_x > targetSpot_x)
if (_x < targetSpot_x)
if (_y > targetSpot_y)
if (_y < targetSpot_y)

also..... i notice in the var that u got all the targetname things in there. should i do mine the same way rather then have each targetname in each mc?

hitman1131
October 30th, 2004, 05:46 AM
so was anyone able to help me fix my hittest problem??? it sort of works..

bpalermo
October 30th, 2004, 08:05 AM
just had a quick look at it. it looks pritty easy to understand but what does this actually tell the movement?

if (_x > targetSpot_x)
if (_x < targetSpot_x)
if (_y > targetSpot_y)
if (_y < targetSpot_y)
These are in the guy, right? Well... What do they say? As you probably noticed I have two variable [targetSpot_x and targetSpot_y] which are set, every time I click with the mouse [onClipEvent (mouseDown)], to the mouse _x and _y, respectively. That is. Everytime I click, these variables tell me where I clicked.

The lines above just check the position of the MC where they are written [In this case, "guy"] and then increment this MC's _x or/and _y.

So. "If (_x>targetSpot_x)" means "If this MC is to the right of the point where I clicked" and so on.


also..... i notice in the var that u got all the targetname things in there. should i do mine the same way rather then have each targetname in each mc?I didn't understand. Which variable are you talking about? What are "targetname things"?

Hope its clearer now.

hitman1131
October 30th, 2004, 11:38 AM
well that clears things up hehe thanks for helping me uunder stand it :D

the var's, nevermind i workeed that out.... all i cant work out is how to get this man to hit the wall of the box beside him properly

thx bpalermo.. for the help.

with this file below i cant get the hittest to work properly, i aint asking pplz to do it for me i have kinda got the hittest to work im just needing someone to take a look at it and see how to get the rest of the box hittest able... he walks through the top and bottom of it and if u go horizontal he goes through the walls also.... plz take the time to help me.

thx in advance....

bpalermo
October 30th, 2004, 12:39 PM
You're talking about this RPG_Me.fla?
The first one or the second? Are them the same?

hitman1131
October 30th, 2004, 10:16 PM
ok my bad BPalermo its the 19.0k rpg_me.fla if u cant see file size then its the second one.

thx for ur time bud, im sorry if i seem a little impatient but i got to finnish some sort of flash game before the 10/11 so im kinda stressed and also i got to have all my other class work in by that date too. :(

giggleguy
October 31st, 2004, 01:57 AM
grrr i cant send my .fla because the file is about 200kb

hitman1131
October 31st, 2004, 05:55 AM
why are u trying to send ur fla.??? need fixing or does it have working hittest for everyone???

hitman1131
October 31st, 2004, 09:22 AM
so bpalermo where u able to see if u could fix my problem??? with the hittest on this file? i aint asking for code its partly done. just need u to see if u can fix it properly. its the RPG_hittestproblem file that i have posted earlier.

giggleguy
October 31st, 2004, 08:45 PM
i want to send it because i need it fixed

hitman1131
November 1st, 2004, 01:17 AM
giggleguy try this site out http://files.villagephotos.com/index.asp (http://files.villagephotos.com/index.asp) and then see if u can put it on there.

Mellow
November 1st, 2004, 01:57 AM
If this is for homework, you should really ask your teacher. As for your hittest, it works fine. It's just that when your guy hits an object/boundary, you should just put in additional code to stop the scrolling.

For instance:


if (hitting object/boundary)
scrolling = false;
else scrolling = true;

if (scrolling == true)
if (key pressed for moving)
scroll();

hitman1131
November 1st, 2004, 02:41 AM
ok mellow im a little confused by this code, where do i put it?? in the background to stop that from moving? or the character???

and does my code need changing in anyway to fit that bit in?

also what goes inside these brackets?

if (key pressed for moving)

and for this one too

(hitting object/boundary)


thx in advance :D

Mellow
November 1st, 2004, 10:14 PM
It's already been 3 days and you still haven't gotten anywhere with your code? Not to be mean or anything, but you shouldn't rely on other people that much. I'm sure a lot of the programmers here has met at least one person who is always asking them for help. All I want to say is, it's time for you to do your own thinking.

If you want to ask questions, it's fine. But you should try to solve it yourself too. Asking a question does not mean you can now just sit there and wait for an answer. Especially since an answer may never come.

bpalermo
November 2nd, 2004, 10:21 AM
Sorry for the delay. I was out for hollidays. November 2nd is a holly day here in Brazil. Just got home. I'll look it up and post anything within one or two hours (lots of emails to answer, by the way)

bpalermo
November 2nd, 2004, 11:17 AM
Well well well...

Hitman, I took a look at your .fla and I found some problems. I'll list some of them bellow.

When you cut and pasted the code you forgot to change the references so, in "background" for example, you modify the _x attribute when you hitTest man horizontally and vertically and _y, which should be modified for the vertical hitTest is never changed.

In the same code you sometimes checks the hitTest to "man" and sometimes to "wall". Are you trying to hitTest "background" to the first, the second or both? No matter what you're trying to do, it won't work this way. I would have to know what you want in order to correct it.

And last, but not least. You should avoid hitTesting something as thin as a line. When trying to hitTest walls, fill them instead of just drawing the contour. Even if you're not usind getBounds to hitTest with pixel precision, the changes that your hitTest will be at the very least "weird" are greater if you use thin things.

I used your guy in this fla and it's hitTesting fine. You should look it up and try to start your own example from the beginning.

If I can do anything else, just let me know.

hitman1131
November 2nd, 2004, 04:15 PM
ok thx i had a quick look at this, its just what i wanted. i will do what u said and trty my own. but i can't atm i gotta go school :( its morning now. so tonight as soon as i get home i will try.

also the not using thin lines in hittest thats the first i have heard about it so thx bud now i know for the future.

signifer123
November 6th, 2004, 11:23 AM
I hope none of you mind but i'm gonna make a tutorial for all of this (don't worry i reference this thread)

ok and uhh how would oyul ike itdone pdf web page with pictueres without very discriptive so anyone could get flash and the guide and start making or normal like this tutorial just all compiled into onewith no picure or very few and not super in depth need feedback.
or if someone else would like to help or something

SeiferTim
November 6th, 2004, 01:21 PM
Why not just make it like a normal Kirupa tutorial?

signifer123
November 6th, 2004, 01:47 PM
uhh thats what i was asking should i make it normal or really easy?

SeiferTim
November 6th, 2004, 04:32 PM
that depends entirely on how you intend to approach the tutorial.
From what I've seen here, having a tutorial that is for the absolute beginner seems to be needed... Assume the reader knows absolutely nothing.

signifer123
November 6th, 2004, 04:45 PM
uh does that mean include rediculus screenies like this?
http://members.lycos.co.uk/signifer123/store/Start.bmpwell this lasted long! hope someone else follows thru with this idea

EDIT: I AHVE DECIDED NOT TO DO THIS I AM SORRY I DO NOT HAVE THE TIME TO DO SO RIGHT NOW MAYBE SOMEONE ELSE CNA PICK UP ON IT OR MAYBE I WILL

SeiferTim
November 6th, 2004, 07:49 PM
That was quick. :huh:

signifer123
November 6th, 2004, 07:53 PM
That was quick. :huh:
i got like just the basics through the ni remembered i had a lot of projects due for school and tohugh o crap

Dr Warm
November 6th, 2004, 09:03 PM
I was thinking about doing a tutorial for noobs, but i'm not sure what ppl want, i finish school for eva in one week so i'll have some spare time.

How do i submit to kirupa? do i email him with it?

SeiferTim
November 7th, 2004, 06:46 PM
http://www.kirupa.com/resources/tutorial.htm

This should help.
If no one else can or will do it, I could probably find time to come up with something - it just might take me a while before its finished... It would be tutorial #3 for me.

Dr Warm
November 7th, 2004, 11:47 PM
if you can find the time, you should do it, i've read your tutes they're awesome. i'd still like to do one maybe something different, i'm not sure quite what yet, something sort of more intermediate than noobish though

SeiferTim
November 9th, 2004, 01:10 AM
Well, I've started working on the Tutorial - I think this is going to take me a looooong time - any help would be greatly appreciated.
If anyone wants to help, or whatever, this is it so far: http://seifertim.no-ip.com/rpgTut/page01.htm I'm working on it most likely as you read this, so if things suddenlt change on you, or whatever, keep that in mind...
When I'm 100% finished, I'll submit the whole thing to Kirupa.

Oh, and BTW, I made that little sword icon. Ah, good ol' MSPaint :D Photoshop is not the best tool to do pixels in...

Dr Warm
November 9th, 2004, 02:12 AM
Whoa, that's quite a big list, i'm not sure what sort of rpg you're basing it on, not final fantasy i hope :P or the tute will take the better part of this lifetime. i think mainly what the noobs are concerned with is the hitTests, not many have got farther than this!
I'm not sure if putting that battle scenes and stuff are necessary, instead making the stick rpg might be simpler, just a fla will help a lot of ppl.

But i can help you make some of the stuff (if i have time) like the battles, status screens, i just don't like the hitTests parts!

BTW have you done you're RPG i've been to your site a few times but could only find the pdf of storyline/chars and the next time it had crashed

SeiferTim
November 9th, 2004, 02:19 AM
Crashed?
Well, I don't have anything that I've compleated, per say, the Design Doc is the RPG that I intend to finish before I die. I've wanted to finish the story and stuff before actually moving on to the code...
But I know enough of what I'm doing so I have no doubt that I can finish this tutorial - the only problem will be finiding the time to do so... but, I will work as hard as possible on it. I am intending to base this on a Final Fantasy Type RPG, and include a battle system for the same reason you mentioned above: "not many have got farther than this!" - once they do get further, they're going to go nuts.

Duh - and I appreciate your offer of help... too much on my mind :P

signifer123
November 9th, 2004, 02:25 AM
Wow! that was alot different i was gonnna follow the original intent of this thread to Make a Stick RPG, but wow your gonna mke a huge thing on it all the power to you.

SeiferTim
November 9th, 2004, 02:28 AM
Well "sticks" don't really make a difference - you can make your graphics look however you want.... You can make an entire RPG with different colored blocks - it would look crappy, but you could play it.

Dr Warm
November 9th, 2004, 04:33 AM
Ah no you see the sticks rpg, you might not have played it (it's an actual game), but basically you walk around, you have a time limit for each day, and you do certain objectives, like buy cigarretes and beat ppl up (from memory), there wasn't any battle systems or anything. but yeah if you wanna do like final fantasy art based (i'm a bit apprehensive of how far you can stretch the art-based) that's cool

SeiferTim
November 9th, 2004, 04:28 PM
Well, I'm currently putting my tutorial-in-progress up on SeiferNet. Anyone who wants to watch its progression, feel free...
I also have my story that I'm working on, if anyone feels like critiqueing... Anyone who wants to contribute, drop me a PM, or an E-Mail.
:beam:
Oh, and you can get to SeiferNet at: http://seifertim.no-ip.com ~ or click my footer :D

signifer123
November 9th, 2004, 04:50 PM
i'm really liking how this is turning out i'll make another sample rpg
maybe this weekend i'll amke a stick rpg one

RyxiaN
November 24th, 2004, 03:15 PM
Could you take this one more time??? How i make the "man" not go through buidlings and walls?? I have Flash 5?? help me please

SeiferTim
November 24th, 2004, 05:22 PM
Arg... read my not-yet completed Tutorial
It covers this.
http://seifertim.no-ip.com

RyxiaN
November 25th, 2004, 02:34 PM
is it the Worlds RPG Design Document?

RyxiaN
November 25th, 2004, 03:54 PM
Could someone give me a script that makes the guy not walks over the buildings?

SeiferTim
November 25th, 2004, 09:01 PM
No the RPG Programming Tutorial. Kirupa should be putting it on the main site shortly, as well.

RyxiaN
November 26th, 2004, 10:36 AM
but cannot you tell me how to make so that the guy not walks trough walls... your way was difficult.... you mean so if: barrier = false you can walk it and if barrier = true you cannot walk over it?

SeiferTim
November 26th, 2004, 11:50 AM
It takes a lot more code than that.
Basically, you have to check the position of your guy, and if it is about to move over a space that barrier = true, then you don't allow it to move. There really isn't an 'easy' way.

RyxiaN
November 26th, 2004, 01:06 PM
okay.. i tested someone elses game and when the guy hits the wall he gets out 6 "?" from the wall... so you cannot be exactly beide the wall

SeiferTim
November 26th, 2004, 03:10 PM
What? :h:

RyxiaN
November 27th, 2004, 06:22 AM
onClipEvent(enterFrame){
with (_root.guy) {
// check if player hits the buildings
if (map.hitTest(getBounds(_root).xMax, _y, true)) {
_x -= _root.paceSpeed;
stop();
}
if (map.hitTest(getBounds(_root).xMin, _y, true)) {
_x += _root.paceSpeed;
stop();
}
if (map.hitTest(_x, getBounds(_root).yMax, true)) {
_y -= _root.paceSpeed;
stop();
}
if (map.hitTest(_x, getBounds(_root).yMin, true)) {
_y += _root.paceSpeed;
stop();
}
}
}


so when the guy gets to the wall he will bomb away


isn't there another way so the wall just be a wall

SeiferTim
November 27th, 2004, 09:09 AM
I think this code is for checking if the Guy is on top of a Wall after he moves... My method checks before he moves, and then prevents him from moving if he would hit a wall.

Unfortunately, and I don't mean any offense here at all, I have a feeling that you don't have a very good grasp of the capabilities, and especially the limitations of Flash. You can't just say "this is a wall, don't walk through it." and have the program understand. You have to define - in Flash's Language - what a wall is, and what happens if you collide with it. For instance, in my tutorial, I make tiles which have the property "barrier". Flash doesnt' know - or care - what a barrier is, unless I tell it to. It could be called "cheeseSandwhich" for all it cares. I then later have to say that if the movie_clip would attempt to walk over a "barrier", or "cheeseSandwhich", to cancel the move instead. In Flash, you're working in basically 2-dimensions. The first is the graphics that you see on the screen. These really have no real properties at all, other than height, width, and x, y positions. That's about it. All Flash is doing is drawing some pictures on the screen. If one of them happens to look like a wall, it doesn't care. The second dimension is the code. Everything happens here - it may appear as if we're drawing an object on the screen, and then assigning properties to it, but this is an illusion. What's really happening is that we're creating an object which exists as code, and giving it properties which are either numbers (integers), words (strings), or an on/off, true/false, yes/no value (boolean).

Here is our code object for a wall:

name = Brick wall
wall = true
picture = brickwall.img


Simple enough. Now, we could have code which says "put a brick wall at x,y". So, ultimately, all that flash would do is find out which picture is used for a Brick Wall, and put it at x,y. At this point, it doesn't care and has no idea that Brick wall is a wall at all. Now, we have a guy who wants to move to x,y. Flash only knows 2 things at this point. At point X,y is a Brick Wall, and on the screen it looks like brickwall.img. So we have to have another bit of code which checks to see if Brick Wall is in fact a wall. It will say "if brick wall is a wall then cancel guy's movement, otherwise, let him move".
Thus, the player hits an arrow key to move guy to x,y. Flash checks to see what is there, and finds a Brick Wall, then it checks to see if brick wall has a "true" value for its "wall" property (which it does), and if it does then pretend that the arrow key was never even pressed. If it is not, than use whatever applicable code there is to move the guy to x,y. This is essentially what my code is doing. And still Flash does not actually know what a Wall is. All it cares about is what happens if someone tries to walk on one.

Sorry, hopefully this made more sense... I really don't know if I can explain it any better. When I get to my next page in the tutorial, all about Game Mechanics, you should see a little better where I'm going with this. For instance, when ou make a monster object, you're not actually making a Monster in your computer (duh ;) ) just some properties which can be treated as such to the player.

HP, Magic, Power, Speed, and Defense mean just as much to a computer as Marmalade, Orange Juice, Turkey, and Fish Sticks would. But depending on how you treat the code, it makes all the difference to the player.

SeiferTim
November 27th, 2004, 09:12 AM
p.s.: Wall wall wall wall wall ;)
I don't think I've ever typed the word "Wall" so many times in my life!
I now have an urge to read the Wall Street Journal, listen to Pink Floyd, the Wall, and shop at Wal-Mart.

RyxiaN
November 27th, 2004, 10:07 AM
but no i have some skills of Flash.... and i dont just want the script of not walking through walls.... i wanna learn.... but how do i learn if noone is learning me... your tut was easy untill I came to tiles.... help me out! Please!

SeiferTim
December 5th, 2004, 12:47 AM
Sorry I didn't get back to you sooner, I've been busy with work, and such.
There are many ways of handling the wall situation. My method works best if you intend to utilize a system involving tiles. Using HitTests also works pretty good, in some situations. And another method, which can work well enough, is to simply hard-code the coordinates of the walls, and say that the sprite can't walk through those spaces.

I guess what I need to know to be able to help you further is this: What exactly are you hoping to accomplish, and how are you trying to do it? I have seen where someone used photoshop to draw out an entire map, and then put a sprite on top of it that they wanted to only walk on roads of grass, and couldn't figure it out. Hopefully this is not what you're trying to do. If you can give me more details, I may be able to at least point you in the right direction. Otherwise, all I can hope to achieve is to be able to explain my own methods a little better, and help clarify them.

bpalermo
December 7th, 2004, 11:59 PM
You know. Sometimes I really get tired of this. We're here trying to help people out of nothing, by volunteering, and some guy just shows up almost DEMANDING that we DO THE ****ED CODE FOR HIM?!? And in the EASIEST WAY POSSIBLE! Oh, come on!

Since you can read this, I suppose you can also read all the tutorials I've ever read on Flash. So. If you actually want to learn something, try studying it. You'll be marvelled how it works...

And also, you should try and learn how to ASK for things.

SeiferTim
December 8th, 2004, 12:55 PM
That's why I'm making a tutorial.

bpalermo
December 9th, 2004, 09:05 AM
That's why I'm making a tutorial.
You're more patient than I, SeiferTim. :ne: Are you a teacher? :p

Wanna be like you when I grow up! :thumb:

SeiferTim
December 9th, 2004, 10:30 AM
Nah, not a teacher, though that's one field I thought about getting into.

SeiferTim
December 9th, 2004, 06:40 PM
Whew... well, I'm still working on my tutorial, and I have a big chuck of the beggining of the Battle Section done, but I'm running into some occasional glitches... can someone take a look at my code, and see where the problem might be? I appreciate it. Essentially, sometimes when I try to "Fight", the whole thing just seems to stop, and show the battle window, as if it never got a command to keep going, but, I'm not sure...
Also, it seems mny code for creating the monster is a little off - one hit seems to kill it no matter what...

I'd appreciate the assistance! :D

Mellow
December 10th, 2004, 10:41 PM
heyo, it's been awhile since I've been here. I tried to take a look at it, but your level of coding is way beyond mine. So I tried the time-honored way of debugging . . . placing "trace(#)" in every function and seeing which function was last run before it stopped. I'm sure there are better ways to debug, but I'm still new to flash.

So far, this is what I'm thinking. For your checkDead function


function checkDead(lastTurn){
};


The function checks to see if anyone's dead. Then the function places a call to function decideTurn(). Your decideTurn function looks like this.


function decideTurn(turn){
if (turn == 1)
playerChoice();
else
enemyGoes();
}

When you call "enemyGoes()", the function then calls another function to display a message. However, after that function finishes execution, your code stops since no other functions are being called. I think you're missing a checkDead() function call during "enemyGoes();"

I made the following change, and it now seems to be working fine for me.


function enemyGoes() {
diplayMessage("Enemy's Turn!",5,0);
checkDead(2); //change here, after enemy executes,
//checks to see if player died
};
}

But your attacking system works fine. I don't know why your monster's life is so low since I can't really understand your createbattle mathematics. You can always just add 10hp to your monster while it's calculating the hp. Or just make your attacks weaker.

Edit: Oops, I forgot to ask, but can I steal/modify your "close" button? You know, that square with the x in it.

flashnewb90
December 11th, 2004, 12:32 AM
hey,

im new to this thread i read it through and liked the sound of seifertims rpg tute, although i was wondering what version of flash he was using?

thnx ne help would be grately appreciated.

SeiferTim
December 11th, 2004, 02:29 AM
heyo, it's been awhile since I've been here. I tried to take a look at it, but your level of coding is way beyond mine. So I tried the time-honored way of debugging . . . placing "trace(#)" in every function and seeing which function was last run before it stopped. I'm sure there are better ways to debug, but I'm still new to flash.

So far, this is what I'm thinking. For your checkDead function


function checkDead(lastTurn){
};


The function checks to see if anyone's dead. Then the function places a call to function decideTurn(). Your decideTurn function looks like this.


function decideTurn(turn){
if (turn == 1)
playerChoice();
else
enemyGoes();
}

When you call "enemyGoes()", the function then calls another function to display a message. However, after that function finishes execution, your code stops since no other functions are being called. I think you're missing a checkDead() function call during "enemyGoes();"

I made the following change, and it now seems to be working fine for me.


function enemyGoes() {
diplayMessage("Enemy's Turn!",5,0);
checkDead(2); //change here, after enemy executes,
//checks to see if player died
};
}

But your attacking system works fine. I don't know why your monster's life is so low since I can't really understand your createbattle mathematics. You can always just add 10hp to your monster while it's calculating the hp. Or just make your attacks weaker.

Edit: Oops, I forgot to ask, but can I steal/modify your "close" button? You know, that square with the x in it.
Duh. Thanks a lot! I knew that it had to be something stupid! :P
What I'm trying to do with the monster creation is to first, pick a random number, which is between 75% - 110% of the players level - which would make it either weaker, or slightly stronger than the player. Then, it picks a monster at random, and as long as the random level is within the monster's maxLevel, and minLevel, then it would create a monster similarly to how it creates the player. I think my problem is in the level creation (because when the player was level 3, it made a level 11 goblin), and also in the base values for the goblin's stats.. I may need to set that a little higher...

Go ahead and steal my button :D It's nothing that major, just a box, and "X" in Arial Black font... :P


hey,

im new to this thread i read it through and liked the sound of seifertims rpg tute, although i was wondering what version of flash he was using?

thnx ne help would be grately appreciated.
I'm using MX 2004 Pro, I don't really know the difference between the versions, someone else can probably tell you more about it, though I'm pretty sure that most of my code requires AS2.0 - but I could be completely wrong.

Thanks, again, for all the help!

flashnewb90
December 12th, 2004, 10:35 PM
hey seifer tim i was wondering just read ur thread about the "gdc" company, and was wondering how the space game was going?
thnx for replying my other post :)
and i have mx pro too kool

flashnewb90
December 13th, 2004, 12:51 AM
hey guys,
i was just wondering..... if i wanted to learn a certain type of programming language (for games) which one would be the best for me to learn gamewise??
thnx:ne:

largozol
December 15th, 2004, 01:27 PM
Hey guys where can i find that Flash software?I've been searching the google for hours!

chazzyman
December 15th, 2004, 02:00 PM
hey seifer tim i have flash mx pro 2004 but cant open any tutes on this or any other site it says unexpected file format or failed to open document :S do you know why it might do this? or how to open the files?

bryamatt
December 15th, 2004, 04:39 PM
hey, i know that this is in seifer tim's tutorial... but my computer won't open it. I was just wondering (by the way i am new to actionscript and im trying to learn it) how you can make it so that your "character" that is moving goes to a different spot on a map without moving there (may be confusing but ill try to explain it better)... so say that you have a guy going through a door on the right side of the screen... when he gets thru the door... i want him to be on the left side of the screen with a different background.... so how can i do that?

SeiferTim
December 15th, 2004, 07:32 PM
Just change coordinate on the map that you want him to appear..
All of these files should open in Flash MX2004 with no problems.... theoreticly.

bryamatt
December 15th, 2004, 10:22 PM
thanks, i actually got ur site working again so im gonna do what i do best... copy paste ur coding from moving from map to map... then change and analyze it until i figure out exactly what it all does... thanks for making this tutorial! whenever it's done im gonna try to make an rpg!

RyxiaN
December 16th, 2004, 12:59 PM
Hi agian boys... i have been away for a time... do you have created a better code than i got earlier... my code is wired...

RyxiaN
December 17th, 2004, 09:53 AM
Sorry I didn't get back to you sooner, I've been busy with work, and such.
There are many ways of handling the wall situation. My method works best if you intend to utilize a system involving tiles. Using HitTests also works pretty good, in some situations. And another method, which can work well enough, is to simply hard-code the coordinates of the walls, and say that the sprite can't walk through those spaces.

I guess what I need to know to be able to help you further is this: What exactly are you hoping to accomplish, and how are you trying to do it? I have seen where someone used photoshop to draw out an entire map, and then put a sprite on top of it that they wanted to only walk on roads of grass, and couldn't figure it out. Hopefully this is not what you're trying to do. If you can give me more details, I may be able to at least point you in the right direction. Otherwise, all I can hope to achieve is to be able to explain my own methods a little better, and help clarify them.

look here... i didn't get back to you earlier because i have been away for a while... My game is not like you wrote up there... I have made an animated guy with can walk up, down, left, right and more... I have made the background without buildings and a background with only building (that shall be the wall) and i have set out coins... i want to learn a good way to make so he cannot walk trough walls.... can you or someone else help me out?

SeiferTim
December 17th, 2004, 07:33 PM
Did you make your background with tiles? Can you post your code?

RyxiaN
December 18th, 2004, 04:16 AM
i have made one game with tiles and one with not tiles... but i made my own way to make tiles... i just imported them and placed them on the map :D... instead of making the matrix code...

signifer123
December 18th, 2004, 07:04 AM
well use the one with tiles it shoukld run smoother and it probably has a better quility then importing a one without tiles because the only disavatage of tiles is not a good looking as grphical usually so eally theres not reason to do it not tiles

RyxiaN
December 18th, 2004, 08:00 AM
ye in that one í have made so he cannot walk through walls.. but i don't know how i did... i wanna learn how

SeiferTim
December 18th, 2004, 08:59 AM
Er......... if you don't use the matrix, the program will not know what is a wall, and what is not. The whole point of the matrix is to allow the sprite to be able to interact with your map. That is why your map isn't working right...

RyxiaN
December 18th, 2004, 10:15 AM
Er......... if you don't use the matrix, the program will not know what is a wall, and what is not. The whole point of the matrix is to allow the sprite to be able to interact with your map. That is why your map isn't working right...but i made another thing... but matrix is better and i want to learn it... but my way to make walls was that i made one background with walkable tiles (grass, bridge) and one with not walkable (water , rock, tree) and i placed a script on the notwalkable background that you cannot walk through... but i wanna learn matrix... ;)

EDIT: I can show my game on wednes day when i come to dad, right?

RyxiaN
December 19th, 2004, 02:07 PM
seifertim are you there??

SeiferTim
December 19th, 2004, 02:47 PM
Yeah, I'm here now.... um... I wish I knew what you mean by "made another thing"... because I don't have any idea how to help you if I don't know what you did. If you don't have a way for Flash to know where the player is allowed to move and where he's not, then its not going to work. You can always make smaller tiles, and have a bigger matrix to make it look better - I made my tiles pretty big so you could see them better.

flashnewb90
December 19th, 2004, 09:10 PM
hey seifer

how did the "gdc" company end up goin earleir in the year?

SeiferTim
December 19th, 2004, 09:20 PM
Yeah... that didn't exactly work out... but, that's okay - I've been working on stuff on my own.

flashnewb90
December 19th, 2004, 09:47 PM
did the space game thing come out of it?
lol i was reading the thread for ages seeing if their was a finished product??

it sounded HELL good
:)

RyxiaN
December 20th, 2004, 08:41 AM
but SeiferTim... i have a game with tiles: grass, water, rock, brigde and tree... could you help me with matrix then?

SeiferTim
December 20th, 2004, 11:12 AM
That depends entirely on how you're creating your map.
If you just drew a picture, and imported it into the movie, then my method will not work - you'll need to come up with your own technique.

RyxiaN
December 20th, 2004, 11:18 AM
how i do that?

SeiferTim
December 20th, 2004, 11:30 AM
I couldn't begin to tell you, unfortunately... how did you make your map?
You said: "i have a game with tiles: grass, water, rock, brigde and tree..."
If this is the case, then all you need to do, is make a new movieClip, and make enough key-frames to put one tile into each, and then use the code that I have in my tutorial to create the tile definitions. How many tiles do you have?
It would be much, much more helpful if you either posted your code, or your entire Fla file.

RyxiaN
December 20th, 2004, 11:32 AM
Yeah, I did that first with those tiles, but i didn't have a chance to understand! I didn't see where to put the script etc. If you could help me and explain a bit i would be greatful. Thx in advance.

SeiferTim
December 20th, 2004, 11:51 AM
Basically, almost all your code is going to go in the root of your movie - first frame.

If you pull up my tutorial, page 6, you'll see that I have some variables defines right away:


mvWdth = 576; //this is just the Width of your Movie
mvHght = 576; //...and this is its Height
tileWdth = 64; //This is your tile's width - they should ALL be the same size.
tileHght = 64; //...and your tile's height.

After that, you need to define all your Tiles:


tile0 = function () {};
tile0.prototype.pos = 1; //this is the Frame Number that the picture of this tile is in. In my example, this is my Grass tile.
tile0.prototype.barrier = false; //Grass is not a barrier, so this is false.

Each of your tiles should have a similar declaration, each with a different number (tile0, tile1, tile2, tile3, tile4, etc...). Generally, 'pos' is 1 higher than the tile's number.

I'll add more in a minute, have to run out real quick.

RyxiaN
December 20th, 2004, 12:09 PM
okay... but i havn't photoshop so i dont know how big my tiles are bacouse i made them in paint :D

SeiferTim
December 20th, 2004, 12:25 PM
I used paint to make mine, as well... Go to "Image > Attributes", and it will tell you the size.

Okay, so once you have all these tile declarations, you can make your map, which should look just like what my tutorial shows, except use your tiles. For instance, if "tile0" is a dirt path tile, that you made, then everywhere there's a "0" in the map matrix, it'll display the dirt path picture, and treat it as whatever you have "tile0" set. You want to make you map matrix be big enough to hold your tiles. So, if you plan on making tiles that are 10 X 10 pixels, and you want 20 tiles across, and 15 tiles down, than your movie has to be 200+ pixels wide, and 150+ pixels high, and your map matrix should be something like this:

map=[
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]];

Keep in mind that this is all based on your setup.
Let me know if this makes sense, so far.

RyxiaN
December 20th, 2004, 12:32 PM
Thank You!!! I know now everything! But the bad thing is: I am at my mother's house! I cannot work! But now it make sense to me.

EDIT: Now i'm going to the other computer and gonna work with flash there, but it's just Flash 5. It works, right?

Coming back soon

SeiferTim
December 20th, 2004, 12:34 PM
Finally...
;) Well, at least until Kirupa gets the next 2 pages up on the site.... then all bets are off... :P
Good luck, and I hope you post your game eventually.

RyxiaN
December 20th, 2004, 01:18 PM
where is your tutorial? can you link it because i need it

SeiferTim
December 20th, 2004, 01:28 PM
You can find it here: http://www.kirupa.com/developer/actionscript/rpgprogramming.htm
For some reason, it seems like my server is acting up... I'm not at home, so I can't really check it.

RyxiaN
December 21st, 2004, 03:42 AM
But it doesn't work at Flash 5, right? Because there is no "Export for ActionScript" in the "Linkage..."

SeiferTim
December 21st, 2004, 09:18 AM
Um, what are the options under "Linkage"?

RyxiaN
December 21st, 2004, 09:25 AM
Export for Movie
Export for Movie Clip
No Linkage

I think!!!! I dont have internet on my flash computer...

SeiferTim
December 21st, 2004, 10:57 AM
I think that the linkage thing is new to FlashMX2004. You can download the 30-day demo of MX2004 from http://www.macromedia.com

RyxiaN
December 21st, 2004, 10:58 AM
but I like just MX :P But i can just download 2004 (not trail) on DC++...

RyxiaN
December 25th, 2004, 03:40 PM
Just want to keep a ***** [Five Star] tutorial alive!

Sammo
December 25th, 2004, 04:07 PM
if DC++ is what I think it is from the context of that you need to see this:


Despite that fact, a serial number given by erain would tell you what to do with it.

Unless your serial number is an illegal one. And if so.... I think it's been made pretty clear that talk of illegal software here is highly frowned upon. source (http://kirupaforum.com/forums/newreply.php?do=newreply&p=692004)

Sammo
December 30th, 2004, 11:23 AM
wow! I killed a 12 page 5 star thread! :)

EDIT: LOL my post was the first for page 13 :P

SeiferTim
December 30th, 2004, 12:00 PM
That depends on your settings... I'm only seeing 5 pages...
;)
I guess no one cares anymore - but I think this topic will boom again when the next few pages are up.... :ne:

RyxiaN
December 31st, 2004, 09:46 AM
This thread aren't a tutorial anymore. It's a chat thread! ;)

Sammo
January 1st, 2005, 02:33 PM
No it's a great tutorial gone n00b problem page.

signifer123
January 1st, 2005, 02:34 PM
Its been quite a while since it was a tutorial :P

RyxiaN
January 2nd, 2005, 01:25 PM
For us it's just a chat. But for noobs that are reading it it's a tutorial.

bryamatt
January 2nd, 2005, 10:39 PM
so when are we gonna see those next couple pages? because I am anxiously awaiting them.

RyxiaN
January 3rd, 2005, 06:27 AM
Yeah me to. But what shall ethose pages tell? What are we noobs gonna learn from them?

SeiferTim
January 3rd, 2005, 07:33 AM
so when are we gonna see those next couple pages? because I am anxiously awaiting them.
I've sent them to Kirupa already, and he's assured me they will be up soon...

RyxiaN
January 3rd, 2005, 07:44 AM
But what shall it be? What shall we learn from it? (My mad english)

SeiferTim
January 3rd, 2005, 09:47 AM
Well page 8 is all about making doors to link maps together, and page 9 is about the game mechanics (which will lead up to the battle system, which I'm working on now for page 10)...
Anyone who wants to see these pages before Kirupa puts them on the site can goto http://seifertim.no-ip.com/rpgTut/page08.htm

Hopefully, page 10 will be finished in a week or so - it'll be a big one though... since its not an easy task to make a working battle-system. But page 11 will be pretty simple: it will involve making an editor (like the map editor) to be able to easily create new weapons.

RyxiaN
January 3rd, 2005, 09:51 AM
Okay... but then you have to explain for me. Bad english

SeiferTim
January 8th, 2005, 08:28 PM
Sounds great! Essentially, a multiplayer Pre-PSX Final Fantasy, with a dynamic storyline, am I right? This sounds like it would rock.

The flags would also work for a non-multiplayer game, if you wanted to make your story that complex.

The trouble with my tutorial that I'm having now is getting my battle messages to display and then disappear on their own, but I'm close to fixing that problem. Hope to see more about your game - don't steal any of my story ideas ;)

kieran350
January 9th, 2005, 06:24 AM
How can a make the boxes instance names slot1 eg?

rosdlim
January 10th, 2005, 02:36 PM
I'm not sure if this thread is still active or not, but I thought it'd be a good place to post what I've made with the help of the knowledge from this tutorial and others. But with my own twist ;)
Introducing the as of yet unnamed dungeon game!
http://bitz.net/~chadc/dungeon/dungeon1.html

SeiferTim
January 10th, 2005, 02:51 PM
Wow, pretty cool! I didn't get to do too much, since I'm at work - are there enemies to fight?

And you say my tutorial helped? :beam:

oicu812
January 10th, 2005, 04:36 PM
nice dungeon primer, rosdlim. brought back memories of playing 'eye of the beholder', which I use to play in dos. I clicked on three seperate switches I think, before i got lost. the only other first person flash game I remember playing is 'ronin spirit of the sword'. However, your game looks like it will be awesome, cant wait to see the monster edition :) I linked ronin below, its not my work.

to load copy and paste in adress bar and press enter. do not left click link because it wont work.

http://uploads.ungrounded.net/93000/93066_Samurai.swf (http://uploads.ungrounded.net/93000/93066_Samurai.swf%3E%3Cbr%20/%3E%0A%20ronin%20spirit%20of%20the%20sword%20%3C/a%3E%3Cbr%20/%3E%0A%20%3Cbr%20/%3E%0A%20but%20your%20game%20looks%20awesome%20can t%20wait%20to%20test%20the%20monster%20edition%20% 3Cimg%20src=)

rosdlim
January 10th, 2005, 04:39 PM
No monsters to fight yet, should be working in a few days though - that's next on the list. I've read a bunch of 2d game tutorials, but yours really helped me out of the bind of how to store information about the party members and monsters for stats, and equipment. The item map was something I hadn't thought about before reading this too, and afterwards I have map entities like switchable doors and messages.

Oh, and oicu812 - One of the reasons I started this project because I knew I wanted to make a game in flash, but wanted to do something I hadn't seen in flash before. And just like that, Wizardry 5 for the SNES and Eye of the beholder came back to me.

SeiferTim
January 13th, 2005, 10:59 AM
No monsters to fight yet, should be working in a few days though - that's next on the list. I've read a bunch of 2d game tutorials, but yours really helped me out of the bind of how to store information about the party members and monsters for stats, and equipment. The item map was something I hadn't thought about before reading this too, and afterwards I have map entities like switchable doors and messages.

Oh, and oicu812 - One of the reasons I started this project because I knew I wanted to make a game in flash, but wanted to do something I hadn't seen in flash before. And just like that, Wizardry 5 for the SNES and Eye of the beholder came back to me.
And there's always Shadowgate...

shotmenot
February 7th, 2005, 12:09 PM
i was working with the rpg (the way you learn how to make on this page) im trying to put items in like a gold coin, but every time i do and i move my guy, the coin stays still (this is because i did the rpg in the way that the background scrolls and the man stays still) how do i fix this so the coin moves with the background yet can be picked up

SeiferTim
February 7th, 2005, 12:22 PM
Hmm...
Well, what I would do it attach the Coins to a new blank movie clip, and move them both together. In fact, In one of my later pages I will explain just how to do that.
Read this page: http://seifertim.no-ip.com/rpgTut/page08.htm and it will show you how to attach items to an ItemMap, and if whenever you move the backgroundMap, you move the ItemMap the same ammount, it should work just fine.

shotmenot
February 7th, 2005, 12:48 PM
i was looking at how you say to do it, you use the grid system i used a compleatly different way, is it possable to put both of the ways (yours and the tutorial on this thread) together and make it work?

im putting on my fla if u want to see what i mean

shotmenot
February 7th, 2005, 01:30 PM
dont worry about the last post unless you want to, im starting a new one with your tutorial

SeiferTim
February 7th, 2005, 01:50 PM
Ah
Well, it is possible, but If you're doing anything that relates to spawning items that the player can pick up, making an empty MC, and attaching those MCs to it would be the best way to do it.
Example:
You have a background layer named map_mc
And you have an item layer named items_mc
Also, if you have any NPCs, or monsters, I would make a 3rd level - npcs_mc
your map_mc would contain your background, and lets say you have a chest on the item map, and a person on the npc map.
You would attachMovie() the chest to the items_mc like this:

_root.items_mc.attachMovie("chest01","chest_mc", this.getNextHighestDepth());
_root.items_mc.chest01._x = 50;
_root.items_mc.chest01._y = 50;
And close to the same thing for the NPC.
Now, lets say that whenever you move the guy up, the map moves down by 5. Then your code would look similar to this:

onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
_root.map_mc._y+=walkSpeed;
_root.items_mc.y+=walkSpeed;
_root.npcs_mc.y+=walkSpeed;
}
}

Which means that all objects attached to those mcs move the same ammount at the same time.

Obviously, there are better ways to do that, which would match the rest of your code, but that's it in a nutshell.

shotmenot
February 7th, 2005, 01:53 PM
well thanks for all your help, but after looking at some of the more advanced stuff when doing that kind of rpg, they are way harder then your version. so im going to do yours.

SeiferTim
February 7th, 2005, 02:00 PM
Okay. Works for me!
Thinking about it though, I realize that you could probably attachMovie all your maps to one blank mc at the _root, and just move that map when ever you want to move.
But, its up to you. :beam:

shotmenot
February 7th, 2005, 02:12 PM
im using your tutorial and i tihnk i found a mistake.

you say (page 6) when making the maps to linkage your moving_mc and that you called it guy_mc. well after doing that and not being able to get it to work i downloaded the fla. I noticed that you linkages the thing as just "guy" and if u call it "guy_mc" it dosnt work. i might be wrong but its better to check first. Is this right?

SeiferTim
February 7th, 2005, 02:25 PM
Let me look into it...

SeiferTim
February 8th, 2005, 10:10 AM
Hmmm... I don't really know what I did there... that's wierd... I'll have to play with the source when I get a chance.... When you start getting too many names of things, it gets confusing :beam:

BTW: when will you be showing off your code? ;)

shotmenot
February 8th, 2005, 10:16 AM
well i understand, im not saying you suck and are bad at making tutorials, hell i wouldnt be able to make one as good as yours, hey its only 1 mistake (if its a mistake) its still a great tutorial

shotmenot
February 8th, 2005, 10:18 AM
BTW: when will you be showing off your code? ;)

what do you mean by tihs??

SeiferTim
February 8th, 2005, 10:25 AM
I mean, I hope to see your final product, and get to try it out.
I don't mean you have to show your source.

shotmenot
February 8th, 2005, 10:44 AM
well, as soon as i finish your tutorial ill show it to you, im going to work on with what you showed me and try to add a little game part to it (if you press space they guy swings his sword) ill keep you updated on how its going

shotmenot
February 8th, 2005, 11:10 AM
OOH just noticed something, i was working with my rpg, and the doors, you have to be sure to get the guy smaller then the tiles otherwise he wont beable to fix through ( i noticed this when it was getting hard to get my guy to fit through the door because he was close to the size of the tiles)

SeiferTim
February 8th, 2005, 12:57 PM
OOH just noticed something, i was working with my rpg, and the doors, you have to be sure to get the guy smaller then the tiles otherwise he wont beable to fix through ( i noticed this when it was getting hard to get my guy to fit through the door because he was close to the size of the tiles)

Or make the door take up more than one tile.
you can make the guy be say 1.5 times bigger than the tiles, but you would need at least 2 side-by-side tiles for the door.
like this:
[0][0][1][2][0][0]
0 = wall, 1 = left door tile, 2 = right door tile.

shotmenot
February 8th, 2005, 01:01 PM
ok, i was wondering how you would do that, i looked through the numbers

these are my maps

map1 = [[2,2,2,2,2,2,2,2,2],
[2,2,2,0,0,0,0,0,2],
[2,2,1,0,0,0,0,0,2],
[2,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,2],
[1,1,1,0,0,0,1,1,2],
[1,1,0,0,0,0,0,1,1],
[1,1,1,1,3,2,2,1,1]];

map2 = [[2,2,2,2,4,2,2,2,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,2,1],
[2,0,0,0,0,0,0,2,2],
[2,0,0,0,0,0,0,2,2],
[2,0,0,0,0,0,2,2,2],
[2,0,0,0,0,2,2,2,2],
[2,2,2,2,2,2,2,2,2]]


would i just add another 3 to the first one, and a 4 to the second but make sure they line up?

SeiferTim
February 8th, 2005, 01:05 PM
map1 = [
[2,2,2,2,2,2,2,2,2],
[2,2,2,0,0,0,0,0,2],
[2,2,1,0,0,0,0,0,2],
[2,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,2],
[1,1,1,0,0,0,1,1,2],
[1,1,0,0,0,0,0,1,1],
[1,1,1,1,3,4,2,1,1]];

map2 = [
[2,2,2,2,5,6,2,2,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,2,1],
[2,0,0,0,0,0,0,2,2],
[2,0,0,0,0,0,0,2,2],
[2,0,0,0,0,0,2,2,2],
[2,0,0,0,0,2,2,2,2],
[2,2,2,2,2,2,2,2,2]];

I would do it that way, so that if they stepped on "5", it would take them to "3", and vice-versa. If they entered the door through the left, they would end up on the left.
Also, if you wanted to make, say, a large area be a doorway, you would want to do it like this:


map1 = [
[2,2,2,2,2,2,2,2,2],
[2,2,2,0,0,0,0,0,2],
[2,2,1,0,0,0,0,0,2],
[2,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,2],
[1,1,1,0,0,0,1,1,2],
[1,1,0,0,0,0,0,1,1],
[1,1,3,4,5,6,7,1,1]];

map2 = [
[2,2,8,9,10,11,12,2,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,2,1],
[2,0,0,0,0,0,0,2,2],
[2,0,0,0,0,0,0,2,2],
[2,0,0,0,0,0,2,2,2],
[2,0,0,0,0,2,2,2,2],
[2,2,2,2,2,2,2,2,2]];

shotmenot
February 8th, 2005, 01:07 PM
ok, im altering the map, i have the numbers and stuff,


i have


tile3 = function () {};
tile3.prototype = new door(2, 4, 1);

tile4 = function () {};
tile4.prototype = new door(1, 4, 7);

tile5 = function () {};
tile5.prototype = new door(2, 4, 1);

tile6 = function () {};
tile6.prototype = new door(1, 4, 7);



as the script, but with this it sends tile 3 to 6, and 4 & 5 do not work, does that have to do with the "new door(#, #, #)" thing?

shotmenot
February 8th, 2005, 01:24 PM
ok, im stumped, how do you fix it?

SeiferTim
February 8th, 2005, 02:07 PM
tile3 = function () {};
tile3.prototype = new door(2, 4, 1);

tile4 = function () {};
tile4.prototype = new door(2, 5, 1);

tile5 = function () {};
tile5.prototype = new door(1, 4, 7);

tile6 = function () {};
tile6.prototype = new door(1, 5, 7);

This should work if 3 goes to 5, and 4 goes to 6.

shotmenot
February 8th, 2005, 02:14 PM
OOO!! thats, i was fiddling around with the script before you posted, i got one of them right, could you tell me what the 3 numbers in the ()'s mean?

shotmenot
February 8th, 2005, 02:59 PM
the reason i want to know more about the numbers is i plan on making lots of maps that are all connected. and i need to know how to link the doors together,

SeiferTim
February 8th, 2005, 05:08 PM
If I remember correctly (doubtful ;) ) They are: Map#, X Position to deposit to, and Y position to deposit to.

So if you set it to 2,1,1 it will place the guy on top of tile 1,1, on the second map.

shotmenot
February 9th, 2005, 11:06 AM
im having some troubles with the doors, i have my guy and all the coordinates right for the doors, but sometimes when he goes through it snags on the edge of the water making you have to move around up just to be able to continue in teh direction. is there something wrong with the size of the guy or the script putting him on a weird position on the tile?

shotmenot
February 9th, 2005, 12:01 PM
i think i have added way to many things, i tried to add a castle that takes u to another map, but i cant get it to door right can you help me clean it? and get it to work?


this is the script


door.prototype.barrier = false;
door.prototype.pos = 0;
door.prototype.isDoor = true;
door2.prototype.barrier = false;
door2.prototype.pos = 10;
door2.prototype.isDoor = true;

tile0 = function () {};
tile0.prototype.pos = 1;
tile0.prototype.barrier = false;

tile1 = function () {};
tile1.prototype.pos = 2;
tile1.prototype.barrier = true;
tile2 = function () {};
tile2.prototype.pos = 3;
tile2.prototype.barrier = true;
tile9 = function () {};
tile9.prototype.pos = 4;
tile9.prototype.barrier = true;


tile3 = function () {};
tile3.prototype = new door(2, 4, 1);
tile4 = function () {};
tile4.prototype = new door(2, 5, 1);
tile5 = function () {};
tile5.prototype = new door(1, 4, 7);
tile6 = function () {};
tile6.prototype = new door(1, 5, 7);
tile7 = function () {};
tile7.prototype = new door(3, 7, 6);
tile8 = function () {};
tile8.prototype = new door(1, 1, 6);
tile10 = function () {};
tile10.prototype = new door2(4, 1, 4);
tile11 = function () {};
tile11.prototype = new door(2, 5, 4);

tile10 = function () {};
tile10.prototype.pos = 5;
tile10.prototype.barrier = true;



currentMap = 1;

map1 = [
[2,2,2,2,2,2,2,2,2],
[2,2,2,0,0,0,0,0,2],
[2,2,1,0,0,0,0,0,2],
[2,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,2],
[7,0,0,0,0,0,1,1,2],
[1,1,0,0,0,0,0,1,1],
[1,1,1,1,3,4,2,1,1]];
map2 = [
[2,2,2,2,5,6,2,2,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,2,1],
[2,0,0,10,0,0,0,2,2],
[2,0,0,0,0,0,0,2,2],
[2,0,0,0,0,0,2,2,2],
[2,0,0,0,0,2,2,2,2],
[2,2,2,2,2,2,2,2,2]];
map3 = [
[2,2,2,2,2,2,2,2,2],
[2,0,0,0,0,0,0,0,2],
[2,0,9,9,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[1,1,0,0,0,0,0,0,2],
[1,1,1,1,0,0,0,0,8],
[1,1,1,1,1,1,0,0,2],
[1,1,1,1,1,1,2,2,2]]
map4 = [[2,2,2,2,2,2,2,2,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,2,2,2,11,2,2,2,2]]

if u need anything else let me know

SeiferTim
February 9th, 2005, 12:15 PM
door.prototype.barrier = false;
door.prototype.pos = 0;
door.prototype.isDoor = true;

door2.prototype.barrier = false;
door2.prototype.pos = 10;
door2.prototype.isDoor = true;

tile0 = function () {};
tile0.prototype.pos = 1;
tile0.prototype.barrier = false;

tile1 = function () {};
tile1.prototype.pos = 2;
tile1.prototype.barrier = true;

tile2 = function () {};
tile2.prototype.pos = 3;
tile2.prototype.barrier = true;

tile3 = function () {};
tile3.prototype = new door(2, 4, 1);

tile4 = function () {};
tile4.prototype = new door(2, 5, 1);

tile5 = function () {};
tile5.prototype = new door(1, 4, 7);

tile6 = function () {};
tile6.prototype = new door(1, 5, 7);

tile7 = function () {};
tile7.prototype = new door(3, 7, 6);

tile8 = function () {};
tile8.prototype = new door(1, 1, 6);



tile9 = function () {};
tile9.prototype.pos = 4;
tile9.prototype.barrier = true;

tile10 = function () {};
tile10.prototype = new door2(4, 1, 4);

tile11 = function () {};
tile11.prototype = new door(2, 5, 4);

currentMap = 1;

map1 = [
[2,2,2,2,2,2,2,2,2],
[2,2,2,0,0,0,0,0,2],
[2,2,1,0,0,0,0,0,2],
[2,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,1],
[1,1,1,1,0,0,0,0,2],
[7,0,0,0,0,0,1,1,2],
[1,1,0,0,0,0,0,1,1],
[1,1,1,1,3,4,2,1,1]];

map2 = [
[2,2,2,2,5,6,2,2,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,1,1],
[2,0,0,0,0,0,0,2,1],
[2,0,0,10,0,0,0,2,2],
[2,0,0,0,0,0,0,2,2],
[2,0,0,0,0,0,2,2,2],
[2,0,0,0,0,2,2,2,2],
[2,2,2,2,2,2,2,2,2]];

map3 = [
[2,2,2,2,2,2,2,2,2],
[2,0,0,0,0,0,0,0,2],
[2,0,9,9,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[1,1,0,0,0,0,0,0,2],
[1,1,1,1,0,0,0,0,8],
[1,1,1,1,1,1,0,0,2],
[1,1,1,1,1,1,2,2,2]]

map4 = [
[2,2,2,2,2,2,2,2,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,0,0,0,0,0,0,0,2],
[2,2,2,2,11,2,2,2,2]]

I tried to clean it up a bit, but Its hard for me to see exactly what you're doing... though I noticed you had 2 different 10s defined... and it loooks like one of your doors places the Guy on top of another door, which causes chaos... If you can post your FLA, I can look at it when I get home from work tonight...

shotmenot
February 9th, 2005, 12:20 PM
thats the only problem the fla is to large for posting. yes i know i have multiple 10s, i tried to make a new item (its a tower) so that when you walk on it it acts like a door and sends you to a new map, and its being a pain, ill see if i can post the fla somehow

shotmenot
February 9th, 2005, 12:35 PM
hey, i got it to work, i forgot to put another thing of script that tells what door2 does, thanks for your help though

SeiferTim
February 9th, 2005, 01:06 PM
:D
It's always something silly, that someone overlooked, right? ;)

shotmenot
February 9th, 2005, 01:08 PM
yar, i was scanning through to see if i could fix the tiles because the castle wasnt showing, so i noticed that i was missing a big thing about door2, so i added it and presto it was fixed

if u want i can post the swf

shotmenot
February 9th, 2005, 01:28 PM
awww crap its a 2004 flash, so i have to change stuff for mx poo, might take a little longer

SeiferTim
February 9th, 2005, 02:01 PM
:h:
I would like to see the Swf...
what do you mean its a 2004? You can't SWF it?

shotmenot
February 10th, 2005, 01:21 AM
:h:
I would like to see the Swf...
what do you mean its a 2004? You can't SWF it?

i tried sending it to my friend, he had troubles getting it to load

SeiferTim
February 10th, 2005, 09:26 AM
That's sweeeeeeeeeeeeeeeet! :D
I like the way it looks like someone doodled everything with a sharpy - it gives it a unique style! :beam:

shotmenot
February 10th, 2005, 09:29 AM
well, i have a drawing tablet, and i used it to draw everything, i hate drawing with the mouce because it sucks. thanks! still having some trouble wiht the maps (if been screwing with your map making program trying to add in the new tiles) i havnt gotten to your last page of the tutorial, ill hit that tonight

SeiferTim
February 10th, 2005, 10:11 AM
well, i have a drawing tablet, and i used it to draw everything, i hate drawing with the mouce because it sucks. thanks! still having some trouble wiht the maps (if been screwing with your map making program trying to add in the new tiles) i havnt gotten to your last page of the tutorial, ill hit that tonight

Screw with it all you want! :beam: The whole point is just to show you that it can be done. I saw someone who made it with a lot of tiny tiles, so their matrix was like 30 X 30 tiles, and like 20 different tiles to choose from (and that was only on one map!), which allows for having a lot more detail in the backgrounds. Unfortuantely, my server seems to be down, and I don't know why... probably something to do with my router, but it should be back up later tonight (...if I can fix it :worried:).

shotmenot
February 10th, 2005, 10:37 AM
well, i was planning on making many more tiles, and more detailed tiles also, so im writing down and renumbering them like i plan on having half squares [/] kind of squares round things, ill show you all the tiles when i produce them. im planning on working on this at school also, becasue what were are doing in my computer class right now really sucks

p.s. fix your site ****IT!

SeiferTim
February 10th, 2005, 10:54 AM
p.s. fix your site ****IT!

I can't! I'm at work! :crying: But I wish I could fix it...
Not to mention something went wrong with my Forum, that I can't figure out...

I'm probably going to have to make a backup of the site, and my database, and then re-install Debian again :P

shotmenot
February 10th, 2005, 10:59 AM
oh well, at least your trying :P are u sure all your html is right or is it something with your server or hosting?

SeiferTim
February 10th, 2005, 11:02 AM
No, its probably my Router.
My cat unplugged it last night, and i bet when I got it running again this morning, it assigned my Server a different internal IP than its supposed to, but I can't tell for sure until I get home.

shotmenot
February 10th, 2005, 11:12 AM
aww that sucks you got a kitty hacker :P

SeiferTim
February 11th, 2005, 08:22 AM
I got my server back up! So you can now enjoy the missing 2 pages!

shotmenot
February 11th, 2005, 10:32 AM
yay, i sketched out all the tiles i have to make for my game theres alot. in total i will have atleast 53 tiles. most are the same as the others just rotated etc its all just different forms of each other

SeiferTim
February 11th, 2005, 01:04 PM
yay, i sketched out all the tiles i have to make for my game theres alot. in total i will have atleast 53 tiles. most are the same as the others just rotated etc its all just different forms of each other

All it takes is a simple trick to add variety. :D

shotmenot
February 11th, 2005, 04:52 PM
the only problem with only rotating some of them is the grain of the tiles like the way the water is going will class like most will go up and if i rotate it will look weird like ^^^>^^^>>^^

shotmenot
February 14th, 2005, 11:01 AM
i have started work on the tiles, like actual work not just screwing around. wow, its going to take a while, but i have found a new love for the select inverse function

SeiferTim
February 14th, 2005, 11:26 AM
Good luck!

shotmenot
February 14th, 2005, 11:52 AM
thanks, only got 24 more tiles left :P

shotmenot
February 14th, 2005, 12:02 PM
for the matrix it uses to read the tiles can u use letters as well? i was hoping to make all my doors letters and my tiles numbers, can u do this?

SeiferTim
February 14th, 2005, 12:22 PM
I think that would work.