Save Player Position
#1
Posted 15 July 2007 - 07:12 PM

#2
Posted 15 July 2007 - 07:51 PM
If, as I suspect, you're saving the game by just exporting the counters, then obviously the restore player position won't work, since there's no way to store that information in a counter and set it back. You'll have to write your own code to manually save and load the player's position.
"A requiem, for the clever hacks of yesteryear."
..Ignorance is to be unaware of the truth.
....Incompetence is to be unable to grasp the truth.
......And escape is to run away from the truth.
It is useless to run, since the truth is right next to you.
-Wervyn
#3
Posted 15 July 2007 - 09:05 PM
Well, since you're so determined to make your life difficult all so you can make your game look slightly less like it was created in MZX (at least, to the people who don't know what MZX is), I'll give you a hint. There's a string called "board_name." Have fun.
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#4
Posted 15 July 2007 - 11:07 PM
Exophase, on Jul 15 2007, 09:05 PM, said:
Well, since you're so determined to make your life difficult all so you can make your game look slightly less like it was created in MZX (at least, to the people who don't know what MZX is), I'll give you a hint. There's a string called "board_name." Have fun.
Wervyn - I'm actually doing the set "filename" "save_game" command...
Then when I have the player load the game (from my in-game status screen), i quickly call the "restore player position 3" command, to teleport to the last save point the player was on. In 2.81c, after you exit and restart MZX, then load, it'll teleport you to the board of the save point, but in position 0,0... in 2.81g, it teleports you to the title screen.
Exo - I'm not determined to make my life difficult, most of what I did was relatively easy and didn't take me long at all to implement. I just don't understand why you are constantly chewing me out for wanting to customize my game a bit?
I could probably do something manually, that'll give each save point their own ID and teleport player to that save point upon load, I just found it really curious that MZX doesn't save your position in its .sav files.

#5
Posted 15 July 2007 - 11:21 PM
djtiesto, on Jul 15 2007, 07:07 PM, said:
Yes it does. What on Earth gave you the idea that it doesn't? Try hitting F9 and move around a bit and hit F10 while playing something. It does indeed save your position.
Why are you bothering trying to restore the player's position when it's saved in the .sav files, anyway?
EDIT: In fact, there are only two reasons "restore player position 3" would put you in any place other than where the player was when you did "save player position 3." You are either not ever actually saving the player's position to 3, or are not actually loading the .sav before you restore the player's position from 3. There's still no point in messing with saved player position slots anyway when you can just save the game while the player is at the save point and load the game later to put the player back at that same point.
This post has been edited by Guy: 15 July 2007 - 11:26 PM
#6
Posted 15 July 2007 - 11:49 PM
Guy, on Jul 15 2007, 11:21 PM, said:
djtiesto, on Jul 15 2007, 07:07 PM, said:
Yes it does. What on Earth gave you the idea that it doesn't? Try hitting F9 and move around a bit and hit F10 while playing something. It does indeed save your position.
Why are you bothering trying to restore the player's position when it's saved in the .sav files, anyway?
EDIT: In fact, there are only two reasons "restore player position 3" would put you in any place other than where the player was when you did "save player position 3." You are either not ever actually saving the player's position to 3, or are not actually loading the .sav before you restore the player's position from 3. There's still no point in messing with saved player position slots anyway when you can just save the game while the player is at the save point and load the game later to put the player back at that same point.
The save points teleport the player to a special board that has a menu setup of the slots you can save your game in, like an RPG.

#7
Posted 15 July 2007 - 11:52 PM
or save the board_name, playerx and playery to the file and just do one line of teleport code.
come on guys maybe he's practicing for when he works on a real game
#8
Posted 16 July 2007 - 12:03 AM
CJA, on Jul 15 2007, 11:52 PM, said:
I'm taking a looooooooooooooooooooong break from game making once Keeks is done.

