Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

Save Hero Position?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Nintendork




Joined: 09 May 2004
Posts: 64

PostPosted: Tue Mar 21, 2006 4:32 pm    Post subject: Save Hero Position? Reply with quote

Hey, I'm making a game called Bomberman x4, where you are supposed to use all four Bombermen one at a time (where your friends play as other Bombermen or you control them yourself). Anyways, since all four people would play on one file, I'm making a load game script where every time you enter the game, it goes to character selection. But here's the problem: I need to know if there is some kind of save hero position, so every time you enter the world with a certain Bomberman, you will be in the same position you were when the game was saved. Also, it's not that every individual Bomberman will start in the same place the last Bomberman was when the game was saved- I want it to save the position of all four Bombermen if that's possible. Is this possible, or am I thinking outside of OHR's boundaries? Question

Oh and sorry about the subliminal advertising. Razz
Back to top
View user's profile Send private message
Mike Caron
Technomancer




Joined: 26 Jul 2003
Posts: 889
Location: Why do you keep asking?

PostPosted: Tue Mar 21, 2006 4:55 pm    Post subject: Reply with quote

What you say is far from impossible, but it's not automatic either.

Code:
  global variable, begin
    1, hero 1 x
    2, hero 1 y
    3, hero 2 x
    #...
    8, hero 4 y
    9, current party # 0 - 3
  end

  script, switch parties, party, begin
    fade screen out

    write global(1 + current party * 2, hero x(me))
    write global(2 + current party * 2, hero y(me))

    current party:= party

    #again, swap heroes to the right party

    set hero position (me, read global(1 + current party * 2), read global(2 + current party * 2))

    fade screen in

  end


The globals 1-8 store the positions of the heroes. global 9 stores which party you're using currently.

switch parties() should be called when you want to swap to a different party. Pass the party number (0 - 3), and it will record your location, and switch.

A few notes:

~ These scripts don't handle actually switching the parties. As is, it will just warp a single party around. You need to modify it to swap heroes in and out, or however you're doing it.

~ At some point, before you can switch, you need to set the default locations of the other three parties (1-3), so that when you swap, you don't go to (0,0).

~ I just wrote this off the top of my head, so I haven't tested it.

~ If you already have globals, you'll need to change the numbers of the above declarations, and in the switch party() script. To switch, it looks something like this:

Code:

    #pretend the appropriate globals start at 30
    write global(30 + current party * 2, hero x(me))
    write global(31 + current party * 2, hero y(me))


And, in the block right below it.
_________________
I stand corrected. No rivers ran blood today. At least, none that were caused by us.

Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Nintendork




Joined: 09 May 2004
Posts: 64

PostPosted: Tue Mar 21, 2006 4:59 pm    Post subject: Reply with quote

Cool, thanks. I'll test it as soon as I need to and my hspeak works.
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Tue Mar 21, 2006 5:36 pm    Post subject: Reply with quote

Nintendork wrote:
Really? Since the last time I rebooted windows, I have been extremely, extra cautious of spyware, and I thought a once-a-week scan would get be good enough. I'll try scanning for spyware, but so far there have been no other signs of spyware.


that post about the spyware belonged in this thread, sorry, I am clumsy :)

The reason I think it is related spyware is because it comes from the "16 bit MS-DOS Subsystem" which certain spywares love to screw up. See this FAQ entry ... although your error message is different from those, so I could be totally wrong on this one.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Nintendork




Joined: 09 May 2004
Posts: 64

PostPosted: Tue Mar 21, 2006 5:38 pm    Post subject: Reply with quote

Oh, glad you cleared that up, I thought I posted in the wrong topic. Ha ha ha!

Anyway, let's keep the rest on this subject in the other topic from now on.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group