PDA

View Full Version : RPG char problem



tiny_87
March 18th, 2004, 05:53 AM
hi , i have a problem with my Character in my RPG game (zelda wiev).
I cant make the char load the mc i made inside the "man" to make it look like he really is walking , would be very happy if you could help me , if i explained bad so just download the .zip file where the .fla is.

moo moo , hope someone can help.

WarrOrange
March 18th, 2004, 10:40 PM
could u elaborate a little plz ;)

WarrOrange
March 18th, 2004, 10:41 PM
my fault i missed to obious action script on the character (lol) hold on lemme check it out bro

WarrOrange
March 18th, 2004, 10:45 PM
beats me but i bet marz could figure it out, but i know he wont download stuff so i will give ya a visual marz, we just got a zelda like character on the general view area. in the frame action script you got a simple stop; function and then on the character you got an action script as such onClipEvent (load) {
step = 5;
ok = true;
}
onClipEvent (keyDown) {
if (Key.isDown(Key.LEFT)) {
_root.man.left.gotoAndPlay(1);
_root.man._x -= step;
_root.mask._x -= step;
_root.big_lab._x += step;
for (i=1; i<=95; i++) {
if (_root.man.mask.hitTest(_root["part"+i])) {
ok = false;
break;
}
}
if (!ok) {
_root.man._x += step;
_root.mask._x += step;
_root.big_lab._x -= step;
ok = true;
}
}
}
onClipEvent (load) {
step = 5;
ok = true;
}
onClipEvent (keyDown) {
if (Key.isDown(Key.UP)) {
_root.man.back.gotoAndPlay(1);
_root.man._y -= step;
_root.mask._y -= step;
_root.big_lab._y += step;
for (i=1; i<=95; i++) {
if (_root.man.mask.hitTest(_root["part"+i])) {
ok = false;
break;
}
}
if (!ok) {
_root.man._y += step;
_root.mask._y += step;
_root.big_bang._y += step;
ok = true;
}
}
}
onClipEvent (load) {
step = 5;
ok = true;
}
onClipEvent (keyDown) {
if (Key.isDown(Key.RIGHT)) {
_root.man.right.gotoAndPlay(1);
_root.man._x += step;
_root.mask._x += step;
_root.big_lab._y += step;
for (i=1; i<=95; i++) {
if (_root.man.mask.hitTest(_root["part"+i])) {
ok = false;
break;
}
}
if (!ok) {
_root.man._x -= step;
_root.mask._x -= step;
_root.big_lab._y -= step;
ok = true;
}
}
}
onClipEvent (load) {
step = 5;
ok = true;
}
onClipEvent (keyDown) {
if (Key.isDown(Key.DOWN)) {
_root.man.front.gotoAndPlay(1);
_root.man._y += step;
_root.mask._y += step;
_root.big_lab._y += step;
for (i=1; i<=95; i++) {
if (_root.man.mask.hitTest(_root["part"+i])) {
ok = false;
break;
}
}
if (!ok) {
_root.man._y -= step;
_root.mask._y -= step;
_root.big_lab._y -= step;
ok = true;
}
}
}

tiny_87
March 19th, 2004, 04:18 AM
have been trying to get the char to work for about 3-4 days now , i give up soon and quit using flash....

BullDog_Flash
March 19th, 2004, 02:45 PM
Dude dont quit using flash man.

The [problem may be hard for you but you dont have to quit flash at all.

Geez you dont know how much rpoblems i run into all the times with flash it unbelievable but you have to go trhough it step by step figure out why it dont work.

Then fix it.

Im looking through your fla now.

SeiferTim
March 19th, 2004, 02:50 PM
Why don't you put this project aside, and work on something else for awhile? Make up a new project that may have similar functions, but not exactly, or even close to being identical, and work on that. Something simple, and quick mind you, then, perhaps you'll figure something out from that project, and then use it in this one, and if not, then at least you can come back with a refreshed mind. I really don't know what's wrong, I haven't had a chance to really look at it, but chances are its something really stupid, that you'll be kicking yourself for months after you figure it out. We all do that. Heck, I get frustrated with my Design Doc on a daily basis, and give up, work on something else, and then come back later, and type like mad.... :D That could be part of the reason its taken like 3 years to come up with what I've got now :!: :D Good luck!

tiny_87
March 21st, 2004, 09:46 AM
ok, thanks for the tips :)
i start a new project and try something else then...
good luck with your projects =)

pete|Flash
March 21st, 2004, 11:38 AM
Okay, so here is my take on your file:

http://www.nitric.net/~pete/flash/Character.swf
http://www.nitric.net/~pete/flash/Character.zip

Bear in mind, i tried to streamline it all, but stopped somewhat short in a bid to make it understandable

***MAIN CHANGES***

1) renamed the sub-character movieClips, so they all shared the same instance name (after all, only 1 is on screen at any given time)

2) changed the code (it was rubbish)

3) got rid of the hitTest-ing. You will probably want to put this back in at some point. But it wasnt necessary for the time being

[ #flash ] [ Quakenet ] [ IRC ]

SeiferTim
March 21st, 2004, 11:43 AM
I'm walking! Iiiiiiiii'm walking! :D

tiny_87
March 22nd, 2004, 03:26 AM
something is wrong o_O
it dont work in flash 5 or ?
becouse school dont have latest flash version and i do the game in school , so...
hm, dont know what to make it work then..it only stands there walking and not changing ...
:(
but thank you anyway.