Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Worlds (http://www.alice.org/community/forumdisplay.php?f=6)
-   -   World Loader - Link your worlds up!!! (http://www.alice.org/community/showthread.php?t=6550)

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=2]
[/SIZE][SIZE=2]So I created a small, but powerful tool to do just that.
It allows another world to be loaded at runtime.

[URL="http://www.youtube.com/watch?v=ABnE-T6OupQ"][SIZE=4]WATCH THE NEW VIDEO TUTORIAL!!![/SIZE][/URL]

I forgot to mention in the video tutorial:
[SIZE=3]The worlds must be in the same [B]folder/directory[/B].
[/SIZE]
[/SIZE]_________________________________________________________
[SIZE=2]
[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]
[/SIZE]
[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 4 - (OLD) VIDEO TUTORIAL [URL="http://www.youtube.com/watch?v=o6fIT68eWAw"]HERE[/URL]
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="http://www.youtube.com/watch?v=ABnE-T6OupQ"]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="http://www.youtube.com/watch?v=ABnE-T6OupQ"]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]

[SIZE=2]UPDATE 7 - [URL="http://www.youtube.com/watch?v=ABnE-T6OupQ"]NEW VIDEO TUTORIAL HERE[/URL]
UPDATE 8 - v5 : Variables other than strings should carry now
[/SIZE]

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="http://pastebin.com/"]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 "edu.cmu.cs.stage3.alice.core.property.ScriptProperty[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
[/QUOTE]
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 "edu.cmu.cs.stage3.alice.core.property.ScriptProperty[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

ppfffffffffffffffffffffffff
 
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. :)

arty-fishL 05-17-2011 01:28 PM

[QUOTE=beachbum111111;35850]Will it work with MAMA?[/QUOTE]
No, python scripting is different in Mama and I'm too confused.
[QUOTE=madden;35858]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. :)[/QUOTE]OMG FFS, I just checked it, it never saved properly, so the update was exactly the same object.

OK, I'm updating again, this time I reduced my Alice to the settings you should have it at and tested again. This should be fine.

Tips for avoiding bugs:
- Don't run it the second the world starts.
- Don't rename the files.
- Don't rename the object.
- Make sure to save each world first or it wont be able to locate the current directory.

From now on I'm hoping for positive comments :D

madden 05-17-2011 02:15 PM

1 Attachment(s)
Bah, Sorry man, I'm still only getting errors. Does it matter if I put ".a2w" at the end of my worlds name? Because Alice isn't letting me. It says it doesn't let me place "." in the name.

DensetsuNoKaboom 05-17-2011 02:50 PM

Do you have to upload every world in the chain to the forums? Or only the first?
EDIT: Errors. Blah. Something about syntax errors.

arty-fishL 05-17-2011 03:14 PM

[QUOTE=madden;35862]Bah, Sorry man, I'm still only getting errors. Does it matter if I put ".a2w" at the end of my worlds name? Because Alice isn't letting me. It says it doesn't let me place "." in the name.[/QUOTE]You're doing it wrong, I'm uploading a video tutorial now (25 mins left).

[QUOTE=DensetsuNoKaboom;35866]Do you have to upload every world in the chain to the forums? Or only the first?
EDIT: Errors. Blah. Something about syntax errors.[/QUOTE]All of them, sorry.

arty-fishL 05-17-2011 03:40 PM

[SIZE=5]I've added a video tutorial.
[URL="http://www.youtube.com/watch?v=o6fIT68eWAw"]TUTORIAL HERE[/URL][/SIZE]

madden 05-17-2011 04:44 PM

[QUOTE=arty-fishL;35870][SIZE=5]I've added a video tutorial.
[URL="http://www.youtube.com/watch?v=o6fIT68eWAw"]TUTORIAL HERE[/URL][/SIZE][/QUOTE]

Thanks, haha, I was totally doing it wrong... but I am still getting an error. I did everything you did but for some reason it still wont work...

arty-fishL 05-17-2011 05:01 PM

[QUOTE=madden;35873]Thanks, haha, I was totally doing it wrong... but I am still getting an error. I did everything you did but for some reason it still wont work...[/QUOTE]This is really annoying, because I cant reproduce the error here. What exactly does it say and then I can probably help.

madden 05-17-2011 05:55 PM

1 Attachment(s)
[QUOTE=arty-fishL;35875]This is really annoying, because I cant reproduce the error here. What exactly does it say and then I can probably help.[/QUOTE]

Sorry man, I wish I could help more.

EDIT: Okay, that didn't turn out clear at all. This is what it says:



"Alice version: 2.2 09/10/2010

*****Running World*****
*****Stopping World*****
*****Running World*****
*****Stopping World*****
Exception in thread Thread-1:
File "<string>", line 21, in run
File "C:\Users\Andy_2\Desktop\Alice 2.2\Required\jython-2.1\Lib\javaos.py", line 23


^
SyntaxError: future feature division is not defined

arty-fishL 05-17-2011 06:11 PM

[QUOTE=madden;35888]Sorry man, I wish I could help more.

EDIT: Okay, that didn't turn out clear at all. This is what it says:
[/QUOTE]Ah, again another simple fix. This isn't my fault, its a broken python module. I've updated the tool again to automatically patch this.

madden 05-17-2011 06:31 PM

