We're on Discord! Please join our server now if you don't want to miss anything! (More info) | Join the UCC4 contest! (More info)

* WalrusIRC & Discord main room

If you have a forum account, have more than 4 posts and are not part of a restricted usergroup, then you can chat in our main Discord server room directly from here and continue using the forums at the same time. Or you can join our server directly and access many more discussion rooms!

Author Topic: First Fantasy II, a graphical TI-84+CE RPG using CE Textlib hax  (Read 26014 times)

0 Members and 1 Guest are viewing this topic.

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Moderator
  • Forum Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 19070
  • Post Rating Ratio: +101/-5
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Heya @Art_of_camelot nice to see you again :D. And Dudeman313 lost his CE because his parents are against calc gaming and when he got caught by teachers playing games or programming his parents just returned the 84+CE to the store and he got the school 84+. D:
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nintendo Switch, Playstation TV

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline Art_of_camelot

  • Full User
  • Safe-haven access
  • Join Date: Jan 2015
  • Location: Dr. Light's Laboratory
  • Posts: 99
  • Post Rating Ratio: +1/-1
    • Omnimaga
Wow, that's pretty harsh.

Offline Lionel Debroux

  • Full User
  • Join Date: Jan 2015
  • Location:
  • Posts: 241
  • Post Rating Ratio: +11/-0
    • debrouxl
    • 58/5891
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TIEmu and TILP.
Co-admin of TI-Planet.

Offline Jkolade936

  • All Around Coolio
  • Super User
  • Join Date: Jan 2016
  • Location: Horseheads, NY
  • Posts: 1516
  • Post Rating Ratio: +9/-1
  • I'm an unknown loner. I try to change that.
    • Jkolade936
    • My Sprites and Walrii Collection
  • Gender: Male
Yeah. 
As you can see from my signature, I no longer own a graphing calculator, which means I can't play these awesome creations that everyone else is coming up with, and neither can I code for calculators in TI-Basic(the only language I know so far) away from a computer.
I do have a working build of CEmu, though, so if I can figure out my own computer's errors, I guess I could use that.

  • Calculators owned: None of them. :'(
Does this qualify as a signature? 
The answer is "Sure."


Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Moderator
  • Forum Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 19070
  • Post Rating Ratio: +101/-5
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
So due to space concerns, I did not want to repeat my sprite loading code over and over for different purposes, and while I am ok with sub-programs, I decided to use sub-routines first to keep them to a minimum. So basically, once the program is run, I use Goto 0, and right underneath that Goto there is a Lbl leading to the said sprite loading code, followed by another sub-routine to load maps. Since goto is faster with labels located at the top of BASIC code, the speed loss is almost non-existent.

THis will enable me to draw individual sprites anywhere I want. :D


