Log In  

Cart #31474 | 2016-10-22 | Code ▽ | Embed ▽ | No License
14


NEW FEATURES (with helpful suggests by vNakamura) 10-22-16
^O## (outline color, 0-15)
^D# (delay, 0=none, 1=fast, 9=slow)
^P (pause with flashing cursor, wait for any keystroke)

Well hello there ! I bet you thought I fell in an open manhole or something. No such luck !

As it is, I want to share with you a lovely routine I have always written called TRX, which stands for Transmission X.

The term "Transmission X" comes from many years ago when i saw a B&W episode of Flash Gordon starring Buster Crabbe.

In one episode he mentions to Dale (his sweetheart) that he was going to send a "Transmission X" to an alien planet - and the music took a serious tone after he said this.

Dale asked innocently enough, "What does the X stand for ?"

Buster gave her a funny look. It was almost as if she forgot her lines or was ad-libbing, but he quickly responded to her,

"It means everything."

And that seemed to satisfy her. Or so it seemed. Since that time, the term and his definition of it stuck with me. "Transmission X." "it can do everything."

Later when I got into busy programming, i thought - why not make a routine, my own special "Transmission X" that does, well, just as Flash Gordon said, pretty well everything?

And I did, later shortening the name from "Transmit-X" to TRX.

There were a few other names I gave it. TR8, for instance, where everything was 8x8 pixels, but TRX I like that name the most and is what I use now.

And what YOU have here is a routine I oft write in any programming language I start out in when I want a strong text and image handler that works entirely and only with strings.

Full instructions are included. Lots of carrots. :)

I hope you find it useful for your own code and programs, and if you have some suggestions on what you'd like to see added to it, lemme know. If I can find my way around it, I'll do it for ya.

P#30230 2016-10-07 18:00 ( Edited 2017-09-04 05:53)

Hi Dw817, This will definitely be useful in the future--starred and hearted.

P#30237 2016-10-07 18:51 ( Edited 2016-10-07 22:51)
:: dw817

... My ! Thank you very much, and THANKS BIG for the star ! Gosh I don't know what they are or what they mean but they sure are shiny ! So I definitely want 'em. :)

If you have any suggestions of things you'd like, to add some new carrot-commands, lemme know and I'll see what I can do.

P#30239 2016-10-07 18:54 ( Edited 2016-10-07 22:54)
:: dw817

Good deal ! I'm not so sure if I can write any action-based videogames myself ... But I can definitely cook up some useful game-based libraries for the creation of 'em. :)

Be thinking about what you want in TRX as well. The library is definitely open to suggestion - anything to make it easier for others.

P#30253 2016-10-07 22:55 ( Edited 2016-10-08 02:55)

Super awesome! Very neat :)

P#30283 2016-10-08 05:04 ( Edited 2016-10-08 09:04)
:: dw817

Thanks, Afburgess. I'm wondering if I should improvise this to include inputs. That is, if "^_" is found, a "tag" mark is included, so the player must make a menu choice before control is returned to main.

I know I did that back on Tilemaster, just not so sure how well that would work here ...

P#30307 2016-10-08 13:13 ( Edited 2016-10-08 17:13)

Hey dw817, thanks for this awesome tool!

I'm trying to use it in my game but I'm not sure how to run the dialog box along with the _update and _draw functions. Should I use coroutines? I'm new to PICO-8 and Lua.

A carrot-command I think it would be cool to have is one to add pauses or change the text speed during the speech. So we can add a little more dramaticity

P#31240 2016-10-19 13:01 ( Edited 2016-10-19 17:01)
:: dw817

Glad you're liking TRX ! :D

I once asked about coroutines ? Here is what I heard about it.

. . .

Yep, I can repeat that if you like.

As I'm understanding it. _Update() is just that, when you need to update the screen. As with my TRX, there is no need to call it constantly every machine iteration unless you are doing some layer-level graphics.

_Draw() is called when the screen needs to be updated. Wait - isn't that what _Update does ?? :/

I really think it's a mess of programming myself - I'll stick with good old Spaghetti Coding; can't go wrong ! :)

As you are giving suggestions for TRX, and you are the ONLY person that gave any - after I finish Haunted House:

https://www.lexaloffle.com/bbs/?tid=27925

I'll get back here and beef up the TRX system with your suggests:

Text speed change inside carrots.
Pause inside carrots.

P#31271 2016-10-19 21:07 ( Edited 2016-10-20 01:12)

SICK. This is good work. After finding this, I took the time to look at your other contributions around here and let me say, I am a billion times more flattered now by your comments on a couple of my "games" that are virtually nothing, hahaha. Learning this whole thing myself from absolutely nothing besides a functional understanding of web programming is hard, so I appreciate you for taking the time to bother commenting anything at all on my frantic, haphazard attempts!

Once again, very good work. Thanks a million for this.

P#31299 2016-10-20 11:33 ( Edited 2016-10-20 15:33)

Pretty sure the idea of having _update and _draw separate is so that you can isolate parts of your code. I'm still somewhat of a novice myself, so take this explanation with a grain of salt but....

in _update we'd like to change all of the data that needs to be changed every tick of the clock (each frame). SO for a sprite, we may need to update its X and Y position, update the next sprite ID for animation, check to see if buttons are pressed, check for collisions, switch music, etc. Any thing that can change in our program, not just stuff on the screen.

with _draw, we simply want to draw our updated data. in some systems i have used, the _update type function builds up the entire screen buffer and then _draw just draws it all in one go.

P#31347 2016-10-20 19:39 ( Edited 2016-10-20 23:39)
:: dw817

Sounds reasonable, GCentauri. My code should be easy to port to _Update() and _Draw(). Just call TRX() inside either then, according to your needs.

P#31348 2016-10-20 21:00 ( Edited 2016-10-21 01:00)

right something like

  1. create a table with TRX data stored in it, like
    TEXT = {"trx text 1", "trx2", ...}

  2. Create a variable to keep track of which TEXT index we are at
    TEXT_INDEX = 1

  3. In _update we can have something like

    IF (BTN(4)) THEN TEXT_INDEX += 1 END

  4. In _draw we use the TRX() function to draw our text by using TEXT[TEXT_INDEX] for t in the trx example.

I haven't tried this out, but thats kinda how i imagine it would work

P#31352 2016-10-20 21:32 ( Edited 2016-10-21 01:32)

and you can call me Grant. ;) these are my first forum posts, nice to meet you!

P#31353 2016-10-20 21:35 ( Edited 2016-10-21 01:35)
:: dw817

Grant, granted these are public posts. Anonymity is often golden. :D However, my name is David. It can be seen in the programs I've written thus far both here and the stories I write for Writer's Cafe and artwork I paint on DeviantART.

Welcome.

P#31356 2016-10-20 22:31 ( Edited 2016-10-21 02:35)
:: dw817

Chief Bradley:

  • Happy you're enjoying the code !

If you have any suggestions you'd like to see added to TRX, toss 'em out and I'll see what I can do. :)

You mentioned your games, but when I click on your account, you have no posts ?

P#31385 2016-10-21 10:50 ( Edited 2016-10-21 14:50)
:: dw817

New features are up as per your requests, vNakamura. :)

See top and update for details.

P#31472 2016-10-22 15:47 ( Edited 2016-10-22 19:47)

FYI, the ^P feature doesn't work if you're calling TRX() from within _UPDATE or _DRAW since the state of BTN() doesn't update until the next frame (even though FLIP() is called).

P#43903 2017-09-04 01:53 ( Edited 2017-09-04 05:53)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2020-05-31 03:26 | 0.027s | 2097k | Q:54