Be a Supporter!

return screen after battle rpg

  • 355 Views
  • 9 Replies
New Topic Respond to this Topic
The-Speed-Demon
The-Speed-Demon
  • Member since: May. 24, 2007
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
return screen after battle rpg 2008-11-23 15:01:50 Reply

hi, im having some problems making an RPG. when my character goes into battle and wins i want to be able to put him back in the exact spot and frame where he started the battle. the battle starts with a hit test on the enemy and goes into a new frame for the battle. help is appreciated. thank you.

animatorjones
animatorjones
  • Member since: Mar. 22, 2004
  • Offline.
Forum Stats
Member
Level 16
Blank Slate
Response to return screen after battle rpg 2008-11-23 15:06:05 Reply

i have no idea really but the first thing that comes to mind would be to make a X,Y marker when he enters battle.

not sure how that would work but you could have 2 variables that are identical to position x, y. then when battle your battle is over. code in something that loads/places the player at that x,y?

not sure if that is understandable.

Alexman159
Alexman159
  • Member since: Sep. 19, 2007
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to return screen after battle rpg 2008-11-23 15:20:15 Reply

make a text box that always shows his X and Y and put that same text box in the battle and win screen and have him go to the coordinates of the txt box


Response to "dumbest person you ever met" :
"Some girl I knew once forgot how to breath." -Dlxrevolution

BBS Signature
uyersuyer
uyersuyer
  • Member since: May. 15, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to return screen after battle rpg 2008-11-23 15:40:06 Reply

Have two variables. Name them something you'll remember, like oldX and oldY. On the hitTest that initiates the battle, add this code:

_root.oldX=_root.[the instance name of your player]._x;
_root.oldY=_root.[the instance name of your player]._y;

Then when the battle ends, just add this code:

_root.gotoAndStop([# of frame you want to go back to);
_root.[the instance name of your player]._x=_root.oldX;
_root.[the instance name of your player]._y=_root.oldY;

Hope that helps.


"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe

BBS Signature
The-Speed-Demon
The-Speed-Demon
  • Member since: May. 24, 2007
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to return screen after battle rpg 2008-11-23 18:03:07 Reply

okay, i'll try out what you guys have shown me. i have tried reentering co-ordinates arbitrarily after battle to return the character. i had problems with the background going back to the starting position (a scrolling map). i'll try putting the same code in for the map and see what happens. i'll post back.

The-Speed-Demon
The-Speed-Demon
  • Member since: May. 24, 2007
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to return screen after battle rpg 2008-11-23 18:16:21 Reply

At 11/23/08 06:03 PM, The-Speed-Demon wrote: okay, i'll try out what you guys have shown me. i have tried reentering co-ordinates arbitrarily after battle to return the character. i had problems with the background going back to the starting position (a scrolling map). i'll try putting the same code in for the map and see what happens. i'll post back.

where is edit? anyways, it works! i made variables for the background and player. i have some items on the screen and when i return to the screen the items are somewhere else. i'll have to add variables for all the items i plan to make for the game or is there a shorter way to write this code for more than one movieclip?

uyersuyer
uyersuyer
  • Member since: May. 15, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to return screen after battle rpg 2008-11-23 18:52:45 Reply

At 11/23/08 06:16 PM, The-Speed-Demon wrote:

i'll have to add variables for all the items i plan to make for the game or is there a shorter way to write this code for more than one movieclip?

You could just write a procedure that handles all the items instead of having to do the code for every single object.


"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe

BBS Signature
The-Speed-Demon
The-Speed-Demon
  • Member since: May. 24, 2007
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to return screen after battle rpg 2008-11-23 22:17:39 Reply

thanks. i've made something up, just to test it. another thing ive been thinking about is how do i show my hero wearing different armors and weapons during the fight. making an array with the different items or making the hero movie clip with all the armors in the game but that will be too tedious.

Rat512
Rat512
  • Member since: Aug. 18, 2008
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to return screen after battle rpg 2008-11-23 22:22:48 Reply

Or never leave that frame. You can attach a MC with the battle scenes in it with AS

The-Speed-Demon
The-Speed-Demon
  • Member since: May. 24, 2007
  • Offline.
Forum Stats
Member
Level 02
Blank Slate
Response to return screen after battle rpg 2008-12-02 17:35:40 Reply

okie i'd like to thank everyone who helped me with my flash problems. i have another problem though. from my starting position i want my character to be able to move around and when he enters a red door he will end up right out on the other side of the door. i really dont know how to explain what i want so i drew a little diagram. if anyone understands please help. :)

return screen after battle rpg