Alice Community

Alice Community (
-   Share Worlds (
-   -   World Loader - Link your worlds up!!! (

arty-fishL 05-17-2011 04:34 AM

World Loader - Link your worlds up!!!
3 Attachment(s)
beachbum111111 gave me a really good idea.

[SIZE=4][COLOR=DarkGreen]Wouldn't it be great if you could link worlds together?![/COLOR][/SIZE]
[/SIZE][SIZE=2]So I created a small, but powerful tool to do just that.
It allows another world to be loaded at runtime.


I forgot to mention in the video tutorial:
[SIZE=3]The worlds must be in the same [B]folder/directory[/B].
[SIZE=1][COLOR=DarkSlateGray]This is useful for linking different levels or parts of a game together, without bloating up the size of each world. This can aid in greatly decreasing lag and it allows for infinitely long worlds. An example of where this would help could be in jediaction's [/COLOR][/SIZE][/SIZE] [SIZE=1][COLOR=DarkSlateGray][SIZE=2][I]Halo - the generator[/I] (or Halo 2).[/SIZE]

When you run the world the next world should load whenever this method gets activated, providing the next world actually exists.

When posting linked world on the Alice Community, post them all together and instruct users to download them all into the same folder as each other.[/COLOR][/SIZE][SIZE=1]

[/SIZE] [SIZE=1][COLOR=DarkRed]WARNING - if you are developing the world, make sure you save before playing, because this automatically bypasses the [I]ask to save[/I] dialog before loading the next world. Also, do not rename the tool object in the world or it wont work.[/COLOR][/SIZE][SIZE=1]
[COLOR=DarkOliveGreen]I hope this helps you.[/COLOR]


[SIZE=1][COLOR=DarkSlateGray]UPDATE 2 - v2 : fixed a script bug
UPDATE 3 - actually v2 this time
UPDATE 5 - v3 : fixed another script bug

[B]UPDATE 6[/B][/COLOR][/SIZE][SIZE=1][COLOR=DarkSlateGray] - v4 : new and revised features added. It can now:
- Detect non-existing worlds and gives the user the choice of locating the world.
- Detect loading failures and displays an error message.
- Carrying over variables is possible (see [URL=""]video tutorial[/URL]), so your score etc doesn't get lost.
- Going back to a pre-defined world in the sequence of links when any loaded world is stopped is possible (see [URL=""]video tutorial[/URL]).

The [/COLOR][/SIZE] [SIZE=1][COLOR=DarkSlateGray][I][B]loadWorld[/B][/I] method has been renamed to [I][B]load_world[/B][/I] .[/COLOR][/SIZE]

UPDATE 8 - v5 : Variables other than strings should carry now

room14 05-17-2011 04:40 AM

I haven't seen it yet but HOLY F**K!

EDIT: agh. it gave me an error...

arty-fishL 05-17-2011 05:47 AM

[QUOTE=room14;35838]agh. it gave me an error...[/QUOTE]Please post the error in full ([URL=""]pastebin[/URL] it or something to make it smaller). I want to squish all bugs, and I cant find them all when I'm running Alice under different configurations to everybody else.

nickster654 05-17-2011 06:47 AM

yea it gave me an error too

Error during simulation.

Alice version: 2.2 5/26/2009

Throwable that caused the error:

Traceback (innermost last):

File "[name=script,owner=edu.cmu.cs.stage3.alice.core.response.ScriptResponse[world.worldLoaderTool.event.__Unnamed0__]]", line 1, in ?

File "<string>", line 8, in ?

NameError: Thread

arty-fishL 05-17-2011 06:50 AM

[QUOTE=nickster654;35841]yea it gave me an error too
Ah, sorry about that, that's a one line simple fix. Hopefully no more bugs will pop up after this. Updating in a minute.

EDIT - there I've updated it, try it again please.

jediaction 05-17-2011 09:24 AM

Well, I hope you can fix it. I am excited for this!

beachbum111111 05-17-2011 10:59 AM

Will it work with MAMA?

TauTrumpsPi 05-17-2011 11:16 AM

I got an error too, with the most recent version.

Error during simulation.

Alice version: 2.2 02/10/2011

Throwable that caused the error:

Traceback (innermost last):

File "[name=script,owner=edu.cmu.cs.stage3.alice.core.response.ScriptResponse[world.worldLoaderTool.loadWorld.__Unnamed1__]]", line 1, in ?

NameError: loadWorld

arty-fishL 05-17-2011 12:55 PM

1 Attachment(s)
[QUOTE=jediaction;35845]Well, I hope you can fix it. I am excited for this![/QUOTE]I hope I can.

[QUOTE=beachbum111111;35850]Will it work with MAMA?[/QUOTE]I will test it soon.

[QUOTE=TauTrumpsPi;35854]I got an error too, with the most recent version.[/QUOTE]Don't make it run the second the world starts, make it pause for a second before it loads the next world, making it run the second the world starts isn't practical anyway.
If that isn't the issue, then have you got the event in the picture below?

madden 05-17-2011 01:00 PM

Hmmm. I am also getting a error. Perhaps make a video tutorial? Sounds very awesome though. I have been waiting a long time for this exact thing. :)

All times are GMT -5. The time now is 09:03 PM.

Copyright ©2022, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.