Omnimaga

Omnimaga => News => Topic started by: DJ Omnimaga on April 13, 2011, 03:27:57 am

Title: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: DJ Omnimaga on April 13, 2011, 03:27:57 am
Although ARM9 assembly and C language files are still not possible on them, the new TI-Nspire OS'es definitively have support for an extra programming language with more possibilities than the crippled TI-Nspire BASIC. As reported (http://ourl.ca/10340) in our previous news, it seemed that OS 3.0 also included Lua interpreted language or a similar form of it. Now Goplat has made the following Wacky Fun Ran... er... I mean 15 Puzzle clone:

(http://www.omnimaga.org/index.php?action=dlattach;topic=7770.0;attach=7304;image)
(http://www.omnimaga.org/index.php?action=dlattach;topic=7750.0;attach=7309;image)
http://www.omnimaga.org/index.php?action=dlattach;topic=7770.0;attach=7305
A better quality preview (http://www.omnimaga.org/index.php?action=dlattach;topic=7770.0;attach=7305) of it is also available in AVI format. The game can be downloaded here (http://www.omnimaga.org/index.php?action=dlattach;topic=7770.0;attach=7302).

Although this is not Crysis nor nDoom, once Goplat or somebody else will make it possible for other people to develop documents written in this language, it will be possible for them to develop TI-Nspire OS 3.0 games written in Lua, featuring support for interactive key input like we have on Z80 and 68K TI-BASIC languages and as you can see, it doesn't seem very slow like the display commands on the Casio Prizm OS.

UPDATE (15:48): This is how Goplat created the document!
Here's how I made the .tns file:

  • Create a blank document
  • Create a Problem1.xml file, containing the following (without any line breaks, except in the script itself):
    <?xml version="1.0" encoding="UTF-8" ?><prob xmlns="urn:TI.Problem" ver="1.0" pbname=""><sym></sym><card clay="0" h1="10000" h2="10000" w1="10000" w2="10000"><isDummyCard>0</isDummyCard><flag>0</flag><wdgt xmlns:sc="urn:TI.ScriptApp" type="TI.ScriptApp" ver="1.0"><sc:mFlags>0</sc:mFlags><sc:value>-1</sc:value><sc:script>Lua script goes here (with appropriate character entities replacing the four characters < > " ')</sc:script></wdgt></card></prob>
  • Use 7-zip to create a zip file containing Problem1.xml
  • Concatenate the beginning of the blank document, up to the end of Document.xml (at offset 0x170), with the zip file. (OS 3.0 requires Document.xml to be encrypted, but thankfully Problem*.xml can still be unencrypted.)
Source: this post (http://ourl.ca/10347/197585)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Stefan Bauwens on April 13, 2011, 03:40:16 am
Getkey command? Yeah!
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Munchor on April 13, 2011, 04:18:11 am
This looks very nice, but I can't get, by reading the article, what language was used to do this, Lua?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Lionel Debroux on April 13, 2011, 04:19:03 am
Yup, it's Lua.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Jim Bauwens on April 13, 2011, 04:20:05 am
Its Ti-Lua !

Does this mean that Ti is adding more programming capabilities to their nSpires?
Wow, never expected that!

Edit:
100st post!
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Stefan Bauwens on April 13, 2011, 05:52:48 am
I hope that Lua isn't a hard programming language :P
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Ashbad on April 13, 2011, 06:22:52 am
I hope that Lua isn't a hard programming language :P

Don't worry, it's a step down from Axe in difficulty ;)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: compu on April 13, 2011, 07:07:05 am
Getkey and drawing functions... awesome. O.O
I like Lua, it's very simple to learn.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Munchor on April 13, 2011, 07:46:13 am
I hope that Lua isn't a hard programming language :P

Don't worry, it's a step down from Axe in difficulty ;)

I like Lua, it's code is sexy, but not as sexy as Python.

When I learnt it a few months ago though, I had no idea that there would ever be a TI-Lua.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: TIfanx1999 on April 13, 2011, 08:17:48 am
I'm astounded that TI actually added more programmability to the Nspire line. For me though, it's too little too late. I've given up on the Nspire in light of the Prizm.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Yeong on April 13, 2011, 08:21:21 am
w00t! finally a getkey on nspire XD
Now all it need is downgrade support
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Levak on April 13, 2011, 08:27:18 am
Remember that for now, TI don't let officially the public to program in this language. It is for now a private language and we need to hack the *.tns to extract Problem1.xml from it as we can make for OS 1.1.
For now, no one knows if TI will diffuse freely the SDK, will sell it, or keep it for its developpers.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Yeong on April 13, 2011, 08:28:45 am
If they sell it, i'm sure somebody will probably make a better one for free.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Hot_Dog on April 13, 2011, 09:45:11 am
WOW!

So seeing as Goplat has to make this "available," will it be easier than hacking the Nspire from the beginning?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Munchor on April 13, 2011, 10:23:21 am
WOW!

So seeing as Goplat has to make this "available," will it be easier than hacking the Nspire from the beginning?

It seems it's just extracting some file :P So yeah, it looks easier.

I'm afraid TI won't make a SDK, since we have behaved badly, we hacked their new calculator in just a few hours and are already making games (I give critor and all the other guys the merit for this though, while saying 'we').
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: BrownyTCat on April 13, 2011, 10:29:09 am
I have intermediate Lua knowledge, so this could be fun.  :hyper:
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Hot_Dog on April 13, 2011, 12:07:08 pm
Quote
I'm afraid TI won't make a SDK, since we have behaved badly, we hacked their new calculator in just a few hours and are already making games (I give critor and all the other guys the merit for this though, while saying 'we').

I'm pretty sure that TI made a SDK before just to make money.  They only gave SDKs for free when not many people were using them.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Juju on April 13, 2011, 12:17:55 pm
Well this is awesome. I'm sure the TI developers bets on how fast we find the stuff they hide on their calcs. :P
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Freyaday on April 13, 2011, 12:21:34 pm
Boo-Yah! If I ever get an Nspire, I'm definitely going to learn Lua.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: JosJuice on April 13, 2011, 12:32:42 pm
Well this is awesome. I'm sure the TI developers bets on how fast we find the stuff they hide on their calcs. :P
If they know about Omnimaga (and the other calc sites), I'm pretty sure they do. :P
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: ztrumpet on April 13, 2011, 03:23:24 pm
Wow, this looks incredible.  Major props to Goplat and all involved; this is amazing. ;D
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: DJ Omnimaga on April 13, 2011, 03:29:34 pm
I wouldn't be surprised if eventually TI tried to sell us a Lua SDK. Hopefully the community can either write one or a program to convert txt files to a TI-Nspire lua compatible format.

By the way I added a screenshot on the first post. I captured from the TI-Nspire software, but it's a CX screenshot, not regular TI-Nspire.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Goplat on April 13, 2011, 03:44:44 pm
Here's how I made the .tns file:

Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: DJ Omnimaga on April 13, 2011, 03:47:42 pm
Oh wow nice, could you elaborate on number 4, though? To me it seems kinda like Chinese because I never messed with advanced zipping options before x.x
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Lionel Debroux on April 13, 2011, 03:48:44 pm
DJ: concatenating the two documents can be done by copying and pasting, using a hex editor such as XVI32 :)
Open the blank TNS document with the hex editor; open the zipped problem1.xml; copy the entire contents of the latter to the clipboard; paste at the end of the former; save the former.

Goplat: thanks for the explanations :)
It's even simpler than I thought.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: aeTIos on April 13, 2011, 03:49:02 pm
O.O that looks actually pretty easy :)
Thanks for sharing this!
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: DJ Omnimaga on April 13, 2011, 03:51:23 pm
Yeah but where do you do the concatenation? Do you just open the empty document file in notepad then paste its content at the end/beginning of the XML file? Or do we absolutely need an hex editor? Maybe it would be nice to have a tutorial describing every step in detail for the average computer-illiterate person, in the forum help section.

