View Full Version : Automatically saving a character's position
tsuakai
December 6th, 2006, 11:17 PM
Attached is a file of what I have so far. (Junky I know.)
The way my battles are set up is that after the battle it goes back to the first frame of the level, everything inside the level resets. I.E coin placement, character placement. I've already got the whole how to save/load using buttons, but how would I automatically save a character's position?
http://pixelcandy.net/Flash/Core_Test_Share.fla
http://pixelcandy.net/Flash/Core_Test_Share.swf
Thanks in advance.
Darth Arias
December 7th, 2006, 12:51 AM
The .fla does not work for me, but I am guessing you have a random number generator for enterFrame, so if it is the number it automatically puts you in the battle?
If so, you could create variables for on(load). Your x position would be one, and so would your y... then you could say if the number is the one for battling, record this._x and _this.y,, and then they equal the position of your guy... sorry to explain roughly, but I can't see your .fla.
tsuakai
December 7th, 2006, 01:15 AM
The .fla does not work for me, but I am guessing you have a random number generator for enterFrame, so if it is the number it automatically puts you in the battle?
If so, you could create variables for on(load). Your x position would be one, and so would your y... then you could say if the number is the one for battling, record this._x and _this.y,, and then they equal the position of your guy... sorry to explain roughly, but I can't see your .fla.
Thanks a lot for the suggestion. I guess my server was done, but when I clicked the link it came up with the download screen in Firefox for me so I'm not sure. I guess I'll have a try at what you said. Any other ideas would be much appreciated. =).
Darth Arias
December 7th, 2006, 02:06 AM
Could you repost it? I think it would help...
Lou
December 7th, 2006, 02:13 AM
That guy with the hair is from Legend of Mana? :smirk:
SacrificialLamb
December 7th, 2006, 05:39 AM
i added this to the first frame
if (hex){
_root.girl_mc._x = hex
_root.girl_mc._y = why
}
and this to the invisible fight trigger
onClipEvent (enterFrame) {
if (_root.girl_mc.hitTest (this)) {
_root.hex = _root.girl_mc._x
_root.why = _root.girl_mc._y
_root.gotoAndStop(16);
}
}
tsuakai
December 7th, 2006, 08:34 AM
Actually the girl is from Seken Deitsu? For the Snes I believe. I'm just using random sprites till I get the specific code down, then I will use my own animations that I've got ready. In "battle" mode the girl with the white hair is Kula from KoF I believe. Thanks for the help, I'll try it when I get home.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.