Results 1 to 8 of 8

Thread: Spawnable Triggers

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by IzNoGoD View Post
    1. You are using an implementation that emulates a trigger_radius, yet your screenshot shows a cube-like area, shouldnt it be a spherical area?
    2. Why not use distancesquared instead, this saves you a squareroot operation per frame per player, and squareroot operations are VERY expensive
    1. As you rightly say, I am EMULATING a trigger radius. Hence it can be square, rectangle, oblong, or bannana shaped, it doesn't matter. As long as the functionality is the same, it doesn't matter what shape it is.

    2. distanceSquared is not a built-in function in COD1, and I didn't emulate it or distance2d() (which I actually have in my utility files) because you actually need the height check in CTF as you move the trigger below the trigger radius in order to stop it triggering (cf. maps\mp\_utility::triggerOff()).

    For the record, and so I don't have to keep saying it, this is a list of things which AREN'T in COD1:

    no file functions. You cannot write to a file in any manner other than a log file. The only file formats you can read from are .GSC and .CFG;
    no including files (i.e. #include <directory><filename>), you have to either manually thread to them, or build function pointers;
    no trigger_radius;
    no isSubStr();
    no getSubStr();
    no strTok();
    no openscriptmenu command;
    no updated menu language at all, just pure Quake 3 functions and syntax;
    no closeingamemenu();
    no playerADS();
    only 2 channels for sound, so when you have 2 sounds playing simultaneously, if you play a 3rd, the sound of 1 of the others cuts out (the Quake 3 Team Arena engine natively has only 1 sound thread. It took other companies to implement sound functions such as 5.1 and EAX)
    no getTagOrigin();
    you cannot color light in COD1. It is just yellow, and the only way to color it is pass yellow light through a colored shader. In the COD2 engine, you can manipulate light directly, using 6 different parameters.
    no physicstrace();
    no fragbuttonpressed();
    no GetOffhandSecondaryClass() (because grenades go into their own weapon slots - the slots are "primary", "primaryb", "pistol", "grenade", "smokegrenade". You can put a grenade in the pistol slot and it will work, and vice versa, as long as you change the slot name);
    no "cg_fovscale" dvar;
    no "cg_fovmin" dvar (so you can't zoom in with a sniper scope like you can in COD2/COD4);
    no getPlayerAngles();

    That list is by no means exhaustive. It is just the things I have come across while building my current mod for COD1. the engine is seriously limited. I have reproduced the basic functions we all take for granted because I needed them, but there are things I want but can't have because they have to be built into the engine. Here are some of the basics I have built:

    Code:
    strTok( string, token )
    {
    	j = 0;
    	temparr[j] = "";	
    
    	for( i = 0; i < string.size; i++ )
    	{
    		if( string[i] == token )
    		{
    			j++;
    			temparr[j] = "";
    		}
    		else
    			temparr[j] += string[i];
    	}
    	
    	return( temparr );
    }
    
    getSubStr( string, start, end )
    {
    	temp = "";
    	count = 0;
    	if( start > 0 )
    	{
    		for( i=start; i < string.size; i++ )
    		{	
    			if( isDefined( end ) && count >= end )
    				break;
    
    			temp = temp + string[i];
    			count++;
    		}
    	}
    	else
    	{
    		for( i=0; i < string.size; i++ )
    		{
    			if( isDefined( end ) && i >= end )
    				break;
    				
    			temp = temp + string[i];
    		}
    	}
    	
    	return( temp );
    }
    
    isSubStr( str1, str2 )
    {
    	// compare string1 with string2
    	for( i=0; i < str2.size - str1.size; i++ )
    	{
    		temp = "";
    		for( j=0; j < str1.size; j++ )
    		{
    			temp = temp + str2[ i + j ];
    		}
    
    	   if( str1 == temp )
    		  return( true );
    	}
    
    	// if 1st comparision fails compare string2 with string1
    	for( i=0; i < str1.size - str2.size; i++ )
    	{
    		temp = "";
    		for( j=0; j < str2.size; j++ )
    		{
    			temp = temp + str1[ i + j ];
    		}
    
    	   if( str2 == temp )
    		  return( true );
    	}
    	
    	// all comparisons failed
    	return( false );
    }
    
    distance2d( a, b )
    {
    	return( distance( (a[0],a[1],0), (b[0],b[1],0) ) );
    }
    Last edited by Tally; 5th December 2014 at 09:17.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •