Post: How to draw a line in cod6 map
08-19-2014, 01:45 PM #1
Default Avatar
xinghun
Guest
(adsbygoogle = window.adsbygoogle || []).push({}); I consulted Yamato'sYou must login or register to view this content. 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'sYou must login or register to view this content.)

    #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?
(adsbygoogle = window.adsbygoogle || []).push({});
08-19-2014, 01:48 PM #2
Originally posted by xinghun View Post
I consulted Yamato'sYou must login or register to view this content. 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'sYou must login or register to view this content.)

    #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?


Wow, I haven't seen GSC in a while. But yeah people probably wouldn't know what to do with this stuff. Thanks though.

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo