Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: urraka on November 18, 2007, 09:10:24 pm

Title: Nice useless script: BulletText.
Post by: urraka on November 18, 2007, 09:10:24 pm
Script Name: BulletText
Script Description: Draws text with bullets.
Original Author(s): PerroAZUL
Core Version: 2.6.3


Some months ago I made this script. It's cool but I never released it because the results weren't as I expected. The players couldn't see the text I was writing with the script because it requiers to send too many bullets I guess. Anyway, I'll release it so you can see it, and maybe you find some use for it.

It has one main function:
Code: [Select]
procedure DrawBulletString(text: String; x, y, size, resolution: Single; align: String; bullet: Byte);
In the script I included some commands so you can test it:
/loadletters - This will load the letters stored in letters.txt. That file contains all capitalized letters, an space and the symbol "!". Any letter can be added if you understand the format in which it's saved. The format consists of a list of lines, each line as 2 points.

/write [text] - This will write the text near the player, with flame as bullet type. Justs as an example.

Here a preview of what it does:

(http://img88.imageshack.us/img88/5084/himends8.png)
Title: Re: Nice useless script: BulletText.
Post by: 1221995 on November 18, 2007, 09:52:04 pm
WOW!!! that amazing (clicks download button ;) ) !!! Um confused... does it work,  or not ??? Oh well... ill try it out...

EDIT: i dont get how to use it  :-\

EDIT 2: Ok, i get it now... Its pretty nice :)
Title: Re: Nice useless script: BulletText.
Post by: Iq Unlimited on November 18, 2007, 10:00:02 pm
oh wow.....this is really wierd. Gj on it though...
Title: Re: Nice useless script: BulletText.
Post by: urraka on November 18, 2007, 10:11:20 pm
WOW!!! that amazing (clicks download button ;) ) !!! Um confused... does it work,  or not ??? Oh well... ill try it out...

EDIT: i dont get how to use it  :-\

EDIT 2: Ok, i get it now... Its pretty nice :)

It works just fine, the problem is that when spawning too many bullets players can't read the text very well.

To use it first use the command /loadletters, then you can use /write [text]
Title: Re: Nice useless script: BulletText.
Post by: chutem on November 19, 2007, 02:26:32 am
That is friggin awesome,

how long does the text stay up?, if it is short you could have an option for duration and keep remaking the bullets according to the duration
Title: Re: Nice useless script: BulletText.
Post by: Leo on November 19, 2007, 05:28:25 am
Won't this cause a lag spike ? Special with long sentences ?
Title: Re: Nice useless script: BulletText.
Post by: 1221995 on November 19, 2007, 07:29:22 am
Well, last night i got it to work, and i can explain some of it.

/loadletters
That loads the configuration in the letters.txt file, which configures where bullets spawn for each letter.
/write
this wont work without doing /loadletters, because the letters wont be set to spawn anywhere. The letters that are built in are all the alphabet (which is in all caps, so typeing "i am cool" wont work, and "I AM COOL" will), a space (just so space bar works, spawns no bullets), and an exclamation point. So the letters you can type are:
Code: [Select]
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z !  (note the spacebar at the end)

I think I saw some other odd (different) characters in there, but if your not sure or forget, when you type /loadletters , it shows up in the script console.

Most important:
Letters/text/flames:
Letters and text only show up for about 1-2 seconds, but it looks cool.

FAQ: I might add more later
Lag spike?
Not that i know of.  The letters only stay up for 1-2 seconds.

Longer time durations?
Maybe. Im not a big one on complicated scripts, but im OK at it, so if PERRO doesnt want to make it, I could TRY. And PERRO, i think it wouldnt be TOO hard to do... Wouldnt it just take an AppOnIdle that goes of every like... second (or, if implemented, your timer suggestion, if it comes out soon enough)? When the AppOnIdle finishes (Equals Zero) then it could make the bullets again (might make a HUGE lag spike lol)? I was thinnking about this last night, before Chutem even posted...

My Questions: Once again, might add more  ;)
1:As said before, AppOnIdle added?
2: is it me, or would it be REALLY easy to change the bullet type?Writing "DIE!!!" really high up in m79 nades, and watching your word kill Everyone (lol) would be pretty histerical ;) (hehe sticks and stones can break my bones, but words can blow my head off  8) )
3: I have to go, but ill add more later, sorry  :'( And if im being a know-it-all, sorry again  :-\ i just have half an hour on my hands, and I like this script ALOT  ;D

Thanks,
Chuck/1221995
Title: Re: Nice useless script: BulletText.
Post by: Toumaz on November 19, 2007, 07:37:12 am
Great thanks for releasing this one, PerroAZUL.  If you wouldn't mind, I might incorporate it into Fistbox (with your permission of course).
Title: Re: Nice useless script: BulletText.
Post by: urraka on November 19, 2007, 07:50:54 am
Won't this cause a lag spike ? Special with long sentences ?

You might be right there. Actually, something like that is why I hadn't released it before.

Also, I think you can't write long sentences, because there seems to be a limit on the number of bullets you can spawn at the same time. You can check it, write a long sentence and see how some letters or part of them are missing. And another thing, you might see it working perfectly in a local server, but I'm not sure how well it is seen by remote players.

That is friggin awesome,

how long does the text stay up?, if it is short you could have an option for duration and keep remaking the bullets according to the duration

The text stays up only for a little while, it's just a bullet appearing. The flames dissapear very quickly. If you change the bullet type it lasts a bit more, because you can read it while the bullets are falling.

1221995:
Yes, you could try using AppOnIdle. I'm not sure how well that would work, maybe it'd go fine. It would be easy because it's just calling one function: DrawBulletString. I'm not planning to do it anyway, so you could give it a try if you want.

