Raised This Month: $94 Target: $400
 23% 

Advanced Multiple Scrolling Messages


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   General Purpose        Approver:   ConnorMcLeod (74)
Ethan
Junior Member
Join Date: Mar 2009
Location: Russia, Saratov
Old 04-28-2011 , 06:50   Advanced Multiple Scrolling Messages
Reply With Quote #1

Advanced Multiple Scrolling Messages
by Ethan
version updated to 1.0d

Let me introduce to you my first plugin. Please don't be strict, keep in mind that this is the first one, and i know that i have a little experience, and some parts of code could be not so optimized, but i'm ready to work on it and i'm ready to improve the code, if someone will give me an advice - i'll do my best.
Check the code, and you can see yourself that i've spent lot of time and i hope my efforts were not in vain.
If you ask shortly why do we need this plugin? - because original scrolling system used in the standart plugin and remakes is rough and screen resolution dependent, hardcoded to 1024x resolution, buggy with long messages, totally not universal.

so..
Advanced Multiple Scrolling Messages

**** AMSM v1.0 ****

Made-from-zero powerful plugin for scrolling messages on the screen
may become a better alternative to default scrollmsg.amxx plugin


******* Features: *******
- This plugin scrolls messages on player's screen
- Messages are stored in a file
- Special amx_sm_add command to add new messages from the console
- Each message may end with a handy color parameter (see example)
- Can show message with changing color ('random' and 'rainbow')
- Each message can contain number of different CVars (see example)
- Most parameters are adjustable

******* USAGE "Fast Start": *******
- Using this plugin is simple as that
+ Add AMSM.amxx to your plugins.ini file
+ Start your server
+ Wait for message to appear

- Alternative usage
+ Add AMSM.amxx to your plugins.ini file
+ Start your server
+ Join to the server as admin with "a" flag or open server's console
+ Add message using amx_sm_add command
+ Wait for your message to appear

Standart message is stored in /cstrike/addons/amxmodx/configs/AMSM.ini by default.
There you can find some examples, and tips.
You can modify it or/and add more message to this file.
Example:
Code:
You're playing on %hostname%. This server uses AMXmodX version %amxmodx_version%. | rainbow
<- this displays message with changing color
Code:
Another message with red color|#FF0000
Or another one | red
Or one more with cvar. sv_cheats=%sv_cheats% | lightgoldenrodyellow
<-more than 50 color names availiable

- Keep in mind that everything could be accurately configured as well - see info in AMSM.sma file

******* CVars: *******
- amx_sm_speed 0.3 values: 0.1 ... 10.0 How fast message is scrolled.
- amx_sm_interval 60 values: 0.1 ... 99999.0 Time between displayings.
- amx_sm_align "center" values: "center","left","right" Horizontal align of scroll area.
- amx_sm_y_position 0.86 values: 0.0 ... 1.0; -1 Vertical position of scroll area on the screen.
- amx_sm_size 340 values: 20 ... 340 Size of scroll area in pixels.
- amx_sm_color "default" values: "default", "rainbow", "random", "white" or any other allowed color name or color in hex format "#FFFFFF". Default color to show parameterless messages
- amx_sm_file "default" values: any file name, (root directory is /cstrike/) Name of file with messages, file is created automatically if not exists.
- amx_sm_flick 1 values: 0 ... 1 Use 0 to deny color pulsations when new "scrolling frame" appears.

- For accurate configuration see info in AMSM.sma file

******* Commands: *******
- amx_sm_add <message> | [color]
Adds Scrolling Message To The List.
Before color parameter must be "|" delimeter.
[color] can be "rainbow","random", any allowed color ("white"), or html-like color code in hex format ("#FFFFFF")
ADMIN_IMMUNITY flag is required by default
Example:
amx_sm_add You're playing on %hostname%. This server uses AMXmodX version %amxmodx_version%. | rainbow


*** Technical Features, And Improvements Over Original, Other Plugins: **
- The code is totally original, lot of research performed
- New resolution independent scrolling conceprion based on text's size in pixels
- Shows warings and keeps CVar values safe
- CVars for accurate plugin control
- Using handy color parameters as color names and html-like hex color codes
- In function 'charpixize' list is statistically normalized
- Some functions may be useful in other plugin projects

******* Changelog: *******
v1.0d
-New synchronized frame displaying
-Rainbow colors reduced to 6 brigthest (orange deleted)
-Added CVar amx_sm_flick to turn on/off "color pulsations" (default - on)
-Some code cleared
-Some hardcodings removed

v1.0c
-Fast color name converting system fixed for AMXX 1.8.1
-Fixed bug with spaces in color parameters
-Some scrolling system updates
-Some hardcodings removed
-Some code optimized

v1.0b
-New fast color name converting system
-Fixed some bugs with 'static's

v1.0a
- Added default message
- Minimal changes in info section

v1.0
- Initial release

ps. additional features and effects may be added by request, i keep in mind some stuff, but as for now let's see what will be with this thread, i hope this won't be deleted at once. If needed i'm ready to open parallel thread in scripting help related to this plugin.
And thank you for reading this huge amount of bad-english text.

