AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   messages (https://forums.alliedmods.net/showthread.php?t=6281)

Ramirez 09-26-2004 14:12

messages
 
Alright, I just cant understand messages...
I went through the whole temp messages doc in SDK...
I checked out some plugins..
BUt I jsut cant undersatand how it works..
I really wanna do messages but I need someone to help me understand..
Could anyone kindly explain me? :P

johnjg75 09-26-2004 15:52

well there's many different messages you can apply to...
the following makes their screen a certain color(red in this case)
Code:
    message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id)     write_short( 15 )     write_short( 15 )     write_short( 12 )     write_byte( 200 ) // red     write_byte( 0 ) // green     write_byte( 0 ) // blue     write_byte( 200 ) // alpha     message_end()
Notice it has get_user_msgid("ScreenFade") so it uses the screenfade message to apply the color. The following is a screenflash...
Code:
    message_begin(MSG_ONE, get_user_msgid("ScreenShake"),{0,0,0},id)     write_short( 1<<3 )// amplitude     write_short( 1<<3 )// duration     write_short( 1<<3 )// frequency     message_end()
also see the ScreenShake message... notice that the last parameter of message_begin() is who it applies to so make sure you set it to ur needs There are many others but i hope this gives some understandment....

Ramirez 09-26-2004 16:05

Yeah, alrdy helps a little..
but could you explain further on how it works?
Like,


Code:
message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},id)
How do you know that u have to put "MSG_ONE"
And what are the "{0,0,0}" for?
What is the difference between:
Code:
write_short( 15 )
and
Code:
write_byte ( 15 )
And why "15" where do you take that number?.

Also,
Code:
write_short( 1<<3 )// amplitude
How does this 1<<3 works?
not sure what it does...
Any help would be really appreciated :)

Freecode 09-26-2004 16:08

maybe u might want to learn what short/bytes and bitwise operators are.
Also checking the include files might help..........ALOT

Ramirez 09-26-2004 16:09

Quote:

Originally Posted by Freecode
maybe u might want to learn what short/bytes and bitwise operators are.
Also checking the include files might help..........ALOT

Alright, ill check it out...

johnjg75 09-26-2004 16:17

Quote:

Originally Posted by Ramirez
Also,
Code:
write_short( 1<<3 )// amplitude
How does this 1<<3 works?
not sure what it does...
Any help would be really appreciated :)

Code:
    message_begin(MSG_ONE,get_user_msgid("ScreenFade"),{0,0,0},index)     write_short( 1<<decisecs ) // fade lasts this long duration     write_short( 1<<decisecs ) // fade lasts this long hold time     write_short( 1<<12 ) // fade type (in / out)     write_byte( red ) // fade red     write_byte( green ) // fade green     write_byte( blue ) // fade blue     write_byte( alpha ) // fade alpha     message_end()

Ramirez 09-26-2004 16:19

Another question
In the: get_user_msgid()
Where can I find a list of all the messages?
and is there any other way then "get_user_msgid" to get different effects?
And I just can't get the write_short thingie..
How do you know what number to write? o_O

Ramirez 09-26-2004 21:56

IS there a tutorial available somewhere?

Freecode 09-26-2004 21:58

meta game << type that in console to get list of all mods events/messages

Ramirez 09-27-2004 16:31

OK, thanks for the info..
Now I wanna know... How would I go if I wanted to do some effects... like...
You know fireworks, fire etc...
How do they do it?
msg_one too?


All times are GMT -4. The time now is 17:25.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.