Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Reset Game  (Read 4620 times)

0 Members and 1 Guest are viewing this topic.

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Reset Game
« on: May 31, 2007, 04:20:00 PM »

Hi,
    I want to at the end of the game to move the player to a start screen (no problems with this) and also reset all the variables, global and local, reset all items taken or deleted and reset all states regarding rooms visted etc.

Basically reset all to the state the game started in.


Can this be done easily??


Also will game saves still be usable after this reset?


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mac

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 136
    • View Profile
    • Homepage
Re: Reset Game
« Reply #1 on: May 31, 2007, 04:51:09 PM »

I think Game.Reset() should do it.

Mac
Logged

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Reset Game
« Reply #2 on: May 31, 2007, 05:05:39 PM »

yes I tried this but it does not reset windows or items that have been deleted.....I think?

Mnemonic can you confirm??
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Reset Game
« Reply #3 on: May 31, 2007, 05:08:47 PM »

To quote the docs:

"This method deletes all scene states, selected responses, sets timer to zero and also clears all global variables, except those holding game objects (such as windows or entities). Use this method if you want to start a new game."

It should reset the deleted items though.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Reset Game
« Reply #4 on: May 31, 2007, 05:18:41 PM »

ok Thanks, But if items are left in the inventory and the inventory is a window will this not be effected?? So the game will begin again with items that were in inventory at the time the reset happened??
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Reset Game
« Reply #5 on: May 31, 2007, 05:25:35 PM »

No, the game basically reloads the items.items file.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: Reset Game
« Reply #6 on: May 31, 2007, 05:28:33 PM »

ah ok, thanks, so what does this mean when windows with objects are not effected??

I have windows for on sceen objects, will I need to close these down first before reset??
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Reset Game
« Reply #7 on: May 31, 2007, 05:34:41 PM »

Yes, you're responsible for the windows. The Reset() method intentionally doesn't destroy any loaded game objects, because it might be quite destructive for some games.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.04 seconds with 19 queries.