AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] beam entity. (https://forums.alliedmods.net/showthread.php?t=311834)

abdobiskra 11-04-2018 08:47

[Help] beam entity.
 
Hi, I have two questions about that :
Im using this [INC] Beam Entities
1) How to set beam life timeout.


2) How to create a point beam.
What I want:
I want to creat similar like this beam in this image:

http://i.imgur.com/L962FYv.jpg

author said when i ask him about it :
Quote:

I have no source code.
As I remember, there are two sprites. 1st - beam sprite. I used default laser sprite.
2nd - glow sprite.

OciXCrom 11-04-2018 09:56

Re: [Help] beam entity.
 
Have you tried this? There's a video preview, so at least one of those functions is probably what you need.

abdobiskra 11-04-2018 11:12

Re: [Help] beam entity.
 
Thx, But Not exactly what I'm looking for.

abdobiskra 11-07-2018 13:14

Re: [Help] beam entity.
 
is there an example of an entity to change its Sprite color?
i try rendercolor but not work ?
PHP Code:

        new entity create_entity("info_target")
            
            
            
entity_set_stringentityEV_SZ_classname"dot" );
            
entity_set_model(entity"sprites/glow02.spr")
            
entity_set_size(entityFloat:{-3.0,-3.0,-3.0}, Float:{3.0,3.0,3.0} );
            
entity_set_intentityEV_INT_solidSOLID_TRIGGER );
            
            
set_pev(entitypev_scale0.22)
            
            
entity_set_int(entityEV_INT_rendermodekRenderTransAdd)
            
entity_set_int(entityEV_INT_renderfxkRenderFxNone)
            
            
entity_set_vectorentityEV_VEC_rendercolor, {25500} );
DispatchSpawn(entity


CrazY. 11-08-2018 06:22

Re: [Help] beam entity.
 
Register think in the beam entity and call remove_entity.
Start the entity as BEAM_ENTPOINT (Beam_PointEntInit). Set start pos to where you want the laser to end and set start entity in laser mine entity.

abdobiskra 11-08-2018 15:14

Re: [Help] beam entity.
 
I think I made a mistake in the sequence now that its color has changed
Now I want to know How to set beam life timeout?
i found this offset :
Quote:

float m_flBeamLength 173
I tried to minimize it but it did not work!
PHP Code:

set_pdata_float(get_pdata_cbase(entm_pBeam5), m_flBeamLength1.0 ,4// ent = tripmine 


abdobiskra 12-05-2018 06:15

Re: [Help] beam entity.
 
I dont understand why the new entity is not compatible with mine angles when i set "origin[1] -= 10.0"?

https://i.imgur.com/DtTXcw9.png

My idea to be a little far away like :

https://imgur.com/a/Ln8yJj0

My code ?

PHP Code:

        new entity create_entity("info_target")
    
        
entity_set_stringentityEV_SZ_classname"dot_glow" );
        
entity_set_model(entity"sprites/glow02.spr")
        
entity_set_intentityEV_INT_solidSOLID_TRIGGER );
        
        
set_pev(entitypev_renderfxkRenderFxNone)
        
set_pev(entitypev_rendermodekRenderTransAdd)
        
set_pev(entitypev_renderamt255.0)
        
set_pev(entitypev_rendercolorFloat:{255.00.00.0}) 
        
set_pev(entitypev_scale0.19)
            
        
//static Float:norigin[3];
        
static Float:vangles[3];

        
pev(entpev_v_anglevangles)// ent = tripmine 
        
set_pev(entitypev_v_anglevangles
        
        
origin[1] -= 10.0 // i want her to be a little far away
        
        
engfunc(EngFunc_SetOriginentityorigin);
        
        
//DispatchSpawn(entity)
            
                  // spawn beam ent
        
RelinkBeam(beamvecEndvecEndorigin);
        
        
set_pev(entTRIPMINE_FRACTION_OLDfraction); 


JocAnis 12-05-2018 08:16

Re: [Help] beam entity.
 
It depends where you put that entity on the map... If changing origin[1] didnt work there, then origin[2] Will do the job for you (cuz [3] is axis for height)... So the solution should be: detect entity's angle, and based on it - add 10. 0 units to x or y coordinate.. Sorry if i missunderstood your post

abdobiskra 12-05-2018 11:26

Re: [Help] beam entity.
 
Quote:

Originally Posted by JocAnis (Post 2626865)
So the solution should be: detect entity's angle, and based on it - add 10. 0 units to x or y coordinate.. Sorry if i missunderstood your post

Yes, here in this part :
Quote:

pev(ent, pev_v_angle, vangles)// ent = tripmine
set_pev(entity, pev_v_angle, vangles)

origin[1] -= 10.0 // i want her to be a little far away

JocAnis 12-05-2018 18:20

Re: [Help] beam entity.
 
By doing just that i dont think you would know if you need to change x or y axis.. Maybe something to do with vectors, velocity.. Idk but i would like to know too, in which way to do that


All times are GMT -4. The time now is 08:11.

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