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

How does TE_LIGHTNING work?!


Post New Thread Reply   
 
Thread Tools Display Modes
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-23-2018 , 08:09   Re: How does TE_LIGHTNING work?!
Reply With Quote #11

Quote:
Originally Posted by Natsheh View Post
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)
 */
That wont work cause this is valid sort of message bytes, i dont know how much xash3d engine differs from original one but this msg should be same.
__________________

[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 08:10.
Ghosted is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 08-23-2018 , 08:14   Re: How does TE_LIGHTNING work?!
Reply With Quote #12

Quote:
Originally Posted by Natsheh View Post
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 );

That is what I was talking about and, as you can see, it's not used (it's not being compiled at all).
__________________
klippy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-23-2018 , 08:18   Re: How does TE_LIGHTNING work?!
Reply With Quote #13

Quote:
Originally Posted by KliPPy View Post
That is what I was talking about and, as you can see, it's not used (it's not being compiled at all).
Yes it doesnt make sense at all why its not been used(commented out) unless its out of date.
__________________
@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 08:19.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-12-2019 , 04:33   Re: How does TE_LIGHTNING work?!
Reply With Quote #14

Quote:
Originally Posted by OciXCrom View Post
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.
The first 3 coordinates are starting position and next 3 are ending position. When start and finish vector is 0 you see nothing because entire bolt is in 1 pin point. It needs room to expand.


Code:
#define TE_LIGHTNING 7          // TE_BEAMPOINTS with simplified parameters new Dector[3]; get_user_origin(id,Dector,1); message_begin(0,23); write_byte(TE_LIGHTNING) write_coord(Dector[0]-10)       // start position write_coord(Dector[1]-10) write_coord(Dector[2]*150) write_coord(Dector[0]+500)      // end position write_coord(Dector[1]+1000) write_coord(Dector[2]+6000) write_byte(1000)        // life in 0.1's write_byte(1000)        // width in 0.1's write_byte(700) // amplitude in 0.01's write_short(g_fire)     // sprite model index message_end()

Pix with precache_model("sprites/lgtning.spr");





The snapshots only show 1 line. There are actually many when you witness it first hand.
Attached Images
File Type: jpg te_lightning.jpg (94.3 KB, 299 views)
File Type: jpg farmland20000.jpg (95.4 KB, 174 views)
File Type: jpg farmland20001.jpg (94.1 KB, 181 views)
__________________

Last edited by DJEarthQuake; 05-13-2019 at 14:48. Reason: more pix
DJEarthQuake 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 10:08.


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