Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: Jim Bauwens on June 10, 2012, 07:04:47 am

Title: TI & Lua
Post by: Jim Bauwens on June 10, 2012, 07:04:47 am
TI updated their scripting page a bit a couple of days ago:
http://education.ti.com/educationportal/sites/US/nonProductSingle/nspire-scripting.html

Some interesting statements:
Quote
For programmers and the programming community
The wider programming community gains a potential programming and gaming platform that can well suit their needs. We look forward to seeing programmers band together through existing online communities to share their work and learn from one another.

At least they recognize that there is/was a need. And because several members of the community have close contact with TI, stuff will only get better :)
Also, they clearly don't mind games ..

Quote
Getting started with Lua scripting for TI-Nspire technology
Try a series of tutorials that will take you from getting started to creating TI-Nspire documents with the Script Editor. Learn more

These tutorials use OcLua (made by ExtendeD)  ;D

Both things show that they slowly start appreciating the community again. This is because it benefits them too. (So if they would open up to native programming, it would benefit them a great deal). If TI continues with this trend I think we will see some great stuff happening :)

Title: Re: TI & Lua
Post by: Adriweb on June 10, 2012, 07:13:25 am
This page should change again sometime soon ;-)
Title: Re: TI & Lua
Post by: Lionel Debroux on June 10, 2012, 08:14:14 am
Quote
If TI continues with this trend I think we will see some great stuff happening :)
Unlikely. Nobody should set any hopes on TI behaving as they did with the older series, and as they should have done for the Nspire series.
Title: Re: TI & Lua
Post by: Adriweb on June 10, 2012, 10:44:59 am
Quote
If TI continues with this trend I think we will see some great stuff happening :)
Unlikely. Nobody should set any hopes on TI behaving as they did with the older series, and as they should have done for the Nspire series.
Well, beginning with Lua first, not talking about native for now.
Title: Re: TI & Lua
Post by: Nick on June 10, 2012, 10:49:17 am
can't you somehow force TI to make it possible to read and write to files with lua? that would make the possiblities a lot bigger, since then extern levels etc could be added without having to update the game in total (just an example)

or with the physics engine it would be possible to make one general program that reads from files that contain a specific setup and runs them..
Title: Re: TI & Lua
Post by: Jim Bauwens on June 10, 2012, 10:52:25 am
I and Adrien have talked to TI regarding the matter, showing where it could be useful. TI might improve external reading/writing in the future.
(also, you can already read external files)
Title: Re: TI & Lua
Post by: Nick on June 10, 2012, 10:54:33 am
read external files??? how? i didn't know that รถ
Title: Re: TI & Lua
Post by: Adriweb on June 10, 2012, 11:11:21 am
you can load stuff inside MyLib with some math.eval() calls I think, or directly var.recall
Here's what Levak does, in a version of Make3D :

Code: [Select]
_, err = pcall(function() loadstring(var.recall("make3d_lib\\s__importer__"))() end)
if not err then
--- some more init code --
end
Title: Re: TI & Lua
Post by: Jim Bauwens on June 10, 2012, 11:26:56 am
Yup, you can get data from Library documents using [lua]math.eval[/lua] or [lua]var.recall[/lua] :)
The only annoying thing is that you will need to know the name of the external library.
Title: Re: TI & Lua
Post by: Lionel Debroux on June 10, 2012, 11:42:06 am
By "reading from external files", I think that what he, and most of us, have in mind is not that kind of platform-specific, two-way-incompatible, watered-down file access ;)

"Reading from external files" means being able to rely on standard Lua functions from the "io" family, in order to read and write arbitrary data from the filesystem. Access to the filesystem is a basic capability provided by dozens of thousands sane programming environments; sadly, five years after its introduction on the market, the Nspire still is not one of them (when it's restricted to what TI feels like providing to users, that is).
Title: Re: TI & Lua
Post by: Jim Bauwens on June 10, 2012, 11:43:44 am
I know it is restricted. And that is why we asked TI to improve it :)
They understood that the functionality could have good use. However I do not know if/when/how it will be done.
Title: Re: TI & Lua
Post by: Nick on June 10, 2012, 11:47:35 am
thanks lionel for explaining them xp

and thanks jim & adriweb &whoever else for asking, i hope they include it in the next versions..
Title: Re: TI & Lua
Post by: aeTIos on June 13, 2012, 07:59:33 am
I know it is restricted. And that is why we asked TI to improve it :)
They understood that the functionality could have good use. However I do not know if/when/how it will be done.
I hope they stop restricting and make the systems more open, maybe even support ASM/C. If they do that, I am really going to send them a "thanks" mail xD
Title: Re: TI & Lua
Post by: blue_bear_94 on June 16, 2012, 05:34:02 pm
It took TI 4 years to give into supporting assembly since the time a hack was discovered. 2014.
Title: Re: TI & Lua
Post by: DJ Omnimaga on June 16, 2012, 07:27:27 pm
I made a news about this. Still not as great as stopping blocking Ndless, but still good nonetheless. Hopefully they spend less energy into blocking Ndless and more into fixing bugs before release and improving Lua speed and commands. Still hoping, for example, that Lua eventually adds direct input controls, so movement can occur every frame rather than every 6 frame or so and allow multiple keypresses. More speed would be nice too for 3D stuff and tilemapping.
Title: Re: TI & Lua
Post by: aeTIos on June 17, 2012, 06:46:43 am
Maybe TI-Planet guys can ask for direct input?
Title: Re: TI & Lua
Post by: Lionel Debroux on June 17, 2012, 07:16:19 am
In fact, they did so a year ago...
Title: Re: TI & Lua
Post by: Jim Bauwens on June 17, 2012, 07:26:27 am
Direct input in what sense ?
Title: Re: TI & Lua
Post by: Lionel Debroux on June 17, 2012, 07:44:35 am
I think that "direct input" for the Nspire means what it means in basically all other TI graphing calculators (and undoubtedly in some graphing calculators for other manufacturers): some form of direct getKey ;)

Double bonus points for providing both a slow getKey and a fast getKey. On the TI-68k, the former would be represented by ngetchx() or GKeyIn(NULL, 0), which also takes care of other things, while the latter would be represented by the rather fast OSdequeue(kbd_queue()).
Title: Re: TI & Lua
Post by: aeTIos on June 17, 2012, 09:15:19 am
Hmm, yeah. Some form of the Axe getkey would be cool :D And is pretty much possible I guess. (Axe has getkey(keycode) just like basic but 120 times faster).
Also no key delay function would be cool.
Title: Re: TI & Lua
Post by: Nick on June 17, 2012, 09:58:35 am
well, the only thing I find sad is that they made it event based.. loop based is much more flexible (imo) than event based, but i guess that's completely personal.

and about that getkey, it would be nice, but the way it is made now (with on.charIn()) it would conflict.. so that won't come i think
Title: Re: TI & Lua
Post by: Jim Bauwens on June 17, 2012, 10:14:44 am
@Lionel, aeTIos
Okay, I see your point there. Indeed, it would be nice to have some other key input stuff. For example, you can not catch many ctrl-[a-z] keys. A bit annoying, if you want to assign hotkey's to certain things.

Nick, in a sense you can run non event based stuff on a TI-Nspire. I've developed a small program to do that, and it works pretty good. Just did not have much time to work on it.