AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   env_beam didnīt recognize endpoint.... (https://forums.alliedmods.net/showthread.php?t=321171)

andi67 01-28-2020 08:16

env_beam didnīt recognize endpoint....
 
PHP Code:

    for (int i 1<= 12i++)
    {
        
// read the vector from your config file...
        
Format(Positionsizeof(Position), "Position%i"i);
        
KvJumpToKey(kvNewPositiontrue);    
        
KvGetVector(kvNewNULL_STRINGvecs);            
        
KvRewind(kvNew);            

        
        
int flame CreateEntityByName("env_steam");        
        
char startName[32];
        
Format(startNamesizeof(startName), "start_%s"flame);
        
DispatchKeyValue(flame"targetname"startName);
        
DispatchKeyValue(flame,"SpawnFlags""1");
        
DispatchKeyValue(flame,"Type""0");
        
DispatchKeyValue(flame,"InitialState""1");
        
DispatchKeyValue(flame,"Spreadspeed""10");
        
DispatchKeyValue(flame,"Speed""30");
        
DispatchKeyValue(flame,"Startsize""1");
        
DispatchKeyValue(flame,"EndSize""5");
        
DispatchKeyValue(flame,"Rate""15");
        
DispatchKeyValue(flame,"JetLength""300");
        
DispatchKeyValue(flame,"RenderColor""0 255 80");
        
DispatchKeyValue(flame,"RenderAmt""50");
        
DispatchKeyValue(flame,"Angles""270 0 0");            
        
DispatchSpawn(flame);
        if(
i== 1)
        {
            
PrintToChatAll("Vector: %f : %f : %f"vecs[0], vecs[1], vecs[2]);
            
TeleportEntity(flamevecsNULL_VECTORNULL_VECTOR);
            
AcceptEntityInput(flame"TurnOn");    
        }
        
        
int flame2 CreateEntityByName("env_steam");
        
char endName[32];
        
Format(endNamesizeof(endName), "end_%s"flame2);
        
DispatchKeyValue(flame2"targetname"endName);
        
DispatchKeyValue(flame2,"SpawnFlags""1");
        
DispatchKeyValue(flame2,"Type""0");
        
DispatchKeyValue(flame2,"InitialState""1");
        
DispatchKeyValue(flame2,"Spreadspeed""10");
        
DispatchKeyValue(flame2,"Speed""30");
        
DispatchKeyValue(flame2,"Startsize""1");
        
DispatchKeyValue(flame2,"EndSize""5");
        
DispatchKeyValue(flame2,"Rate""15");
        
DispatchKeyValue(flame2,"JetLength""300");
        
DispatchKeyValue(flame2,"RenderColor""255 255 80");
        
DispatchKeyValue(flame2,"RenderAmt""50");
        
DispatchKeyValue(flame2,"Angles""270 0 0");            
        
DispatchSpawn(flame2);    
        if(
i== 2)
        {        
            
PrintToChatAll("Vector: %f : %f : %f"vecs[0], vecs[1], vecs[2]);        
            
TeleportEntity(flame2vecsNULL_VECTORNULL_VECTOR);
            
AcceptEntityInput(flame2"TurnOn");    
        }
        
        
int beam CreateEntityByName"env_beam" );
        
DispatchKeyValue(beam"texture""sprites/laserbeam.spr");
        
DispatchKeyValue(beam"renderamt""100" );
        
DispatchKeyValue(beam"rendermode""0" );
        
DispatchKeyValue(beam"rendercolor""255 255 255" );
        
DispatchKeyValue(beam"life""10" );
        
DispatchKeyValue(beam"BoltWidth""10");
        
DispatchKeyValue(beam"NoiseAmplitude""0");
        
DispatchKeyValue(beam"LightningStart"startName);
        
DispatchKeyValue(beam"LightningEnd"endName);
        
DispatchSpawn(beam);    
        
AcceptEntityInput(beam,"TurnOn");
    } 

the problem is that the beam is created 2 times(one at the first vector and one at the second vector , both end up somewhere in the map)and didnīt recognize the endpoint in this case(beam, "LightningEnd", endName);
Any Ideas?

Silvers 01-29-2020 15:17

Re: env_beam didnīt recognize endpoint....
 
PHP Code:

DispatchKeyValueVector(beam"CoordMP"vecs);
SetEntPropVector(beamProp_Send"m_vecEndPos"vecs);
SetEntPropVector(beamProp_Data,"m_hEndEntity",  vecs); 

Try any of those maybe. Im guessing it's pointing to 0,0,0 when you say "somewhere in the map"

Also, you're only teleporting env_steam when the "i" index is 1, and 2, but every other time you're creating them all without coords, eg 0,0,0 I guess. And the beam is created 12 times, not 2 lol. Fix all that and it might work as expected without the above code I put.

andi67 01-29-2020 15:49

Re: env_beam didnīt recognize endpoint....
 
Thx, well the env_steam(both) are spawned on the right position also the vecs are printed out correctly , from what i know is that this

DispatchKeyValue(beam, "LightningStart", startName);
DispatchKeyValue(beam, "LightningEnd", endName);

should set the startentity i DispatchKeyValue(beam, "LightningStart", startName); and the endentity DispatchKeyValue(beam, "LightningEnd", endName);

Iīm gonna try your sugesstions out.....thx

Kco 09-21-2020 01:08

Re: env_beam didnīt recognize endpoint....
 
Quote:

Originally Posted by andi67 (Post 2682125)
Thx, well the env_steam(both) are spawned on the right position also the vecs are printed out correctly , from what i know is that this

DispatchKeyValue(beam, "LightningStart", startName);
DispatchKeyValue(beam, "LightningEnd", endName);

should set the startentity i DispatchKeyValue(beam, "LightningStart", startName); and the endentity DispatchKeyValue(beam, "LightningEnd", endName);

Iīm gonna try your sugesstions out.....thx


how could you finally solve this?


All times are GMT -4. The time now is 00:28.

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