Author Topic: Nice useless script: BulletText.  (Read 6350 times)

0 Members and 1 Guest are viewing this topic.

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Nice useless script: BulletText.
« 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:

« Last Edit: November 21, 2007, 12:26:02 pm by PerroAZUL »
urraka

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Nice useless script: BulletText.
« Reply #1 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 :)
« Last Edit: November 18, 2007, 10:00:54 pm by 1221995 »

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Nice useless script: BulletText.
« Reply #2 on: November 18, 2007, 10:00:02 pm »
oh wow.....this is really wierd. Gj on it though...

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Nice useless script: BulletText.
« Reply #3 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]
urraka

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Nice useless script: BulletText.
« Reply #4 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
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline Leo

  • Soldat Beta Team
  • Veteran
  • ******
  • Posts: 1011
Re: Nice useless script: BulletText.
« Reply #5 on: November 19, 2007, 05:28:25 am »
Won't this cause a lag spike ? Special with long sentences ?

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Nice useless script: BulletText.
« Reply #6 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

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: Nice useless script: BulletText.
« Reply #7 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).

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Nice useless script: BulletText.
« Reply #8 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
« Last Edit: November 19, 2007, 07:53:01 am by PerroAZUL »
urraka

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Nice useless script: BulletText.
« Reply #9 on: November 19, 2007, 11:12:05 am »
I also coded something like that, but mine is way too laggy.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline sai`ke

  • Camper
  • ***
  • Posts: 318
  • Can't be arsed to remove christmas avatar
Re: Nice useless script: BulletText.
« Reply #10 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.
#soldat.ttw #ttw.gather --- Quakenet!
http://ttwforums.com

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Nice useless script: BulletText.
« Reply #11 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?

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: Nice useless script: BulletText.
« Reply #12 on: November 19, 2007, 05:14:34 pm »
Really good script. Thanks.
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline 1221995

  • Soldier
  • **
  • Posts: 206
Re: Nice useless script: BulletText.
« Reply #13 on: November 19, 2007, 08:11:41 pm »
Oh, and my last post was a request lol ;p

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Nice useless script: BulletText.
« Reply #14 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.
urraka

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Nice useless script: BulletText.
« Reply #15 on: November 19, 2007, 10:18:37 pm »
You made a script and haven't even tested it ?
:P
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Nice useless script: BulletText.
« Reply #16 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.
urraka

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Nice useless script: BulletText.
« Reply #17 on: November 21, 2007, 10:13:33 pm »
Just a thought, Can that kill?
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Nice useless script: BulletText.
« Reply #18 on: November 22, 2007, 01:52:28 am »
I set to 0 all the parameters of CreateBullet, so it shouldn't make damage.
urraka

Offline Avkon

  • Soldier
  • **
  • Posts: 136
  • Ah, whatever.
Re: Nice useless script: BulletText.
« Reply #19 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.

Offline Avarax

  • Veteran
  • *****
  • Posts: 1529
    • Official Hexer & MMod site
Re: Nice useless script: BulletText.
« Reply #20 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.
I like to have one Martini
Two at the very most
Three I'm under the table
Four I'm under the host

Offline PKS|Shooter

  • Soldier
  • **
  • Posts: 130
  • Dont fuck with us!
    • PKS - La Familia
Re: Nice useless script: BulletText.
« Reply #21 on: November 22, 2007, 02:26:32 pm »
DAMN NICE :D

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Nice useless script: BulletText.
« Reply #22 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
« Last Edit: November 25, 2007, 10:03:11 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Nice useless script: BulletText.
« Reply #23 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
urraka

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Nice useless script: BulletText.
« Reply #24 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' ?
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Nice useless script: BulletText.
« Reply #25 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'))
urraka

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Nice useless script: BulletText.
« Reply #26 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?
« Last Edit: November 26, 2007, 03:08:16 pm by Kavukamari »
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Nice useless script: BulletText.
« Reply #27 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]);
urraka

Offline Kavukamari

  • Camper
  • ***
  • Posts: 435
  • 3.14159265358979, mmm... pi
Re: Nice useless script: BulletText.
« Reply #28 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
"Be mindful of fame, show a mighty courage, watch against foes. Nor shalt thou lack what thou desirest, if with thy life thou hast comest out from that heroic task."

Offline Ariakas

  • Major(1)
  • Posts: 12
Re: Nice useless script: BulletText.
« Reply #29 on: November 27, 2007, 03:17:59 pm »
PerroAZUL Esta Bueno El Script Todavia No Lo Bajo Pero Se Ve Bueno :D

Offline Iq Unlimited

  • Flagrunner
  • ****
  • Posts: 864
  • mr. foobar2000
Re: Nice useless script: BulletText.
« Reply #30 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.