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

LargeTE_SetupBeamRingPoint rings invisible for some positions. [enginebbug?!]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 11-20-2017 , 12:07   LargeTE_SetupBeamRingPoint rings invisible for some positions. [enginebbug?!]
Reply With Quote #1

I like to spawn some kind of lightning ring in a CS:GO game.
Just like this:


I was already searching for the solution the last to days with google and especially in this forum. I've found the function TE_SetupBeamRingPoint.

But my code is not working. All I see is some kind of flickering, dark shadow or mostly nothing.

Does anybody know what I am doing wrong?

Code:
#include <sdktools>
#include <sdkhooks>

#define VMT_LASERBEAM "materials/sprites/laserbeam.vmt"
#define VMT_HALO "materials/sprites/halo.vmt"

new g_iLaser;
new g_iHalo;

public OnPluginStart()
{
    PrepareMaterialsAndModels();
    RegConsoleCmd("sm_ring", Command_Arena, "Spawns a ring");
}
    
PrepareMaterialsAndModels()
{
	g_iLaser = PrecacheModel(VMT_LASERBEAM);
	g_iHalo = PrecacheModel(VMT_HALO);
}

public Action:Command_Arena(clientIndex, args)
{
    new Float:g_fArenaRadius=200.0;
    new Float:fPos[3];
    GetClientAbsOrigin(clientIndex, fPos);
    fPos[2] += 8;
    TE_SetupBeamRingPoint(fPos, g_fArenaRadius, g_fArenaRadius+0.5, g_iLaser, g_iHalo, 0, 10, 20.0, 5.0, 0.0, {255, 100, 0, 255}, 1, 0);
    TE_SendToAll();
    return Plugin_Handled;
}

Last edited by fragnichtnach; 12-08-2017 at 01:31. Reason: changed title to the remaining problem/bug
fragnichtnach is offline
andi67
Veteran Member
Join Date: Mar 2007
Location: Somewhere near you!!!
Old 11-20-2017 , 23:58   Re: [CS:GO] How to spawn a ring in the air?
Reply With Quote #2

Precache the models/materials OnMapStart.....
__________________
Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
>>You need Models for DODS/CSS/CSGO , than click here!!!<<
andi67 is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-21-2017 , 01:35   Re: [CS:GO] How to spawn a ring in the air?
Reply With Quote #3

Some ways to do, i dont test any.

PHP Code:
#include <sourcemod>
#include <sdktools>

#define VMT_LASERBEAM "materials/sprites/laserbeam.vmt"
#define VMT_HALO "materials/sprites/halo.vmt"

new g_iLaser;
new 
g_iHalo;

public 
OnMapStart()
{
    
g_iLaser PrecacheModel(VMT_LASERBEAM);
    
g_iHalo PrecacheModel(VMT_HALO);
}

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_ring"Command_Arena"Spawns a ring");
}