It's still nice that it can already be done without having someone write an entire IDE or something, though. Congrats to everyone for having found out about Lua on the Nspire.

EDIT: Nvm my first paragraph, I didn't see your edit.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Jim Bauwens on April 13, 2011, 03:59:47 pm
This is real cool!

I hope we will start seeing nice programs in Lua for the nSpire's :)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: GB on April 13, 2011, 05:41:54 pm
We still gotta find some way to run Ndless though. I doubt it'll be easy to create another nDoom or Gameboy emulator in Lua.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: DJ Omnimaga on April 13, 2011, 05:44:23 pm
Yeah I agree. However Lua opens the Nspire to more programmers. Many people can't stand C and ASM difficulty (probably the reason why there are so few Nspire coders despite the large amount of Nspire users around here)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: ruler501 on April 13, 2011, 05:49:13 pm
This is amazing. I am starting to learn Lua now. If I can get the hang of It hopefully I will be able to start writing programs(games) for my Nspire.
I second DJ's idea of a having a good tutorial for how to do this. It sounds a little cryptic to me write now.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: XVicarious on April 13, 2011, 06:44:43 pm
Hey guys, wait an hour or so, I'm about to release a program that takes a Lua script and converts it to a TNS document.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: ruler501 on April 13, 2011, 06:46:41 pm
Is there any special way we need to write the Lua programs? Is there an API or something for the available libraries?
I'm starting on learning Lua so hopefully soon I can release something interesting
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Adriweb on April 13, 2011, 06:48:20 pm
Hey guys, wait an hour or so, I'm about to release a program that takes a Lua script and converts it to a TNS document.

