Raised This Month: $12 Target: $400
 3% 

message_begin() fog message_end()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 05-30-2008 , 07:05   message_begin() fog message_end()
Reply With Quote #1

How i shold write a fog message?

message_begin(MSG_ALL, get_user_msgid("Fog"), _, _);
?whats here?
message_end()

if i write no bytes/shorts/coords... it writes me an error, that I need to write 7 bytes. If i make it like in hlsdk (write 5 shorts: 1 - red, 2 - green, 3 - blue, 4 - startdis, 5 - enddis) it writes me an error that I writed 10 bytes when 7 needed. Please help.
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-30-2008 , 07:44   Re: message_begin() fog message_end()
Reply With Quote #2

Something that doesn't crash me, but I don't see any fog.

Code:
message_begin ( MSG_ALL, get_user_msgid ( "Fog" ) ); write_byte ( 60 );   // red write_byte ( 60 );   // green write_byte ( 60 );   // blue write_short ( 50 );  // Start distance write_short ( 500 ); // End distance message_end();
__________________

Last edited by Arkshine; 05-30-2008 at 07:48.
Arkshine is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 05-30-2008 , 07:50   Re: message_begin() fog message_end()
Reply With Quote #3

thx. but 1 more question - what is start distance and end distance?
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-30-2008 , 07:54   Re: message_begin() fog message_end()
Reply With Quote #4

Ok, I've found ! That's just reversed.

Code:
        message_begin ( MSG_ALL, get_user_msgid ( "Fog" ) );         write_short ( 50 );  // Start distance         write_short ( 500 ); // End distance         write_byte ( 60 );   // red         write_byte ( 60 );   // green         write_byte ( 60 );   // blue         message_end();

It works fine for me, now.

By the way :

Start Distance = This value defines how far away from the player the fog will start. At this range, the fog is completely transparent.
End Distance = This value defines how far away from the player the fog will end. At this point, the fog becomes 100% opaque

MSG_ONE works too.


EDIT : strange. 60 60 60 should give me grey color, not blue. -_-'

EDIT2 : Hmm, I'm probably wrong. But I didn't yet figure out.
__________________

Last edited by Arkshine; 05-30-2008 at 09:46.
Arkshine is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 05-30-2008 , 09:47   Re: message_begin() fog message_end()
Reply With Quote #5

Works, but colors... color has a problem...
1 - red
2 - green
3 - blue
4 - startdist (distance from enddist to you)
5 - enddist (distance from you)

in hlsdk evrything is write_short() but it gives an byte number error...
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-30-2008 , 12:03   Re: message_begin() fog message_end()
Reply With Quote #6

Ok, actually this message is called when there is already an entity fog on the map and that you're connecting to the server.


Code:
L 05/30/2008 - 17:53:54: [shptool.amxx] message_begin(MSG_ONE, get_user_msgid("Fog"), {0,0,0}, 1)
L 05/30/2008 - 17:53:54: [shptool.amxx] write_byte(60)  // red
L 05/30/2008 - 17:53:54: [shptool.amxx] write_byte(60)  // green
L 05/30/2008 - 17:53:54: [shptool.amxx] write_byte(60)  // blue
L 05/30/2008 - 17:53:54: [shptool.amxx] write_byte(111) // Start distance
L 05/30/2008 - 17:53:54: [shptool.amxx] write_byte(18)  // End distance
L 05/30/2008 - 17:53:54: [shptool.amxx] write_byte(3)   // Fog density ?
L 05/30/2008 - 17:53:54: [shptool.amxx] write_byte(59)  // Fog density ?
L 05/30/2008 - 17:53:54: [shptool.amxx] message_end()

So, I've removed the entity creation ( need for the test before ) and I've tried this message alone. It works perfectly into a command.

3 and 59 seems to be related to the fog density. I did not figure out how it works exactly. 0.001 give -125 and 58, for example.
__________________

Last edited by Arkshine; 05-30-2008 at 12:08.
Arkshine is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 05-30-2008 , 14:35   Re: message_begin() fog message_end()
Reply With Quote #7

Thx. By the way. Can you send me this shptool plugin please? =)
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 05-30-2008 , 14:38   Re: message_begin() fog message_end()
Reply With Quote #8

Quote:
Originally Posted by MPNumB View Post
Thx. By the way. Can you send me this shptool plugin please? =)
http://forums.space-headed.net/viewtopic.php?p=490#490
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-30-2008 , 14:43   Re: message_begin() fog message_end()
Reply With Quote #9

Quote:
Originally Posted by MPNumB View Post
Thx. By the way. Can you send me this shptool plugin please? =)

Would be nice if you can test deeply because I've tried to change 'Start Distance' or 'End Distance', and I've seen no changes... Weird.

Could be useful to fully understand this message.
__________________
Arkshine is offline
sbeaman
Junior Member
Join Date: Apr 2004
Old 05-04-2009 , 14:35   Re: message_begin() fog message_end()
Reply With Quote #10

I think there is an error in the message description. It does not make sense that end_distance is smaller than start_distance. Also fog densities do not appear anywhere in the SDK (so why would they suddenly appear in a message). Finally Fog end_distances need to be able to grow beyond 255. Because of this I think the last 4 entries are actually shorts. So the fog message looks like:

MESSAGE_BEGIN();
WRITE_BYTE(60); // Red
WRITE_BYTE(60); // Green
WRITE_BYTE(60); // Blue
WRITE_SHORT(0x126f); // Start distance
WRITE_SHORT(0x3b03); // End distance
MESSAGE_END();

I have tested this and it appears to work. Reducing the start distance makes the fog start sooner. If you want to look at it in byte form then:

message_begin()
write_byte(60) // red
write_byte(60) // green
write_byte(60) // blue
write_byte(111) // Start distance (Low Byte)
write_byte( 18 ) // Start distance (High Byte)
write_byte(3) // End Distance (Low Byte)
write_byte(59) // End Distance (High Byte)
message_end();
sbeaman is offline
Reply



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 21:06.


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