Author Topic: Ti RPG 2 done in Lua (V0.06)  (Read 32801 times)

0 Members and 3 Guests are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #15 on: November 06, 2011, 02:22:37 pm »
Looking good so far. I'm glad it's possible to only refresh parts of the screen. Should be faster. In TI-83+ BASIC when you draw something, it refreshes everything, which can be incredibly slow at times.

Offline Ghezra

  • LV2 Member (Next: 40)
  • **
  • Posts: 30
  • Rating: +4/-0
    • View Profile
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #16 on: November 06, 2011, 02:36:21 pm »
Yeah DJ, originally in the Main Menu it refreshed the screen ever 1/10th of a second, and it used to recompile the image over and over.

Then I made it to where it only loads the image once when the image variable is still nil,

Then I made it to where it only redraws below the image entirely.

Its a rough process of optimization :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #17 on: November 06, 2011, 02:54:19 pm »
Cool to hear.

Also question: Is it your first Nspire project ever? If so, for now I would avoid venturing into scrolling yet and focus on the basics of the engine. It's best to start smaller then add more feature once you feel ready to. Also note that scrolling, unless the Nspire has actual scrolling commands, might slow things down.

Offline Ghezra

  • LV2 Member (Next: 40)
  • **
  • Posts: 30
  • Rating: +4/-0
    • View Profile
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #18 on: November 06, 2011, 04:35:33 pm »
Considering I dont even know what you mean by scrolling, I'll just take your word for it. And Yes this is my first Nspire project. Which is also why I'm completely open for any and all opinions/recommendations about the code

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #19 on: November 19, 2011, 02:17:59 pm »
Oh I meant when your character is walking around, but on the screen what you see moving around is the trees, buildings, roads, etc, instead of just your character. That's scrolling. Another example of scrolling is the text in movie credits that moves up.

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #20 on: November 24, 2011, 02:49:11 pm »
This is great, TI RPG is one of the best TI-nspire Basic games made and it's good to see it being ported to Lua.
Eventually you could make a graphical RPG
« Last Edit: November 24, 2011, 02:49:55 pm by Jonius7 »
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline Ghezra

  • LV2 Member (Next: 40)
  • **
  • Posts: 30
  • Rating: +4/-0
    • View Profile
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #21 on: March 04, 2012, 02:31:06 am »
So, I've been hard at work porting all the code to Lua.

I get to a semi-stopping point, and pasted the code into the student software (after using the TI scripting tools) And when I past into a new page, it completely crashes the student software dead.

I even tried just commenting out the entire code and pasting it and it crashes. I loaded up an earlier version of the code and it pastes fine. So something I added since the last version is crashing the software even if its commented out.


If someone can glance through the code and find something that is likely the culprit, please let me know. I have some suspicions and I'm working on it, but I added hundreds of lines of code and restructured the entire source code since I last checked it on the Nspire software. Brother.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #22 on: March 04, 2012, 02:33:09 am »
Well the student software is unfortunately not very reliable for testing. A lot of Lua games do not run correctly in it. You would have to test on-calc.

I guess you can post the code here too, though, in case people can help. Preferably in the Lua programming sub-forum, though.

Nice to see you again btw!

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #23 on: March 04, 2012, 02:57:20 am »
Yup, post your code like DJ_O said, and I (and others) will take a look at it.
You could try using nspire_emu too, since it runs the hand held OS.

Offline Ghezra

  • LV2 Member (Next: 40)
  • **
  • Posts: 30
  • Rating: +4/-0
    • View Profile
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #24 on: March 04, 2012, 03:01:48 am »
I AM in the lua subforum?

Also, I posted the code in the main post. (its where I keep updating the code)

also also, I figured it out.

In the original TIRPG, he used UTF-8 symbols, and lua doesn't support them, so it immediately crashed.

I'll be updating the code in the original thread to be working for your testing pleasure.

Alsox3, Thank you for the prompt replies!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #25 on: March 04, 2012, 03:04:36 am »
Oh wait yeah the topic is in the Lua section. If I remember it used to be under project, though. I probably forgot it was moved around a while ago.

And glad you figured out the problem. :)

Offline Ghezra

  • LV2 Member (Next: 40)
  • **
  • Posts: 30
  • Rating: +4/-0
    • View Profile
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #26 on: March 04, 2012, 03:56:12 am »
Now that I have the next week off and can just solely work on this project. I'll have a completely functioning RPG here probably by monday night to then begin tweaks and GUI customizations. There isn't much code thats left to be ported from the NspireBASIC code. When I have it to where combat at least works, I'll post the .tns file itself as I hit each version so I can also get some feedback on what works and what doesnt.

Offline cyanophycean314

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 363
  • Rating: +43/-1
  • It's You!
    • View Profile
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #27 on: March 04, 2012, 09:50:51 pm »
Nice job! Just saw this thread today. Looks great and can't wait to see more come out of this project! :D
« Last Edit: March 04, 2012, 09:51:01 pm by cyanophycean314 »

Offline Jonius7

  • python! Lua!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1918
  • Rating: +82/-18
  • Still bringing new dimensions to the TI-nspire...
    • View Profile
    • TI Stadium
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #28 on: March 05, 2012, 04:30:15 am »
That looks like great progress you've made recently. Don't forget credits to Superbany, who created the original game.
« Last Edit: March 05, 2012, 04:30:36 am by Jonius7 »
Programmed some CASIO Basic in the past
DJ Omnimaga Music Discographist ;)
DJ Omnimaga Discography
My Own Music!
My Released Projects (Updated 2015/05/08)
TI-nspire BASIC
TI-nspire Hold 'em
Health Bar
Scissors Paper Rock
TI-nspire Lua
Numstrat
TI-nspire Hold 'em Lua
Transport Chooser
Secret Project (at v0.08.2 - 2015/05/08)
Spoiler For Extra To-Be-Sorted Clutter:

Spoiler For Relegated Projects:
TI-nspire BASIC
Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled) | Cosmic Legions (stalled)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Offline hellninjas

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 625
  • Rating: +17/-0
    • View Profile
Re: Ti RPG 2 for the Nspire done in Lua
« Reply #29 on: March 05, 2012, 12:06:19 pm »
I love it :D
Really keeps me busy in SRT :)