Lol, I was starting to make a shell program to do that :)

What language do you plan on using ?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: XVicarious on April 13, 2011, 06:50:51 pm
Visual Basic. I'll be uploading in less than 10 mins (hopefully)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Adriweb on April 13, 2011, 07:06:23 pm
Visual Basic. I'll be uploading in less than 10 mins (hopefully)

Source Code included ?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: DJ Omnimaga on April 13, 2011, 07:22:14 pm
Nice Jkag. You should post it in the downloads section of the site when ready, but make sure it's a zip file and that required dependencies are mentionned.

I think I'll add a Lua sub-forum in the calc help section later.

By the way bienvenue sur le forum Adriweb!
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Adriweb on April 13, 2011, 07:41:40 pm
Merci :)

Ok so, my shell script  is pretty much written but for some unknown reason yet, I don't seem to get a proper zipper version when compressing Problem1.xml....

Is there any specific arguments to the "7za" command ?

EDIT : nevermind, it was a mistake on my side .... I didn't escape the chars in the lua script ... ;)

OK, I'll post my shell script LUAtoTNS tomorrow as it's 2 am for me right now :P
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: XVicarious on April 13, 2011, 07:46:28 pm
Okay... Just doing one more thing and I'mma upload it.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Adriweb on April 13, 2011, 07:55:02 pm
Btw, my shell script is finished and is working in Mac OS and Linux and other bash shell, probably

(PS : see my previous' post edit)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: ruler501 on April 13, 2011, 07:57:12 pm
will there be a windows version?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: XVicarious on April 13, 2011, 07:59:09 pm
ruler, my version is Windows.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: ruler501 on April 13, 2011, 08:01:28 pm
OK when is release?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: XVicarious on April 13, 2011, 08:06:28 pm
Fixing something right now... I guess the format is wrong or something... Looking into it...
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: GB on April 13, 2011, 08:15:07 pm
I wonder if TI makes these changes to the TI-Nspire just to keep us busy...
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: apcalc on April 13, 2011, 08:16:41 pm
I wonder if TI makes these changes to the TI-Nspire just to keep us busy...

Another thing I am wondering - could TI have added this to keep us satisfied and quiet?

Although this language is powerful for game development, I would think it would be near impossible to write a program such as gbc4nspire/ndoom/RunOS in this language.  Might they just be giving up a little in order to prevent disaster for themselves????
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: ruler501 on April 13, 2011, 08:18:51 pm
They have to realize eventually we'll get C on these also. We aren't going to give up without something with that kind of power(At least I hope not).

Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: GB on April 13, 2011, 08:21:27 pm
I am also wondering, APCalc, do you have plans on porting your "Block-Dude" game over to System 3.0?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: apcalc on April 13, 2011, 08:22:40 pm
I am also wondering, APCalc, do you have plans on porting your "Block-Dude" game over to System 3.0?

I have already started to work on a Lua port of Block Dude! :)

Likewise, as soon as AP Tests are over, I plan on updating all of my projects to make them Ndless 2.0 compatible, releasing nPlayer, working on Chip's Challenge, etc... :)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: ruler501 on April 13, 2011, 08:23:21 pm
don't forget to make LUA versions of all of them ;)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Adriweb on April 13, 2011, 08:23:43 pm
Btw, here's an example of what my shell script can do :)

