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: ChangeScene TO PrevScene  (Read 8120 times)

0 Members and 1 Guest are viewing this topic.

DREAMWEB

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 48
    • View Profile
ChangeScene TO PrevScene
« on: March 29, 2004, 09:56:01 PM »

Providing your scene's name is the same as it's filename (it is so by default) you can do something like:

Game.ChangeScene("scenes\" + Game.PrevScene + "\" + Game.PrevScene + ".scene");

This code will change to the previous visited scene.

I was trying but I don
« Last Edit: March 29, 2004, 09:56:49 PM by DREAMWEB »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:ChangeScene TO PrevScene
« Reply #1 on: March 29, 2004, 10:05:44 PM »

That's weird, I believe Five magical amulets is using the exact piece of code...
The scene *might* stay the same it there is an error loading the new one, does the log say something by any chance?

EDIT: I just tried that and it works nicely. There must be some other problem...
« Last Edit: March 29, 2004, 10:07:23 PM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

DREAMWEB

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 48
    • View Profile
Re:ChangeScene TO PrevScene
« Reply #2 on: March 30, 2004, 02:00:00 PM »

I think I am not understanding how this works: for example my SCENES folder is not "scenes\", it is ("escenas\"; and there are inside a lot of other folders; because a first person game have many more scenes that a therd one and I have to put the scenes with a certain order. That can make the "PrevScene" don
« Last Edit: March 30, 2004, 02:15:33 PM by DREAMWEB »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:ChangeScene TO PrevScene
« Reply #3 on: March 30, 2004, 02:59:25 PM »

Well this piece of code tries to construct the filename of the previous scene, in your case it should be:

Game.ChangeScene("escenas\" + Game.PrevScene + "\" + Game.PrevScene + ".scene");


It should result into something like "escenas\MyScene\MyScene.scene", shich is a filename of the scene t be loaded.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

DREAMWEB

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 48
    • View Profile
Re:ChangeScene TO PrevScene
« Reply #4 on: March 30, 2004, 04:26:31 PM »

Steel not working... Is my problem that I don't have all the scenes in the same place?
Look at my scenes tree:
« Last Edit: March 30, 2004, 04:27:20 PM by DREAMWEB »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:ChangeScene TO PrevScene
« Reply #5 on: March 30, 2004, 04:54:33 PM »

Ok, I'll add a new attribute for that.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

DREAMWEB

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 48
    • View Profile
Re:ChangeScene TO PrevScene
« Reply #6 on: March 30, 2004, 06:50:42 PM »

 :oTHANKS!!!  ;D
 ;)
Logged

McCoy

  • The cocido eater
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 365
  • Spurrrrrrring
    • View Profile
    • Spur Games
Re:ChangeScene TO PrevScene
« Reply #7 on: March 30, 2004, 07:21:31 PM »

Jan, what are you thinking about? Maybe some function that returns the full (relative) path of the previous scene, something like Game.PrevScenePath wich will return "\escenas\001 - Room\cuadro1\cuadro1.scene" or just "\escenas\001 - Room\cuadro1\" so you can concatenate whatever you want, or something else? I'm just curious...
Logged

Click here to sign my sig!

McCoy

  • The cocido eater
  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 365
  • Spurrrrrrring
    • View Profile
    • Spur Games
Re:ChangeScene TO PrevScene
« Reply #8 on: March 30, 2004, 07:30:12 PM »

Oh, no matter, I've just seen the TODO list  :-[
Logged

Click here to sign my sig!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:ChangeScene TO PrevScene
« Reply #9 on: March 30, 2004, 08:06:56 PM »

I think the entire filename will be more useful than just a path.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

DREAMWEB

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 48
    • View Profile
Re:ChangeScene TO PrevScene
« Reply #10 on: March 31, 2004, 12:20:09 AM »

Maybe some function that returns the full (relative) path of the previous scene, something like Game.PrevScenePath wich will return "\escenas\001 - Room\cuadro1\cuadro1.scene" or just "\escenas\001 - Room\cuadro1\" so you can concatenate whatever you want, or something else? I'm just curious...

Excuse my ignorance  ;D But, what is the benefit of incluing a concrete path if we want to came back to the Previous escene, a scene that will change, and not that path... I don
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:ChangeScene TO PrevScene
« Reply #11 on: March 31, 2004, 07:21:04 AM »

McCoy was thinking about some other possibilities, not just changing to the previous scene but also for example to be able to query something from its directory. One never knows what the WME users will ever need :)
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.041 seconds with 23 queries.