Raised This Month: $32 Target: $400
 8% 

How does TE_LIGHTNING work?!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-22-2018 , 18:44   How does TE_LIGHTNING work?!
Reply With Quote #1

I tried many parameters, tried searching everywhere, but I didn't manage to get this thing to work.

PHP Code:
message_begin(MSG_ALLSVC_TEMPENTITY)
write_byte(TE_LIGHTNING);
write_coord(pos1[0]);
write_coord(pos1[1]);
write_coord(pos1[2]);
write_coord(pos2[0]);
write_coord(pos2[1]);
write_coord(pos2[2]);
write_byte(10);
write_byte(10);
write_byte(2);
write_short(beam); // "sprites/laserbeam.spr"
message_end(); 
Nothing happens when I execute this code. Tested both on 1.8.2 and latest 1.8.3 dev build.
pos1 and pos2 are working correctly, tested it with TE_BEAMPOINTS.
__________________

Last edited by OciXCrom; 08-22-2018 at 18:49.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-22-2018 , 19:11   Re: How does TE_LIGHTNING work?!
Reply With Quote #2

Im not sure if i saw this message functioning

But here try this for lightning.

PHP Code:
    engfunc(EngFunc_MessageBeginMSG_BROADCASTSVC_TEMPENTITY, {0.00.00.0}, 0)
    
write_byte(0
    
engfunc(EngFunc_WriteCoordtfOrigin[0]) // Start
    
engfunc(EngFunc_WriteCoordtfOrigin[1])
    
engfunc(EngFunc_WriteCoordtfOrigin[2])
    
engfunc(EngFunc_WriteCoordfOrigin[0]) // End
    
engfunc(EngFunc_WriteCoordfOrigin[1])
    
engfunc(EngFunc_WriteCoordfOrigin[2])
    
write_short(g_lightning_sprite"sprites/lgtning.spr"
    
write_byte(1// framestart 
    
write_byte(10// framerate 
    
write_byte(30// life 
    
write_byte(100// width 
    
write_byte(100// noise 
    
write_byte(200// r, g, b 
    
write_byte(200// r, g, b 
    
write_byte(200// r, g, b 
    
write_byte(200// brightness 
    
write_byte(50//  
    
message_end() 
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-22-2018 at 19:12.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-22-2018 , 19:29   Re: How does TE_LIGHTNING work?!
Reply With Quote #3

I know how I can do it with other TE_ types. I need to know how TE_LIGHTNING specifically works if it even works. I don't need this for a plugin.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-23-2018 , 05:54   Re: How does TE_LIGHTNING work?!
Reply With Quote #4

https://wiki.alliedmods.net/Temp_Ent..._(Half-Life_1)
or here:
https://github.com/ValveSoftware/hal...n/const.h#L180
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 08-23-2018 at 05:57.
Ghosted is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-23-2018 , 06:47   Re: How does TE_LIGHTNING work?!
Reply With Quote #5

Where do you think I got the things in the first post from? I did it exactly as described in both links and it's not working.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-23-2018 , 07:25   Re: How does TE_LIGHTNING work?!
Reply With Quote #6

Actually i've tested and its working but it invisible, cause when i spawned many beams together and was looking them my fps was dropping down.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-23-2018 , 07:37   Re: How does TE_LIGHTNING work?!
Reply With Quote #7

Quote:
Originally Posted by OciXCrom View Post
I know how I can do it with other TE_ types. I need to know how TE_LIGHTNING specifically works if it even works. I don't need this for a plugin.
Code:

Try the following format i moved sprite model index to 7th param instead of the last.

/**
 *TE_LIGHTNING is TE_BEAMPOINTS with simplified parameters
 *
 * @note
 * write_byte(TE_LIGHTNING)
 * write_coord(startposition.x)
 * write_coord(startposition.y)
 * write_coord(startposition.z)
 * write_coord(endposition.x)
 * write_coord(endposition.y)
 * write_coord(endposition.z)
 * write_short(sprite model index)
 * write_byte(life in 0.1's)
 * write_byte(width in 0.1's)
 * write_byte(amplitude in 0.01's)
 */
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 08-23-2018 at 07:38.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 08-23-2018 , 07:39   Re: How does TE_LIGHTNING work?!
Reply With Quote #8

I just noticed that if TE_BEAMPOINTS is executed, then TE_LIGHTNING will work using the colors previously set with TE_BEAMPOINTS.

This is definitely a bug or wrong documentation. @Arkshine?

@Natsheh - that didn't work either.

Tried using the same parameters as TE_BEAMPOINTS - no effect also.
__________________

Last edited by OciXCrom; 08-23-2018 at 07:42.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-23-2018 , 07:42   Re: How does TE_LIGHTNING work?!
Reply With Quote #9

It's up to the engine, not AMXX.

But anyway the code that uses TE_LIGHTNING can only be found in one spot in HLSDK and it's commented out in favor of TE_BEAMPOINTS, so maybe it never worked.
__________________
klippy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-23-2018 , 08:07   Re: How does TE_LIGHTNING work?!
Reply With Quote #10

Quote:
Originally Posted by KliPPy View Post
It's up to the engine, not AMXX.

But anyway the code that uses TE_LIGHTNING can only be found in one spot in HLSDK and it's commented out in favor of TE_BEAMPOINTS, so maybe it never worked.


Here found a usable in the hlsdk/effects.cpp


PHP Code:

void CLightning
::Zap( const Vector &vecSrc, const Vector &vecDest )
{
#if 1
    
MESSAGE_BEGINMSG_BROADCASTSVC_TEMPENTITY );
        
WRITE_BYTETE_BEAMPOINTS);
        
WRITE_COORD(vecSrc.x);
        
WRITE_COORD(vecSrc.y);
        
WRITE_COORD(vecSrc.z);
        
WRITE_COORD(vecDest.x);
        
WRITE_COORD(vecDest.y);
        
WRITE_COORD(vecDest.z);
        
WRITE_SHORTm_spriteTexture );
        
WRITE_BYTEm_frameStart ); // framestart
        
WRITE_BYTE( (int)pev->framerate); // framerate
        
WRITE_BYTE( (int)(m_life*10.0) ); // life
        
WRITE_BYTEm_boltWidth );  // width
        
WRITE_BYTEm_noiseAmplitude );   // noise
        
WRITE_BYTE( (int)pev->rendercolor.);   // r, g, b
        
WRITE_BYTE( (int)pev->rendercolor.);   // r, g, b
        
WRITE_BYTE( (int)pev->rendercolor.);   // r, g, b
        
WRITE_BYTE( (int)pev->renderamt );    // brightness
        
WRITE_BYTEm_speed );        // speed
    
MESSAGE_END();
#else
    
MESSAGE_BEGINMSG_BROADCASTSVC_TEMPENTITY );
        
WRITE_BYTE(TE_LIGHTNING);
        
WRITE_COORD(vecSrc.x);
        
WRITE_COORD(vecSrc.y);
        
WRITE_COORD(vecSrc.z);
        
WRITE_COORD(vecDest.x);
        
WRITE_COORD(vecDest.y);
        
WRITE_COORD(vecDest.z);
        
WRITE_BYTE(10);
        
WRITE_BYTE(50);
        
WRITE_BYTE(40);
        
WRITE_SHORT(m_spriteTexture);
    
MESSAGE_END();
#endif
    
DoSparksvecSrcvecDest );

__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 14:49.


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