Great thanks for releasing this one, PerroAZUL.  If you wouldn't mind, I might incorporate it into Fistbox (with your permission of course).

No problem, feel free to use it as much as you want :p
Title: Re: Nice useless script: BulletText.
Post by: Avarax on November 19, 2007, 11:12:05 am
I also coded something like that, but mine is way too laggy.
Title: Re: Nice useless script: BulletText.
Post by: sai`ke on November 19, 2007, 11:19:35 am
I can't imagine anything like this not to be laggy. That said, I'd love to see someone prove me wrong.
Title: Re: Nice useless script: BulletText.
Post by: 1221995 on November 19, 2007, 03:20:36 pm
Oh wow... I looked at the code, and its WAY too complicated for me. Im a begginer at scripting, and thats pretty advanced... Maybe someone else could do it though?
Title: Re: Nice useless script: BulletText.
Post by: xmRipper on November 19, 2007, 05:14:34 pm
Really good script. Thanks.
Title: Re: Nice useless script: BulletText.
Post by: 1221995 on November 19, 2007, 08:11:41 pm
Oh, and my last post was a request lol ;p
Title: Re: Nice useless script: BulletText.
Post by: urraka on November 19, 2007, 08:56:54 pm
I don't think it's worth wasting time adding stuff to this script unless somebody confirms that it isn't too laggy and it works fine. I don't really feel like testing it right now.
Title: Re: Nice useless script: BulletText.
Post by: chutem on November 19, 2007, 10:18:37 pm
You made a script and haven't even tested it ?
:P
Title: Re: Nice useless script: BulletText.
Post by: urraka on November 19, 2007, 11:24:31 pm
The script works fine... I tested it in my own local server that's all. So I don't know how well it goes with the connection. I think I've made it clear.
Title: Re: Nice useless script: BulletText.
Post by: chutem on November 21, 2007, 10:13:33 pm
Just a thought, Can that kill?
Title: Re: Nice useless script: BulletText.
Post by: urraka on November 22, 2007, 01:52:28 am
I set to 0 all the parameters of CreateBullet, so it shouldn't make damage.
Title: Re: Nice useless script: BulletText.
Post by: Avkon on November 22, 2007, 08:44:37 am
I think the normal text was better, using bullets in text formation seem a clumsy way to do something that can already be done in a better way.

And besides, I really don't need any more lag, I already get about 180-260 in all servers usually.
Title: Re: Nice useless script: BulletText.
Post by: Avarax on November 22, 2007, 08:53:51 am
I think the normal text was better, using bullets in text formation seem a clumsy way to do something that can already be done in a better way.

And besides, I really don't need any more lag, I already get about 180-260 in all servers usually.

duh....

1.: This script of course only serves for special purposes and can be used for funny gimmicks. It's not meant to replace the usual DrawText

2.: It doesn't cause any ping increement but rather little lag spike that can cause a very short moment of warping or stuff like that.
Title: Re: Nice useless script: BulletText.
Post by: PKS|Shooter on November 22, 2007, 02:26:32 pm
DAMN NICE :D
Title: Re: Nice useless script: BulletText.
Post by: Kavukamari on November 25, 2007, 09:55:06 pm
what is ord()

btw, if you change text in drawbulletstring to uppercase(Text) then it will write text even if it's lowercase
Title: Re: Nice useless script: BulletText.
Post by: urraka on November 25, 2007, 11:46:58 pm
Ord() returns the ASCII code corresponding to the character.

I didn't use UpperCase(Text) because lower case characters can be added to letters.txt
Title: Re: Nice useless script: BulletText.
Post by: Kavukamari on November 26, 2007, 12:57:06 pm
well uppercase() is a good temporary fix (until someone adds lowercase letters)

btw, how would you add a slash ( / ) would you only put two coords in letters.txt and the script would fill in the rest of the bullets?

(like (0,0) (50,-100) or something?)

so would ord('i') return the chr() value for 'i' ?
Title: Re: Nice useless script: BulletText.
Post by: urraka on November 26, 2007, 01:05:34 pm
The '/' would be like:

Code: [Select]
/=0.7,1,{[0.0, 2.0],[0.7,0.0]};
The format is
character=<width>,<Number of Lines>,{[x1,y1],[x2,y2]},..

The width of the letters already done is 1.0, and the height is 2.0. That's why I chose 0.7 for the width of this character.

As for the other question:
Code: [Select]
'i' = chr(ord('i'))
Title: Re: Nice useless script: BulletText.
Post by: Kavukamari on November 26, 2007, 02:55:43 pm
does ord() work with sentences too?

ord('all your base are belong to us!')

Quote
Code: [Select]
for i := 1 to Length(str) do
    ord(str[i]);

is that w/o str being an array?
Title: Re: Nice useless script: BulletText.
Post by: urraka on November 26, 2007, 02:58:14 pm
And what do you want to get from that? If you want the code of each character you can iterate through the string:

Code: [Select]
for i := 1 to Length(str) do
    ord(str[i]);
Title: Re: Nice useless script: BulletText.
Post by: Kavukamari on November 26, 2007, 05:18:38 pm
just wondering, because these things are good to know if I suddenly need to script something with chr()'s
Title: Re: Nice useless script: BulletText.
Post by: Ariakas on November 27, 2007, 03:17:59 pm
PerroAZUL Esta Bueno El Script Todavia No Lo Bajo Pero Se Ve Bueno :D
Title: Re: Nice useless script: BulletText.
Post by: Iq Unlimited on November 27, 2007, 04:50:25 pm
PerroAZUL Esta Bueno El Script Todavia No Lo Bajo Pero Se Ve Bueno :D

English only please.