Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: AfterLoad  (Read 2666 times)

0 Members and 1 Guest are viewing this topic.

mylesblasonato

  • Developer
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 265
  • "Give up is to fail as sacrifice is to succeed"
    • View Profile
    • Royal Wins
AfterLoad
« on: July 29, 2008, 01:07:03 AM »

Hi can someone explain AfterLoad and how to use it thanks. And BeforeSave aswell thanks.

Cheers ::beer
Myles Blasonato.
Logged
Lead Game Designer, Royal Wins.
@mylesblasonato
@royalwins
http://au.linkedin.com/pub/myles-blasonato/26/600/a38

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: AfterLoad
« Reply #1 on: July 29, 2008, 07:07:17 AM »

If you load the Saved Game it restores your game to identical position as it was before the Save was invoked. One example for usage would be - if you have the separate scene for menu screen,
you put in the game.script something like this:

on "AfterLoad"
{
   Game.ChangeScene(Game.PrevSceneFilename);
}

which automagically returns you to the scene from which you invoked the menu when you were saving the game. BeforeSave I didn't use myself yet, but I guess I'll maybe invent some usage for it. :)

Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

mylesblasonato

  • Developer
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 265
  • "Give up is to fail as sacrifice is to succeed"
    • View Profile
    • Royal Wins
Re: AfterLoad
« Reply #2 on: July 30, 2008, 03:14:23 AM »

Cool thanks Meta as always,

One quick question to add. If i only want it to do the change scene on an afterload when I press a certain button and not all the time the game loads do I just do something like:

on "AfterLoad"{
   if(bDown == 1){
        Game.ChangeScene(mainMenu);
    }
}

Cheers ::beer
Myles Blasonato.
Logged
Lead Game Designer, Royal Wins.
@mylesblasonato
@royalwins
http://au.linkedin.com/pub/myles-blasonato/26/600/a38
 

Page created in 0.116 seconds with 24 queries.