(by the way, this doesn't cause memory leaks, because I still return to the Ends I need to close with another Goto command. This is a trick explained on TI-BD or somewhere else that allows you to use Lbl and Goto for sub-routines like routineName() and Return in other languages, except you still have to specify where you want to return in TI-BASIC.)
« Last Edit: March 22, 2016, 05:14:48 pm by DJ Omnimaga »
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nintendo Switch, Playstation TV

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline JWinslow23

  • Should my fans be called "Elephants", "Cookie Clickers", or "Descenders"?
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and 2↑↑↑6
  • Posts: 800
  • Post Rating Ratio: +14/-1
  • 99.999...% of mathematicians agree, tau > pi.
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
I believe I've heard of something like that. Except, you don't have to state where you jump back to after every subroutine. Here is some code for a Gosub/Return-like hack.

Code: [Select]
ClrHome
Disp "IN MAIN PROGRAM

// call subroutine
For(A,-1,0
//The subroutine must not modify A!
If A
Goto SB
End

Disp "BACK IN MAIN

// main program stops here
Return

Lbl SB
Disp "SUBROUTINE
// use End in place of a return statement
// also, make sure you return at some point
// failure to do so may result in a memory leak
End

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Moderator
  • Forum Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 19070
  • Post Rating Ratio: +101/-5
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Doesn't Return exit the entire program, though? That's a problem when you only want to use 1 program (other than the lib).
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nintendo Switch, Playstation TV

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline JWinslow23

  • Should my fans be called "Elephants", "Cookie Clickers", or "Descenders"?
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and 2↑↑↑6
  • Posts: 800
  • Post Rating Ratio: +14/-1
  • 99.999...% of mathematicians agree, tau > pi.
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
Doesn't Return exit the entire program, though? That's a problem when you only want to use 1 program (other than the lib).
Return exits the entire program...only when you get to it. If you Goto past the Return, it's fine.

I suppose you're confusing Return with End here, though. The statement that would usually mean "return from subroutine to program" is End here.

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Moderator
  • Forum Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 19070
  • Post Rating Ratio: +101/-5
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
What if I never need to exit the program, though?
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nintendo Switch, Playstation TV

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline JWinslow23

  • Should my fans be called "Elephants", "Cookie Clickers", or "Descenders"?
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and 2↑↑↑6
  • Posts: 800
  • Post Rating Ratio: +14/-1
  • 99.999...% of mathematicians agree, tau > pi.
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
What if I never need to exit the program, though?
Then you don't need a Return, because the code will never hit the subroutines when it doesn't need to.

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Moderator
  • Forum Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 19070
  • Post Rating Ratio: +101/-5
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
I was wondering why you suggested a return in the code above in the first place, hence my confusion :P

What I was curious about is if the SB sub-routine would need code like the following in order to go back to the label it was originally at in the game:

Code: [Select]
If A=1
Goto <back to map loading routine>
If A=2
Goto <back to boss 1 event>
If A=3
Goto <back to boss 2 event>
If A=4
Goto <back to boss 2 event B
If A=5
Goto <back to boss 2 event C
If A=6
Goto <back to boss 2 event D
If A=7
Goto <back to boss 2 event E
If A=8
Goto <back to fire magic animation loop
If A=9
Goto <back to ice magic animation loop
If A=10
Goto <back to bolt magic animation loop
If A=11
Goto <back to cure animation loop>
If A=12
Goto <back to boss 3 event
If A=13
Goto <back to boss 4 event
If A=14
Goto <back to boss 4 event B
If A=15
Goto <back to boss 5 event>
If A=16
Goto <back to boss 5 event B>
If A=17
Goto <back to final boss event>
If A=18
Goto <back to final boss event B>
If A=19
Goto <back to ending>
If A=20
Goto <treasure chest opening>

That said I could always just use other ways of course :P. For magic animations, for example, I would just setup lists of sprites ID then run through them.
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nintendo Switch, Playstation TV

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline JWinslow23

  • Should my fans be called "Elephants", "Cookie Clickers", or "Descenders"?
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and 2↑↑↑6
  • Posts: 800
  • Post Rating Ratio: +14/-1
  • 99.999...% of mathematicians agree, tau > pi.
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
I was wondering why you suggested a return in the code above in the first place, hence my confusion :P

What I was curious about is if the SB sub-routine would need code like the following in order to go back to the label it was originally at in the game:

Code: [Select]
If A=1
Goto <back to map loading routine>
If A=2
Goto <back to boss 1 event>
If A=3
Goto <back to boss 2 event>
If A=4
Goto <back to boss 2 event B
If A=5
Goto <back to boss 2 event C
If A=6
Goto <back to boss 2 event D
If A=7
Goto <back to boss 2 event E
If A=8
Goto <back to fire magic animation loop
If A=9
Goto <back to ice magic animation loop
If A=10
Goto <back to bolt magic animation loop
If A=11
Goto <back to cure animation loop>
If A=12
Goto <back to boss 3 event
If A=13
Goto <back to boss 4 event
If A=14
Goto <back to boss 4 event B
If A=15
Goto <back to boss 5 event>
If A=16
Goto <back to boss 5 event B>
If A=17
Goto <back to final boss event>
If A=18
Goto <back to final boss event B>
If A=19
Goto <back to ending>
If A=20
Goto <treasure chest opening>

That said I could always just use other ways of course :P. For magic animations, for example, I would just setup lists of sprites ID then run through them.
You do NOT need ANY of that with the For() loop method, just an End ;)

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Moderator
  • Forum Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 19070
  • Post Rating Ratio: +101/-5
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Really? Will it really return exactly where I came from? O.O If that's the case then I'm amazed. Thanks for the tip :3=
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nintendo Switch, Playstation TV

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

Offline JWinslow23

  • Should my fans be called "Elephants", "Cookie Clickers", or "Descenders"?
  • Super User
  • CW 4x3 challenge - 2nd place
  • *
  • Join Date: May 2015
  • Location: Somewhere between 13 and 2↑↑↑6
  • Posts: 800
  • Post Rating Ratio: +14/-1
  • 99.999...% of mathematicians agree, tau > pi.
    • @UCu_9qD95nADzc-W6RN-3Z8A
    • 113/11328
  • Gender: Male
No problem. The End (as far as the parser is concerned) belongs to that For() loop, and it will execute the subroutine in the first iteration, return to the beginning of that For() loop, and do nothing in the second iteration, leaving you exactly where you left off ;)

Offline xlibman

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Moderator
  • Forum Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 19070
  • Post Rating Ratio: +101/-5
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • DJ Omnimaga music store
  • Gender: Male
Ah, I understand now and this kinda makes sense while at it. Dunno why I no longer realized that the calculator was keeping track of the location of nested block/loop starting locations. >.<

In other words, this is almost exactly like real routines (or functions as they call them in certain languages), just with more limited naming abilities. That should make things easier for when I start using my sprite routine at multiple locations (I use it in map loading but I plan to also use it to draw individual sprites during battle and stuff (although for magic animations I'll probably just use big rectangles).
  • Calculators owned: TI-84 Plus C Silver Edition, TI-84 Plus CE, Casio fx-CG10
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nintendo Switch, Playstation TV

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games