[QUOTE=arty-fishL;35891]Ah, again another simple fix. This isn't my fault, its a broken python module. I've updated the tool again to automatically patch this.[/QUOTE]

IT WORKS!!
Wow, this is Epic!! Amazing job Arty. I have been waiting for someone to do this for a long time. You are amazing. Hahaha, this is just awesome. I don't even know what to say about this. :D

arty-fishL 05-17-2011 06:36 PM

[QUOTE=madden;35892]IT WORKS!!
Wow, this is Epic!! Amazing job Arty. I have been waiting for someone to do this for a long time. You are amazing. Hahaha, this is just awesome. I don't even know what to say about this. :D[/QUOTE]Yay :D. Now I can declare awesomeness (or something smug like that).

[SIZE=5][COLOR=DarkGreen]IT WORKS[/COLOR]
[/SIZE]

DensetsuNoKaboom 05-17-2011 08:07 PM

2 Attachment(s)
I just summoned a bird from a parallel universe.

[I]Best. Object. Ever.[/I]

Seriously, you have no idea how much this will help me. I declare you the Supreme Chancellor of the Kingdom of Awesome. Long live the Chancellor!

reuben2011 05-18-2011 01:06 AM

Wow arty! You always manage to amaze us all with your innovative ideas! :D I think this "object" is going to be really useful for us all!

arty-fishL 05-18-2011 04:04 AM

1 Attachment(s)
[QUOTE=DensetsuNoKaboom;35906]I just summoned a bird from a parallel universe.

[I]Best. Object. Ever.[/I]

Seriously, you have no idea how much this will help me. I declare you the Supreme Chancellor of the Kingdom of Awesome. Long live the Chancellor![/QUOTE]Thankyou, but you're using it wrong. It might work on your computer, but it wont work elsewhere. Just put the two worlds in the same folder and set it as in the picture below, not with the whole pathname.

[QUOTE=reuben2011;35918]Wow arty! You always manage to amaze us all with your innovative ideas! :D I think this "object" is going to be really useful for us all![/QUOTE]Great, glad I could help.

I'm working on adding new features to it:

- Detects non-existing worlds and gives the user the choice of locating the world. [B][COLOR=DarkGreen]DONE[/COLOR][/B]
- Detecting loading failures. [B][COLOR=DarkGreen]DONE[/COLOR][/B]
- Carrying over variables, so your score etc doesn't get lost. [B][COLOR=DarkGreen]DONE[/COLOR][/B]
- Going back to a pre-defined world in the sequence of links when any loaded world is stopped. [COLOR=DarkGreen][B]DONE[/B][/COLOR][B][COLOR=Red][COLOR=DarkGreen][/COLOR]
[/COLOR][/B]

DensetsuNoKaboom 05-18-2011 05:41 AM

Bububuubbuubububbbubut that's what I did!

In fact, I tried it with the entire pathname, and it failed!

arty-fishL 05-18-2011 05:55 AM

[QUOTE=DensetsuNoKaboom;35931]Bububuubbuubububbbubut that's what I did!

In fact, I tried it with the entire pathname, and it failed![/QUOTE]????? That's not what I seen when I downloaded it, I will try again.

arty-fishL 05-18-2011 07:10 AM

I've updated it again. This forum really needs [spoiler] tags, the first post is really cluttered now.

arty-fishL 05-19-2011 01:06 PM

Don't let this thread die.

I made another, much better, video tutorial. Now I am going to declutter the main post at the top.

[URL="http://www.youtube.com/watch?v=ABnE-T6OupQ"]VIDEO TUTORIAL HERE[/URL]

I also updated the tool - for possibly the last time.

jediaction 05-19-2011 02:21 PM

Well, I can just say, this thread gets a [B]THUMBS UP because this is the Golden age of Alice![/B]

[B]FPS Aiming systems..[/B]
[B]Advanced Collision detection[/B]
[B]Jython Scripting[/B]
[B]and now Loading diferent worlds through one program[/B]

TauTrumpsPi 05-19-2011 02:29 PM

It works perfectly for me. Great job Arty, this will be very useful. Now if you could just get Gloo to work...

arty-fishL 05-19-2011 02:43 PM

[QUOTE=jediaction;36017]Well, I can just say, this thread gets a [B]THUMBS UP because this is the Golden age of Alice![/B]

[B]FPS Aiming systems..[/B]
[B]Advanced Collision detection[/B]
[B]Jython Scripting[/B]
[B]and now Loading diferent worlds through one program[/B][/QUOTE]That's what I was thinking. Its all thanks to these forums.

[QUOTE=TauTrumpsPi;36019]It works perfectly for me. Great job Arty, this will be very useful. Now if you could just get Gloo to work...[/QUOTE]Thankyou. I'm still (silently) working on Gloo.

DensetsuNoKaboom 05-19-2011 05:11 PM

I'm so glad we live in such an age of prosperity. Only needs a few more things...

Specifically, Gloo and, um...darn it.

Mr Kidnapper 05-19-2011 07:47 PM

Besides Gloo, if we're talking about things inside Alice, how about simple physics? I would say it goes hand in hand with collision detection, say we have dodgeball and a ball is thrown at a speed from an angle, and then the ball bounces off the wall while losing speed and height and hits an enemy on the back of the head. Of course I have not taken physics, so I wouldn't know how this works.


All times are GMT -5. The time now is 12:37 AM.

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