Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Setting variable upon exit?  (Read 2545 times)

0 Members and 1 Guest are viewing this topic.

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Setting variable upon exit?
« on: July 25, 2007, 08:43:27 AM »

I may be out of line here, but I have to know if there's a way to set a variable when leaving a certain scene.

One example: I use a map in my game. In the map scene, the inventory is disabled through a simple variable. There are many possible ways to leave the map, and of course I can reset the variable in every script attached to a scene change, to get the inventory back. However, it would be a nice touch if I could reset the variable in the scene_init.script for the map scene every time I exit the scene instead.

I hope I am making myself clear.

Thanks in advance!

Mikael
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Setting variable upon exit?
« Reply #1 on: July 25, 2007, 09:00:27 AM »

It's easy to do in WME 1.8 (currently in beta). You'd need to add the following code to scene_init.script:

Code: WME Script
  1. on "SceneShutdown"
  2. {
  3.   SomeVariable = false;
  4. }
  5.  
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 127
    • View Profile
    • MDNA Games
Re: Setting variable upon exit?
« Reply #2 on: July 25, 2007, 10:06:08 AM »

I'll go download tthe beta right away. Thanks a lot!

Mikael
Logged
 

Page created in 0.054 seconds with 24 queries.