I consulted Yamato's[Tutorial] Lines and want to draw a line in cod6 but failed.
I can't find out the problem. So I'm here to ask for some help
Here is my modified _tutorial.gsc (from Yamato's[Tutorial]Building your first mod and making your first code)
I put my full test mod in attachment.
I also have downloaded _painter.gsc and put it in common_scripts folder.
In games_mp.log , I can see the log printed, such as:
566:07 start: (335.125, 683.625, -68.7797)(0, 0, 10)
566:07 end: (335.125, 683.625, -68.7797)(-4977.45, -474.34, -0)
But I cannot see the line in the game map. Help me please.
Or someone can make me a simple mod to show how to draw a line?
I can't find out the problem. So I'm here to ask for some help
Here is my modified _tutorial.gsc (from Yamato's[Tutorial]Building your first mod and making your first code)
I put my full test mod in attachment.
Code:
#include maps\mp\gametypes\_hud_util;
#include maps\mp\_utility;
#include common_scripts\utility;
#include common_scripts\_painter;
init()
{
level thread onPlayerConnect();
}
onPlayerConnect()
{
for( ; ; )
{
level waittill( "connected", player );
player thread onPlayerSpawned();
}
}
onPlayerSpawned()
{
self endon( "disconnect" );
for( ; ; )
{
self waittill( "spawned_player" );
self setClientDvars( "developer", 1, "developer_script", 1 );
self thread Lines();
}
}
Lines()
{
self endon( "death" );
self endon( "disconnect" );
while( 1 )
{
logPrint("start: " + self.origin + ( 0, 0, 10 ) + "\n");
logPrint("end: " + self.origin + anglestoforward( self.angles ) * 5000 + "\n");
line( self.origin + ( 0, 0, 10 ), self.origin + anglestoforward( self.angles ) * 5000, ( randomfloat( 1 ), randomfloat( 1 ), randomfloat( 1 ) ) );
wait 0.05;
}
}
I also have downloaded _painter.gsc and put it in common_scripts folder.
In games_mp.log , I can see the log printed, such as:
566:07 start: (335.125, 683.625, -68.7797)(0, 0, 10)
566:07 end: (335.125, 683.625, -68.7797)(-4977.45, -474.34, -0)
But I cannot see the line in the game map. Help me please.
Or someone can make me a simple mod to show how to draw a line?