This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Kingdaro's profile picture

TurtleSim - A turtle simulator sort of thing made in love2d!

Started by Kingdaro, 15 February 2013 - 05:57 PM
Kingdaro #1
Posted 15 February 2013 - 06:57 PM
TurtleSim

A limited, weird, and different turtle simulator!


About
So yeah, I had the idea a while ago about an isometric turtle simulator type thing, except it wouldn't directly simulate turtles. I wanted to make it a little simpler than CC's turtles. Well, its simplicity is up for debate, but basically, there were a lot of things I wanted to try out to see if they would even work, and I'm really surprised that I've even gotten this far.

I feel like the more you read down what the basis of this program, you'll get more mad because of how different it is, but whatever. Here are a list of some notable differences:
  • Overhead View
  • Infinite Space
  • Infinite Turtles
  • Built-in remote control
  • Turtles are named and have their names displayed above their heads
  • Turtle API has no "turtle." prefix (and is generally a lot more limited, but it's just a flat plane so you can't expect much.)
  • Each turtle is not an entire computer in itself, but rather, it represents its own program. Every robot/turtle can only have one script that you can edit.
So with that out of the way, onto some more very important information if you plan on testing it out.

Controls (a little wonky, I know)
Everywhere:
  • Use the tilde key ( ` ) to bring up the console, where your turtles can print messages. When the console is up, use the scroll wheel to scroll through it. I might make it automatically scroll later on.
In the overhead view:
  • WASD to move the camera around
  • Press 'n' to open up the new turtle dialogue, then type an ID.
  • Right-click a turtle to open its script for editing
  • Left-click to run the turtle's code
  • Shift + left click to target a turtle for remote control. Use either the numpad keys (8, 4, 6, 2, 5, +) or j, i, k, l, u, and o to control it. Shift + left click anywhere not a turtle to remove remote control focus.
  • Alt + left click on a turtle to delete it.
  • Alt + right click on a turtle to clear its code. It will be backed up before deletion.
Code editor:
  • Everything self explanatory (arrows to move around editor, type to make text, backspace to delete it, etc.) (no mouse support yet, other than scrolling, which isn't bounded, so be careful with that.)
  • Use ctrl+enter to run turtle code without leaving the editor.
  • Press esc to exit the editor.
The API
Basically, all functions are global, and the only library given is math, along with print() and write() functions. File writing/saving isn't available (yet?).
  • forward() - moves the turtle forward.
  • back() - moves the turtle back.
  • up() - moves the turtle up.
  • down() - moves the turtle down.
  • left() - turns the turtle left.
  • right() turns the turtle right.
  • setName(name) - sets the turtle's name, currently the only way of setting the turtle's name.
  • sleep(s) - stops the script for s number of seconds.
Other Important Information
If you would like to access the files externally, the directory for the game's files are at:
  • Windows: %appdata%\LOVE\TurtleSim\
  • Mac: /Users/user/Library/Application Support/LOVE/TurtleSim/
  • Linux: ~/.local/share/love/TurtleSim/
And if you don't figure it out yourself, you can open the .love included in the download for the program's source. You're free to snoop about, as long as you don't steal anything. ;)/>/>/>

Screenies!




Download
https://www.dropbox.com/s/bjbphul5najt6f5/TurtleSim.zip

P.S. Sorry if I disappointed anyone with the promise of a full-fledged turtle emulator; this is more of a silly little turtle-inspired sandbox than anything.

EDIT: Link to the github repository: https://github.com/Kingdaro/turtle-sim
Acfuffy #2
Posted 15 February 2013 - 07:51 PM
Amazing
Kingdaro #3
Posted 15 February 2013 - 08:04 PM
Amazing
Thanks! :D/>

And aaAHASHDHGFDNFSHG I FORGOT TO CHANGE THE WINDOW TITLE.
remiX #4
Posted 15 February 2013 - 09:43 PM
Wow haven't tested it yet but it looks amazing :o/>

Ps: nice window title lol
superaxander #5
Posted 15 February 2013 - 10:30 PM
Awesome!!!!!!!!!!
Pinkishu #6
Posted 15 February 2013 - 11:47 PM
It's funny how often while I work on something, someone else releases something similar :P/>
Anyway my version will be in lua/cc :3
Kingdaro #7
Posted 16 February 2013 - 05:45 AM
Wow haven't tested it yet but it looks amazing :o/>

Ps: nice window title lol

Awesome!!!!!!!!!!
Thanks guys! And yeah, I changed the window title now. :P/>


It's funny how often while I work on something, someone else releases something similar :P/>
Anyway my version will be in lua/cc :3
That's awesome, good luck with that bro!
remiX #8
Posted 16 February 2013 - 06:55 AM
When clicking escape while writing code it errors, check attachment
Kingdaro #9
Posted 16 February 2013 - 07:04 AM
Whoops, forgot to actually create the folder before saving it. Working on a patch now.

EDIT: Sorry about that guys, should be fixed now. :P/>
ETHANATOR360 #10
Posted 16 February 2013 - 09:05 AM
That's amazing cant wait to get on my computer and try it
nolongerexistant #11
Posted 16 February 2013 - 09:22 AM
It's quite fun, however I found this bug

It crashes if you try to press del if the editor is empty.

Here's how to recreate it:
- Open empty editor
- Press enter
- Press delete



And is it possible to lower a turtle using remote control? :P/> "-"" doesn't work
Kingdaro #12
Posted 16 February 2013 - 09:43 AM
Fixed that, and did some other stuff:
  • Allow exiting the "New Robot" prompt with the escape key
  • Disable toggling the console from the editor screen (because it does both that and types a tilde, which can get annoying if you're trying to just open the editor or just type a tilde.)
  • Script errors are now printed to the console
Also, new version numbering, so you'll know if you have a fix or not. Current is r2.


And is it possible to lower a turtle using remote control? :P/> "-"" doesn't work
The lower key is actually 5. I wanted to base it off of Blockland controls. In the future, I could just add the minus key as an alternative.
Matt21 #13
Posted 18 February 2013 - 08:05 AM
It's don't not works on my computer :(/>

Windows says "This file is imcompatible with your computer. Consult system informations" to know if you need a x86 version or a x64 version, then contact the program maker" (traducted from french)

Can you help me? :(/>

Thanks
Kingdaro #14
Posted 18 February 2013 - 09:15 AM
It's don't not works on my computer :(/>

Windows says "This file is imcompatible with your computer. Consult system informations" to know if you need a x86 version or a x64 version, then contact the program maker" (traducted from french)

Can you help me? :(/>

Thanks
Should work now, I packaged it with the 32 bit version rather than the 64 bit version. I think the 32bit version works on all systems.
lieudusty #15
Posted 18 February 2013 - 09:44 AM
Wow, nice! :D/>
Kingdaro #16
Posted 21 February 2013 - 04:03 AM
Spoiler

This took way longer than it should have, haha.

EDIT:
Spoiler

Having too much fun with this. Also spoiler'd.
remiX #17
Posted 21 February 2013 - 04:53 AM
Lol nice :P/>

Btw, not sure if this is a bug or not but:
You can't use the down arrow with left/right at the same time, but you can use up and right/left at the same time

edit: I mean with the WASD keys
Kingdaro #18
Posted 21 February 2013 - 04:59 AM
That's probably your keyboard; works fine even on my crappy laptop, haha.
remiX #19
Posted 21 February 2013 - 07:31 AM
Hmm? Well I tried quite a few times… let me try again now..

Edit: Ok now it works o_O maybe the program needed a restart xD
TheOddByte #20
Posted 05 March 2013 - 10:28 AM
Absoultely amazing!
Will sit with this all night =3
TheOddByte #21
Posted 05 March 2013 - 10:29 AM
But it shows me that the File is deleted or moved =(
LuaEclipser #22
Posted 05 March 2013 - 10:41 AM
Dropbox is down
Kingdaro #23
Posted 05 March 2013 - 10:43 AM
Whoops, didn't really think anyone was that interested in this. Fixed the download. I might host the code on github now that I actually know how to use it :lol:/>
Goof #24
Posted 21 March 2013 - 06:22 AM
Hmm.. could anybody make a video on how to install for Windows Vista?…i've downloaded, extracted to desktop, and then ran the ".love" file with the "TurtleSim" program… but i keep getting errors?


Thanks
Kingdaro #25
Posted 21 March 2013 - 06:32 AM
You only need to run the TurtleSim program. The .love is for non-windows users.
Goof #26
Posted 21 March 2013 - 06:33 AM
Okay… i figured it out, now :D/> Thanks
bobiniki #27
Posted 21 March 2013 - 09:38 AM
Thats GREAT! I love love2d
MrDoomah #28
Posted 21 March 2013 - 12:00 PM
This is simply amazing!
SuicidalSTDz #29
Posted 21 March 2013 - 12:12 PM
didn't really think anyone was that interested in this
Speechless… I use this all the time. I have like twenty houses just for shits n' giggles, that's how awesome this sim is ^_^/>
ds84182 #30
Posted 22 March 2013 - 04:06 PM
Can… Can I steal this and make a full turtle emulator?
Tiin57 #31
Posted 23 March 2013 - 12:03 AM
Can… Can I steal this and make a full turtle emulator?
No. I'm working on a full turtle emulator in Java. So you don't get to do this. :3
SuicidalSTDz #32
Posted 23 March 2013 - 12:10 AM
Can… Can I steal this and make a full turtle emulator?
No. I'm working on a full turtle emulator in Java. So you don't get to do this. :3
Oooh, I will want to see this ^_^/>
ds84182 #33
Posted 23 March 2013 - 08:31 AM
Can… Can I steal this and make a full turtle emulator?
No. I'm working on a full turtle emulator in Java. So you don't get to do this. :3
Oooh, I will want to see this ^_^/>
Oooh, I will want to see this ^_^/>
CoolisTheName007 #34
Posted 23 March 2013 - 08:37 AM
Can… Can I steal this and make a full turtle emulator?
No. I'm working on a full turtle emulator in Java. So you don't get to do this. :3
If you manage to include debugging tools in it (maybe harder in java than in Lua), that would be something new too.
Kingdaro #35
Posted 23 March 2013 - 11:14 AM
Can… Can I steal this and make a full turtle emulator?
Sure. Just give me credit for the original program, obviously.
AndreWalia #36
Posted 23 March 2013 - 08:23 PM
how does the turtle get blocks to place??
Mr. Fang #37
Posted 24 March 2013 - 09:40 AM
wow this is REALLY cool :D/>
Kingdaro #38
Posted 24 March 2013 - 09:50 AM
how does the turtle get blocks to place??
That's in an unreleased version, and to be honest, I've sort of stopped development. I might pick it up again after I'm done/bored with canvas though.
bobiniki #39
Posted 26 March 2013 - 08:23 AM
You mentioned that you will put the source in github. Have you done it and can you post a link to your repository.

Nevermind I found it. Here if anyone is interested: https://github.com/Kingdaro/turtle-sim