public 
Action:Command_Arena(clientIndexargs)
{
    new 
Float:g_fArenaRadius=200.0;
    new 
Float:fPos[3];
    
GetClientAbsOrigin(clientIndexfPos);
    
fPos[2] += 8;
    
TE_SetupBeamRingPoint(fPosg_fArenaRadiusg_fArenaRadius+0.5g_iLaserg_iHalo01020.05.00.0, {2551000255}, 10);
    
TE_SendToAll();
    return 
Plugin_Handled;

PHP Code:
#include <sourcemod>
#include <sdktools>

new g_iLaser;
new 
g_iHalo;

public 
OnMapStart()
{
    
g_iLaser PrecacheModel("materials/sprites/laserbeam.vmt");
    
g_iHalo PrecacheModel("materials/sprites/halo.vmt");
}

public 
OnPluginStart()
{
    
RegConsoleCmd("sm_ring"Command_Arena"Spawns a ring");
}

public 
Action:Command_Arena(clientIndexargs)
{
    new 
Float:g_fArenaRadius=200.0;
    new 
Float:fPos[3];
    
GetClientAbsOrigin(clientIndexfPos);
    
fPos[2] += 8;
    
TE_SetupBeamRingPoint(fPosg_fArenaRadiusg_fArenaRadius+0.5g_iLaserg_iHalo01020.05.00.0, {2551000255}, 10);
    
TE_SendToAll();
    return 
Plugin_Handled;

New API Syntax, i prefer, beatilful and clean

PHP Code:
#include <sourcemod>
#include <sdktools>

int SPRITE[2];

#define laser 0 
#define halo 1

public void OnMapStart(){
    
SPRITE[laser] = PrecacheModel("materials/sprites/laserbeam.vmt");
    
SPRITE[halo] = PrecacheModel("materials/sprites/halo.vmt");
}

public 
void OnPluginStart(){
    
RegConsoleCmd("sm_ring"Command_Arena"Spawns a ring");
}

public 
Action Command_Arena(int clientint args){
    
float Radius 200.0Pos[3];

    
GetClientAbsOrigin(clientPos);
    
Pos[2] += 8;

    
TE_SetupBeamRingPoint(PosRadiusRadius+0.5SPRITE[laser], SPRITE[halo], 01020.05.00.0, {2551000255}, 10);
    
TE_SendToAll();

    return 
Plugin_Handled;

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 11-21-2017 , 07:45   Re: [CS:GO] How to spawn a ring in the air?
Reply With Quote #4

Quote:
Originally Posted by andi67 View Post
Precache the models/materials OnMapStart.....
Just tested this and it worked with my code!

Thank you both for the answer!
fragnichtnach is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-21-2017 , 10:59   Re: [CS:GO] How to spawn a ring in the air?
Reply With Quote #5

Quote:
Originally Posted by fragnichtnach View Post
Just tested this and it worked with my code!

Thank you both for the answer!
Ok, but clean your code, you include SDKHOOKS for?

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM
rodrigo286 is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 11-21-2017 , 11:08   Re: [CS:GO] How to spawn a ring in the air?
Reply With Quote #6

Still having some problems:
Large rings are not drawn or invisible.

Rings that are near the size that can still be drawn are visible for some positions but not visible for other positions close beside.

1st: Visible:

2nd: Just moved one or two steps and it became invisible:

3rd: Again just some steps and back visible:

4th: Again just some steps and back invisible:



Quote:
Originally Posted by rodrigo286 View Post
New API Syntax, i prefer, beatilful and clean
This is the Code I am using:
Code:
#include <sourcemod>
#include <sdktools>

#define VMT_LASERBEAM "materials/sprites/laserbeam.vmt"
#define VMT_HALO "materials/sprites/halo.vmt"

int g_iLaser;
int g_iHalo;

public void OnPluginStart()
{
    RegConsoleCmd("sm_ring", Command_Arena, "Spawns a ring");
}

public OnMapStart() 
{
    PrepareMaterialsAndModels();
}
PrepareMaterialsAndModels()
{
	g_iLaser = PrecacheModel(VMT_LASERBEAM);
	g_iHalo = PrecacheModel(VMT_HALO);
}

public Action:Command_Arena(int clientIndex, int args)
{
    float g_fArenaRadius=200.0;
    float fPos[3];
    GetClientAbsOrigin(clientIndex, fPos);
    fPos[2] += 20;
    
    char argument[128];
    GetCmdArg(1, argument, sizeof(argument));
    g_fArenaRadius=StringToFloat(argument);
    GetCmdArg(2, argument, sizeof(argument));
    int Speed=StringToInt(argument);    
    int StartFrame=0;
    int FrameRate=10;
    float Amplitude=0.0;
    float LifeTime=30.0;
    float Width= 5.0;
    int Flags = 0;
    TE_SetupBeamRingPoint(fPos, g_fArenaRadius, g_fArenaRadius+0.5, g_iLaser, g_iHalo, StartFrame, FrameRate, LifeTime, Width, Amplitude, {255, 100, 0, 255}, Speed, Flags);
    TE_SendToAll();
    return Plugin_Handled;
}
fragnichtnach is offline
rodrigo286
Veteran Member
Join Date: Sep 2010
Location: Brazil, São Paulo
Old 11-21-2017 , 12:30   Re: [CS:GO] How to spawn a ring in the air?
Reply With Quote #7

This code create one Beam Ring, if you want it to continous effect, use CreateTimer to repeat Beam Rings.

https://sm.alliedmods.net/new-api/timers/CreateTimer

Regards.
__________________
My Plugins | VIEW HERE | I accept private requests, send me a PM.
Buy respawn | Uber Recall | Grenade drop | Damage Supperssor
Meet the Medic | Disguise Expert | Crazy Jet

CZSBrasil TEAM

Last edited by rodrigo286; 11-21-2017 at 12:33.
rodrigo286 is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 11-21-2017 , 14:15   Re: [CS:GO] How to spawn a ring in the air?
Reply With Quote #8

Quote:
Originally Posted by rodrigo286 View Post
This code create one Beam Ring, if you want it to continous effect, use CreateTimer to repeat Beam Rings.

https://sm.alliedmods.net/new-api/timers/CreateTimer

Regards.
This is not the problem.

Large rings with a radius higher than something around 3500 are not displayed!
Medium rings with a radius of sth. around 2500 are displayed from some positions, but form other postions not.
Small rings are displayed the whole 30.0 sec lifetime.

I really cannot explain this... and have no clue how to fix this. Just look the screenshots above...
fragnichtnach is offline
8guawong
AlliedModders Donor
Join Date: Dec 2013
Location: BlackMarke7
Old 11-21-2017 , 19:25   Re: [CS:GO] How to spawn a ring in the air?
Reply With Quote #9

Because the radius is too big so you can't see the ring.....
Rings are outside the map probably
__________________

Last edited by 8guawong; 11-21-2017 at 19:26.
8guawong is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 11-22-2017 , 02:47   Re: [CS:GO] How to spawn a ring in the air?
Reply With Quote #10

The ring is not outside the map! The ring is just invisible for some viewer positions.

It is hard to believe... so I will open my test server with this plugin later (and than post again).

Last edited by fragnichtnach; 11-22-2017 at 02:47.
fragnichtnach 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 02:36.


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