(http://i27.servimg.com/u/f27/11/67/13/30/lua-to10.jpg)

(I just copied GoPlat's code, for the example ;) )

Download available tomorrow !
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: GB on April 13, 2011, 08:26:31 pm
I am also wondering, APCalc, do you have plans on porting your "Block-Dude" game over to System 3.0?

I have already started to work on a Lua port of Block Dude! :)

Likewise, as soon as AP Tests are over, I plan on updating all of my projects to make them Ndless 2.0 compatible, releasing nPlayer, working on Chip's Challenge, etc... :)

I have a beta of your Chips Challenge program. It looks very promising. I hope you keep up the good work with it.

And for your video player, have you considered using lower-resolution videos that don't take up the whole screen to save on space?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: willrandship on April 13, 2011, 09:18:23 pm
How open is Lua to the guts of the system? I know it's a high level language, but I wonder if ndless 3.0 could use the lua method to work, maybe as a header for ndless progs in C/Asm? Lua runs the code, and all you have to do is click run. It would also allow for Lua in the middle of C and Asm :)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: ruler501 on April 13, 2011, 09:19:18 pm
I don't think Lua has the power to enable C/Asm

Good Idea thoguh. I wonder how far into the system we can go with Lua
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: XVicarious on April 13, 2011, 09:22:05 pm
sorry for the delay... I'm having compression problems... as in the compression seems to be off in the program.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: willrandship on April 13, 2011, 09:29:31 pm
Well, it really depends on the system, not the language. Lua might be able to alter some memory elsewhere, so when the system thinks it's running Lua it's running Asm, and being happy with ndless. :D
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: apcalc on April 14, 2011, 03:25:04 pm
I am also wondering, APCalc, do you have plans on porting your "Block-Dude" game over to System 3.0?

I have already started to work on a Lua port of Block Dude! :)

Likewise, as soon as AP Tests are over, I plan on updating all of my projects to make them Ndless 2.0 compatible, releasing nPlayer, working on Chip's Challenge, etc... :)

I have a beta of your Chips Challenge program. It looks very promising. I hope you keep up the good work with it.

And for your video player, have you considered using lower-resolution videos that don't take up the whole screen to save on space?

That is an excellent idea, indeed!  I will look into this... :)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: DJ Omnimaga on April 14, 2011, 06:05:53 pm
I wonder if TI makes these changes to the TI-Nspire just to keep us busy...

Another thing I am wondering - could TI have added this to keep us satisfied and quiet?

Although this language is powerful for game development, I would think it would be near impossible to write a program such as gbc4nspire/ndoom/RunOS in this language.  Might they just be giving up a little in order to prevent disaster for themselves????
I bet they are convinced they patched the hole allowing Ndless to be installed and to prevent a disaster or something they added something for programmers so their reputation isn't tarnished as much.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Javafant on April 18, 2011, 05:30:20 pm
It looks quite cool, but I cant download it because im not allowed to acces the section. Could you please attach it to your post?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: DJ Omnimaga on April 18, 2011, 05:35:10 pm
Hmm strange where does the error comes from? O.O

Welcome on the forums by the way.

EDIT: Nevermind. I fixed it now. It was because the game topic was split elsewhere and I forgot to update the link in the first post.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Javafant on April 19, 2011, 11:45:31 am
Thank you!
Now it works!
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Jonius7 on March 27, 2012, 07:21:52 am
This doesn't work with > OS 3.0.2 does it?
Fortunately I have managed to get it working ;D.
so edited version by me here: http://ourl.ca/15678.new#new
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Jim Bauwens on March 27, 2012, 11:11:21 am
It doesn't work because it's created with an old tool that did not support encryption (unlike Luna).

Edit: he created it manually and his brain could not handle the encryption (at least not yet)
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Netham45 on March 27, 2012, 11:17:22 am
It doesn't work because it's created with an old tool that did not support encryption (unlike Luna).

Edit: he created it manually and his brain could not handle the encryption (at least not yet)

Even if his brain could handle encrypting it TI would just upgrade their code to a version his brain could not handle in the next release.
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Jim Bauwens on March 27, 2012, 11:20:34 am
Well, not true. They don't mind Luna for some reason.
Basically all my files I send to them are made by Luna (and they know it).
Heck, they even think PCspire is cool :D

Also, maybe the reason why they added encryption was to protect code from proprietary/their own documents?
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Lionel Debroux on March 27, 2012, 12:32:34 pm
Quote
Also, maybe the reason why they added encryption was to protect code from proprietary/their own documents?
Maybe, but said obfuscation protects little, if anything... and wastes CPU cycles and battery power...
Title: Re: First non-TI-BASIC game on TI-Nspire OS 3.0
Post by: Jonius7 on March 27, 2012, 08:07:26 pm
There was a little xml/html code &quot; &lt; that was in the Problem1.xml
So mostly unencrypted, but doesn't work for > OS 3.0.2 I guess.
But once that's over, Luna makes it much easier.