The story behind:
Hello Dear Allied Modders Community!
I read this forum for some years, and finally, decided to get some skills in pawn coding. It began when i revised plugins on my server. I've asked myself "What standart plugins can do?". I've decided to check standart scrollmsg.amxx plugin and found out that it has poor abilities, "there must be a better one", i thought .I've searched the forum and found two plugins: first by BMJ, it's approved as i see for now, and second one by tuty and both are standart AMXmodX team's plugin with some extra stuff added, both not handy. So I've imagined how the real scrollmessage plugin should look like, what it must do, how it must be configured, BUT i had literally no experience with pawn scripting, but had some skills in other programming languages. So my research started. First some pawn scripting, then scrolling message plugin, at some point i've made a plugin, but then i understood that i've made the same thing as standart plugn (lol), it had the same problems as original one. The scrolling system itself was not good. Original system deals with x coordinate shifting, and on different screen resolutions there's a great difference, maybe soneone noticed this bug when message stretches to the right, of shortens to the left on large resolutions? So, i've set it for me, that i'll make the right scrolling system. But how? hudmessage could be set only at some x coordinate, and on different resolutions there's great difference! I needed a totally new scrolling conception. Here i've made quite a research of set/show_hudmessage navie, found other problems with it, breaking the lines, symbols had different lengths... lot of work done, and time passed, .. i'll keep the details .. enough said

Attached Files
File Type: sma Get Plugin or Get Source (AMSM.sma - 1412 views - 43.4 KB)

Last edited by Ethan; 05-03-2011 at 23:03.
Ethan is offline
ANTICHRISTUS
kingdom of weird stuff
Join Date: Jun 2010
Location: My kingdom is not in thi
Old 04-28-2011 , 08:46   Re: Advanced Multiple Scrolling Messages
Reply With Quote #2

make your explanation shorter, otherwise no one will try to read your post .
__________________
ANTICHRISTUS is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 04-28-2011 , 09:40   Re: Advanced Multiple Scrolling Messages
Reply With Quote #3

Indeed, TOO MUCH TEXT stop saying the story of your life and tell us quick and simple what is this, why should we use it and how :}
__________________
Hunter-Digital is offline
saintjimmy
Junior Member
Join Date: Dec 2010
Old 04-28-2011 , 11:02   Re: Advanced Multiple Scrolling Messages
Reply With Quote #4

Yes,and upload some screens
saintjimmy is offline
Ethan
Junior Member
Join Date: Mar 2009
Location: Russia, Saratov
Old 04-28-2011 , 16:45   Re: Advanced Multiple Scrolling Messages
Reply With Quote #5

Thank you for your comments!
I've edited the first post a bit, marked most important information.
I hope someone will check the code and tell us what he thinks.
I can make some screens, but i think it's not really needed, it just scrolls message on the screen, but the realization is quite different and much better, has no standart plugin's problems.
Ok some screens


Last edited by Ethan; 04-28-2011 at 22:29.
Ethan is offline
Zombiezzz
Veteran Member
Join Date: Nov 2009
Location: Nov 2009
Old 04-28-2011 , 21:09   Re: Advanced Multiple Scrolling Messages
Reply With Quote #6

i clicked the picture and it sent me to a porn site. what the hell man
__________________
Zombiezzz is offline
Ethan
Junior Member
Join Date: Mar 2009
Location: Russia, Saratov
Old 04-28-2011 , 22:21   Re: Advanced Multiple Scrolling Messages
Reply With Quote #7

ouch! i've jest checked it myself, and that's not good. Fixed
Ethan is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-28-2011 , 23:04   Re: Advanced Multiple Scrolling Messages
Reply With Quote #8

First thing that I notice is that set_color_from_colorname() is extremely inefficient. You should consider using a Trie to retrieve a reference number which you then use as the index to a 3D array containing the RGB values. It would execute much quicker and would be about five lines long.

P.S. I sure hope you don't use an 8 character width tab
__________________
fysiks is offline
Ethan
Junior Member
Join Date: Mar 2009
Location: Russia, Saratov
Old 04-28-2011 , 23:56   Re: Advanced Multiple Scrolling Messages
Reply With Quote #9

First post shortened and cleared.

Quote:
Originally Posted by fysiks View Post
set_color_from_colorname() is extremely inefficient.
Thanks for your advices! Yep you're right, and it looks monstrous. I'm sorry for i don't know what trie is, but i'll work on this issue, and will try to update it asap.
p.s. let me see what i can do with these tabs
Ethan is offline
Ethan
Junior Member
Join Date: Mar 2009
Location: Russia, Saratov
Old 04-30-2011 , 22:40   Re: Advanced Multiple Scrolling Messages
Reply With Quote #10

Quote:
Originally Posted by fysiks View Post
You should consider using a Trie to retrieve a reference number which you then use as the index to a 3D array containing the RGB values.
Updated to new version, using Trie to convert color names to rgb values.
fysiks check this out if you have some time. Thanks in advance.
Compiled file size decreased for 2kb

--
Also, some stupidity fixed.

+deleted complied plugin (AMSM.zip) from first post
if you need compiled plugin click "Get plugin" instead

p.s. it could sound totally stupid but i don't know how to fight with these 8-symbol tabs

Last edited by Ethan; 05-01-2011 at 20:07.
Ethan is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:07.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode