Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 8 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 General
General game questions, comments, and chat.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Debugging
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 General
Posted: Thursday, Sep. 15, 2011 01:59 pm
I would like to know how to debug the right way (except of syntax errors)

how do 'activate' the debug-functions like:
line()
println()
print3d()

Share |
Mystic
General Member
Since: Apr 10, 2004
Posts: 6147
Last: Apr 15, 2018
[view latest posts]
Level 10
Forum Moderator
Im a fan of MODSonair
Category: CoD2 General
Posted: Thursday, Sep. 15, 2011 02:46 pm
Depends what your doing but i use print line, lets say your script is something like if a number is more than 5 do one thing, if its smaller than 5 do a different thing:

if (number => 5) {
function1();
println(number is more than 5, running function 1);
}
if (number =< 5) {
function2();
println(number is less than 5, running function 2);
}

Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 General
Posted: Thursday, Sep. 15, 2011 03:05 pm
Please switch the function() and the iprintln(), cause the code might hang in function(), and as it is not threaded, it will never iprintln.

Also, you could add an iprintln before function() and one after, so you can see if it hangs inside the function()
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 General
Posted: Thursday, Sep. 15, 2011 03:19 pm
uhm, yeah i know

but these debug-functions only work with developer enabled or something like that (or did you ever seen a line or a 3D-print in MP?)
so i need the setting for this
i tried:
Code:
	if( level.debug )
	{
		setCvar( "developer" , 1 );
		setCvar( "developer_script" , 1 );
		setCvar( "fs_debug" , 1 );
		setCvar( "com_debug" , 1 );
		setCvar( "debug_protocol" , "debug.cfg" );
		setCvar( "fs_debugBold" , 1 );
		setCvar( "cg_debugevents" , 1 );
		setCvar( "cg_debugHUDDraw" , 1 );
		setCvar( "con_debug" , 1 );
		setCvar( "debug" , 1 );
		setCvar( "ui_debug" , 1 );
	}


and nothing changed

maybe i should start tha map with /devmap mp_toujane?
lets try

EDIT:
i did it with devmap, still no visible lines there
with devmap i got some strange errors (even in stock scripts), without devmap it works perfect

i know that in meatBot-mod you are able to see lines in the waypoint-editor but i cant figure aout the settings :(
Share |
Sevenz
General Member
Since: Apr 24, 2006
Posts: 2390
Last: May 10, 2013
[view latest posts]
Level 8
Category: CoD2 General
Posted: Thursday, Sep. 15, 2011 07:34 pm
lines work, you just have to redraw them for each frame

you can wrap the draw code in a loop and add a wait 0.05;
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 General
Posted: Thursday, Sep. 15, 2011 07:36 pm
Code:
lineUntilNotified( start , end , color , depthTest , endonString , entity )
{
	if( !isDefined( entity ) )
		entity = level;

	entity endon( endonString );
	
	for( ; ; )
	{
		line( start , end , color , depthTest );
		wait( 0.05 );
	}
}

testLine()
{
	for( ; ; )
	{
		wait( 0.05 );

		line( ( 0 , 0 , -10000 ) , ( 0 , 0 , 10000 )  );
	}
}


i was flying around as spectator and cant find a line in tha map :(
i was only calling on mapstart
thread _debug::testline();

edited on Sep. 15, 2011 03:39 pm by serthy
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 General
Posted: Wednesday, Feb. 29, 2012 12:19 pm
developer 1
developer_script 1
dedicated 0

and now it works!
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 General

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»