Posts: 3,462
Threads: 72
Joined: Jun 2010
I was thinking about the recently included tutorial made by Gibstick and DES|Bukz, and I thought about how nice it would be to allow their text to be displayed in a fashion not unlike the "!TEST BUILD!" that one might see when testing SVN. I thought I would just transcribe their tutorial into C++, then I figured, why not just include some cubescript support? So I got to coding.
This is what I came up with (so far):
VARP(displayed_text_y, 0, 10, 2500);
VARP(displayed_text_x, 0, 10, 2500);
void display_cs_text ()
{
draw_textf("%s", displayed_text_x, displayed_text_y, getalias("displayed_text"));
}
With display_cs_text hidden away in gl_drawhud.
This allows the user to change the text location, and what the text says. Now, I do see some problems with including this, with such a huge range of values for the location, but I figured I'd get that smoothed out once I finish it.
This is what I ended up with:
I was wondering what the devs thought of this (currently) 8 lines of C++ being include in AC? I am also wondering what other people think I can improve in these lines. I know the ranges aren't perfect, but that will come later.
Posts: 1,823
Threads: 20
Joined: Jun 2010
Wonderful! Colours work, right?
Posts: 3,462
Threads: 72
Joined: Jun 2010
That is what I'm going to do next time I work on it. I'm pretty sure I know how. I'm starting to think of limiting it to the right hand side of the screen only, this will make it so people dont decide to put a period in the middle of the screen when using the sniper. (One of the biggest problems with implementing it.
Posts: 3,780
Threads: 33
Joined: Jun 2010
Ah!
You didn't tell me you could change the text and its position!
Much cooler! :D
Posts: 3,462
Threads: 72
Joined: Jun 2010
Haha
This is a off shoot from my little hello world project that I was telling you about.
Posts: 890
Threads: 16
Joined: Jun 2010
Makeshift sniper crosshairs, I can see it already.
Posts: 3,462
Threads: 72
Joined: Jun 2010
Hence me limiting it to the right side of the screen. Left side would allow someone to use bunches of spaces to get over there, right side of the screen would only allow them to go off the screen with their text. There might be some other things I could use to prevent that, but as I said, I need to work on that aspect more.
Posts: 890
Threads: 16
Joined: Jun 2010
Or limit locations to a distance x above and below the height of the crosshair.
Posts: 3,462
Threads: 72
Joined: Jun 2010
I thought about that, except that the text might be able to extend all the way into the crosshair area. Because you only limit the starting point, not the ending point. Again, I need to look at draw_textf or just draw_text to really know what I'll do.
Posts: 1,436
Threads: 7
Joined: Jun 2010
I'd say most people would rather stick a dot to their screen instead of learning script commands ;)
Posts: 3,780
Threads: 33
Joined: Jun 2010
I'd rather learn to pwn with pistol. :-P
Posts: 1,981
Threads: 63
Joined: Jun 2010
(26 Nov 10, 03:10PM)tempest Wrote: I'd say most people would rather stick a dot to their screen instead of learning script commands ;)
we can manage to check text position.
Posts: 3,462
Threads: 72
Joined: Jun 2010
Before I got to far with limiting the text-able areas, I found that when I died, so did the text. I'm pretty sure I need to find a better place to execute the function. Yet I currently haven't found a better spot.
Posts: 76
Threads: 1
Joined: Jun 2010
Sounds like it's happening cos the game goes into spectator mode while dead; off the top of my head, the only UI element I can think of that's always available is the console output, so try putting it there.
Posts: 3,780
Threads: 33
Joined: Jun 2010
scores (if showscoresondeath is 1), radar, teamicon, stats (if stats > 0) also remain after death.
Posts: 3,462
Threads: 72
Joined: Jun 2010
I was thinking of putting it was in the console output, which makes some sense. I will do one test first which is replacing the !TEST VERSION! or whatever that says with my line of code, because I know that stays on (when uncommented) I do have it right under those lines of code though.
|