PDA

View Full Version : Stick RPG



Robman1
June 1st, 2004, 12:21 AM
Recently there was a post tutorializing the making of Stick RPG. There were a couple of problems and i was wondering if anybody knew the answer.

Not being able to walk through buildings.
Have a skateboard type object.

Second Question:

If you open up Stick RPG in flash mx, you can enlarge the screen to see how the author made his background. As the stick walks a nearby movieclip appears. I am guessing this was to keep a fast fps. Does anybody know how to attack a movie clip to a certain coordinate? Sot that it is not centered?

Robman1
June 2nd, 2004, 12:01 AM
not to be a bother, but does anybody know the answers?

lucas92
June 2nd, 2004, 12:17 AM
i will find out for you tonight and post a link or jsut a code or something.

lucas92
June 2nd, 2004, 12:23 AM
VENGEANCE posted this on the sfdt forums. I hope it helps.

It depends. If you are controlling the guy by making him move down on the _y axis when you press down, then that's the way that nobody seems to use. As far as I've seen, a lot of people seem to use a 'speed' thing or something, that sets the _y or _x 'speed'. You can easily find out the answer if it's for that, but if it's for the way I previously mentioned, in other words, the one I'm currently using in my RPG, then you need to do this:

If someone runs into the right side of the building, you want him to get pushed to the left, don't you? Make an invisible box surrounding ONLY the left side of the building and give it this script:

onClipEvent (enterFrame) {
if (_root.warrior.hit.hitTest(this)) {
_root.warrior._x -=5
}
}


However, you may want to change it. This is for my game, in which 'warrior' is the character you move around, and 'hit' is the small area of him that the building will react to. You will have to change the target path for yours.

Similarly, you will also need to make barriers like it on each side of the building, but change the direction they tell the character to move to. You might want to make several lined up next to each other to assure that the character cannot go through them - that's what I had to do. I will post more if i find it

lucas92
June 2nd, 2004, 12:27 AM
This is by MARS of SFDT.


The script I have on the CHARACTER is,

onClipEvent (load) {
_root.downwalk = true;
_root.upwalk = true;
_root.rightwalk = true;
_root.leftwalk = true;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT) && _root.rightwalk == true) {
this._x += 5;
this.gotoAndStop(2);
_root.leftwalk == true;
}
if (Key.isDown(Key.LEFT) && _root.leftwalk == true) {
this._x -= 5;
this.gotoAndStop(3);
_root.rightwalk == true;
}
if (Key.isDown(Key.up) && _root.upwalk == true) {
this._y -= 5;
this.gotoAndStop(4);
_root.upwalk == true;
}
if (Key.isDown(Key.down) && _root.downwalk == true) {
this._y += 5;
this.gotoAndStop(5);
_root.downwalk == true;
}
}

And the script I have on the object is,

onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && this._x > _root.character._x) {
_root.rightwalk = false;
}
}
onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && this._x < _root.character._x) {
_root.leftwalk = false;
}
}
onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && this._y < _root.character._y) {
_root.upwalk = false;
}
}
onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && this._y > _root.character._y) {
_root.downwalk = false;
}
}

I have invisible walls around the object too so that when you move away from the wall you can move around freely (otherwise you just mess up). The script on the invisible walls is,

onClipEvent (enterFrame) {
if (_root.character.hitTest(this) && this._x > _root.character._x) {
_root.rightwalk = true;
}
if (_root.character.hitTest(this) && this._x < _root.character._x) {
_root.leftwalk = true;
}
if (_root.character.hitTest(this) && this._y < _root.character._y) {
_root.upwalk = true;
}
if (_root.character.hitTest(this) && this._y > _root.character._y) {
_root.downwalk = true;
}
}

The only problem is that if you walk diagnally you will go through the wall

Robman1
June 2nd, 2004, 01:00 AM
allright thanks man....so does anybody know the conclusion to this part of the problem or an answer to any of the other answers?

Robman1
June 7th, 2004, 08:53 AM
hello?

Robman1
June 8th, 2004, 09:10 AM
I still need the answer to the other questions

signifer123
June 8th, 2004, 09:08 PM
i don't hink anybody know or maybe they don't care or maybe its just a repeat of one of those annoying questions like the wall one

but for the skateboard one you just test some variables so if yuo have it if he buys something then x=1 and have if x=1 && shift is down then have it do double movespeed because that is easier to do than wit hthe script lucas gave ya its a good script but its easier to use the walk script in the rpg tut in this section and haev the stated above in coding

Robman1
June 9th, 2004, 09:11 AM
yea but i asked more than a repeated question. If nebody gets some swifty software (not swift but swifty) you can open up the game after it is loaded into your temporary internet files. When that is done open it up in macromedia flash. Enlarge the screen and you will see the map is not whole but rather segmented. How does he do this?