Raised This Month: $ Target: $400
 0% 

Solved TE_WORLDDECAL blood ? btw (win | linux )


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-27-2017 , 11:53   TE_WORLDDECAL blood ? btw (win | linux )
Reply With Quote #1

Hi !
i have problem in this MSG (TE_WORLDDECAL) when i hook it in FM_EmitSound.. i get the msg in windows when i tested it but in linux i see numbers ?
PHP Code:
                new aim[3], position[3];
                
get_user_origin(entityaim3); get_user_origin(entityposition0)
                if(
get_distance(aimposition) < 50)
                {
                    
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
                    
write_byte(TE_WORLDDECAL)
                    
write_coord(aim[0])
                    
write_coord(aim[1])
                    
write_coord(aim[2])
                    
write_byte(random_num(2740))
                    
//write_byte(g_Blood_Decal_Wad[random_num(0, sizeof g_Blood_Decal_Wad -1)])
                    
message_end()
                }
                return 
FMRES_SUPERCEDE
1) in windwos
2) in linux
Attached Images
File Type: jpg win.JPG (14.9 KB, 189 views)
File Type: jpg linux.JPG (14.7 KB, 179 views)
__________________

Last edited by abdobiskra; 01-28-2017 at 10:39.
abdobiskra is offline
Send a message via Skype™ to abdobiskra
SpannerSpammer
Member
Join Date: Mar 2006
Old 01-28-2017 , 01:03   Re: TE_WORLDDECAL blood ? btw (win | linux )
Reply With Quote #2

It could be a corrupt decals.wad file on the Linux server OR
the Linux server precaches the WAD files in a different order from
the windows one, which will screw up the decal index order.

Try this, change ->
Code:
write_byte(random_num(27, 40))
To ->
Code:
write_byte( get_decal_index( "{247" ) )
This is the first decal in the file. If you don't see the same
decal on the Linux server, then the file is corrupt.


You shouldn't be using hardcoded values for your indexes anyway.
Use an array of the actual decal names ( {blood1 ... {blood8 etc.)
then choose a random name and use get_decal_index( ) to
lookup the proper index to plug into your code.
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf
SpannerSpammer is offline
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-28-2017 , 09:19   Re: TE_WORLDDECAL blood ? btw (win | linux )
Reply With Quote #3

Thx for rply how i can make random string ?

this all msg what i need :
PHP Code:
/*new g_Blood_Decal_Wad[14][] = {
    
    "{blood1", 
    "{blood2", 
    "{blood3", 
    "{blood4", 
    "{blood5", 
    "{blood6", 
    "{blood7", 
    "{blood8", 
    "{bloodhand1", 
    "{bloodhand2", 
    "{bloodhand3", 
    "{bloodhand4", 
    "{bloodhand5", 
    "{bloodhand6"
}*/ 
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 01-28-2017 , 10:09   Re: TE_WORLDDECAL blood ? btw (win | linux )
Reply With Quote #4

Just create an array of integers and cache decal indeces on plugin_cfg.

Code:
new g_decal_index[14]

public plugin_cfg()
{
     for (new i = 0; i < sizeof g_Blood_Decal_Wad; i++)
     {
           g_decal_index[i] = get_decal_index(g_Blood_Decal_Wad[i]) // engfunc(EngFunc_DecalIndex also works...
     }
}

...

write_byte(g_decal_index[random_num(0, sizeof g_decal_index-1)])
__________________


Last edited by NiHiLaNTh; 01-28-2017 at 10:10.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
abdobiskra
Veteran Member
Join Date: Jul 2014
Location: Algeria
Old 01-28-2017 , 10:39   Re: TE_WORLDDECAL blood ? btw (win | linux )
Reply With Quote #5

thx gold guys
the idea has become clear now
solved.
__________________
abdobiskra is offline
Send a message via Skype™ to abdobiskra
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 20:45.


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