#9
Posted 16 July 2007 - 12:06 AM
I still don't really understand what you're getting at. You're saying that when the player loads a saved game you want them to teleport to the last save point they were on. Do you mean the last one they were on when they saved the game or when they load the game? I'm going to assume you mean the former because that's the only thing that makes sense. Restore player position SHOULD work, maybe someone broke something.
But as a workaround you can do:
set "$save_board" "board_name"
set "save_x" "playerx"
set "save_y" "playery"
teleport player "save_board" x y
Then in the reload code:
teleport player "&$save_board&" "save_x" "save_y"
I do hope you allow the player to save in most places too (although I'm pretty sure you won't)
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#10
Posted 16 July 2007 - 01:22 AM
Exophase, on Jul 16 2007, 12:06 AM, said:
I still don't really understand what you're getting at. You're saying that when the player loads a saved game you want them to teleport to the last save point they were on. Do you mean the last one they were on when they saved the game or when they load the game? I'm going to assume you mean the former because that's the only thing that makes sense. Restore player position SHOULD work, maybe someone broke something.
But as a workaround you can do:
set "$save_board" "board_name"
set "save_x" "playerx"
set "save_y" "playery"
teleport player "save_board" x y
Then in the reload code:
teleport player "&$save_board&" "save_x" "save_y"
I do hope you allow the player to save in most places too (although I'm pretty sure you won't)
There's like one or two save points per area... one in each town... kinda similar to what was in the demo. Did you think the save points in the demo were a bit too sporadic? I'm thinking of putting access to the save screen on the world map, as well. Saves restore all your HP/MP/etc as well.
Here is an example of my code, I really apologize for explaining it badly:
SavePt (when you step on a sensor):
end
:sensoron
lockplayer
. blah blah effects and sfx go here
move player SOUTH
save player position 3
teleport player "[SYSTEM] Data Management" 0 0
unlockplayer
end
Then in the "Data Management" screen
. blah blah, select the slot you wanna save in
set "savegame.sav" "SAVE_GAME"
end
Then, when you select "Load" from the main menu...
.blah blah, select the game you wanna load
set "LOAD_GAME" "savegame.sav"
restore player position 3
end
And I want that RESTORE PLAYER POSITION 3 command to teleport you to the save point you were at when you saved the game originally. But when I do a load, after quitting MZX, it'll restore me to the title screen in 2.81g. It's really strange.
But anyways, I'll probably do the thing with the board_name string, that sounds really good.

#11
Posted 16 July 2007 - 01:26 AM
djtiesto, on Jul 15 2007, 09:22 PM, said:
set "savegame.sav" "LOAD_GAME"
You realize that your problem could have been fixed by just reading the help manual, right?
#12
Posted 16 July 2007 - 01:34 AM
Guy, on Jul 16 2007, 01:26 AM, said:
djtiesto, on Jul 15 2007, 09:22 PM, said:
set "savegame.sav" "LOAD_GAME"
You realize that your problem could have been fixed by just reading the help manual, right?
Yeah, just changed this now, but it makes no difference.

#13
Posted 16 July 2007 - 02:24 AM
As soon as you load the game you will NOT be in that same robot, you will be in the context of the robot that did the save game. So that's where the restore player position should be.
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#14
Posted 16 July 2007 - 06:25 AM
The answer is simple, player positions ARE saved in the sav file... all you have to do is on the save screen have a robot that says
:"Justloaded"
restore player position #
end
That's it.
What this does is as soon as the game is opened and started from this position (a save file load) it executes that code (restore player position).
Once the load save file command is called, it DUMPS the previous data in favor of the new, you'll never get to that restore player position command if you put a load save game RIGHT BEFORE IT.
"think about the way things work not the way you'd like them too"
This post has been edited by Koji: 16 July 2007 - 06:32 AM
#15
Posted 16 July 2007 - 11:09 AM
Oh yeah and for those curious as to why I'm putting custom systems like this - my aim with Kikan is to have it so I can hook up my brother's laptop to my TV, and after initially loading MZX up, use my brother's controller to play through the whole game from the comfort of my couch

#16
Posted 16 July 2007 - 12:49 PM
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#17
Posted 19 July 2007 - 01:07 AM
<pyro1588> "welcome to australia, can i help you find what you're looking for?"
<Tox> pyro1588, I'm giving you the most reproachful of glares right now.
--------
Go show those nutty Koreans what us crazy Europeans are made of pirate.gif pirate.gif pirate.gif - Saike
<exophase> The old Commodore strategy of, "Go friggin' bankrupt!"
<wervyn> Go away! I'm writing the same engine I always do!
#18
Posted 19 July 2007 - 01:29 AM

#20
Posted 19 July 2007 - 11:56 AM

<Malwyn> Yes, yes. Don't worry I'd rather masturbate with broken glass than ask you for help again. :(

Help










