Skip to content

Instantly share code, notes, and snippets.

//==================================================================
function getWayPointlist(%trigger)
{
%waypointlist = new arrayobject();
%probabilityMark = 0;
for (%i=0;%i<8;%i++)
{
if (isObject(%trigger.waypoint[%i]))
@Azaezel
Azaezel / AIWheeledVehicleBrain.cc
Created October 11, 2017 23:05
aiwheeledvehicleBrain
#include "AIWheeledVehicleBrain.h"
#include "math/mMatrix.h"
#include "math/mPoint.h"
#include "core/realComp.h"
//TWEAKABLE constants
#define STOPSAFETY 15 //How we pad the stop distance value to make sure car can stop in time
#define TURNANGLE 0.5
#define LOSTDISTANCE 30 //When vehicle is this far treat as lost
#define MAXLOSTSPEED 20 //Max speed when lost
//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//
// DAMAGE
datablock afxDamageData(Burning_damage_CE)
{
label = "rof_dot";
flavor = "fire";
directDamage = "$$ %%._damage";
directDamageRepeats = "$$ mFloor(%%._dur)/2 + 1";
};
@Azaezel
Azaezel / sceneobject.h
Last active February 21, 2018 23:35
lod export
class SceneObject : public NetObject, private SceneContainer::Link, public ProcessObject
{...
public:
virtual S32 getNumDetails() { return -1; };
...}
Severity Code Description Project File Line Suppression State
Warning C4005 'DXGI_STATUS_OCCLUDED': macro redefinition (compiling source file <root>\source\platformWin32\videoInfo\wmiVideoInfo.cpp) Full c:\program files (x86)\microsoft directx sdk (june 2010)\include\dxgitype.h 12
Warning C4005 'DXGI_STATUS_CLIPPED': macro redefinition (compiling source file <root>\source\platformWin32\videoInfo\wmiVideoInfo.cpp) Full c:\program files (x86)\microsoft directx sdk (june 2010)\include\dxgitype.h 13
Warning C4005 'DXGI_STATUS_NO_REDIRECTION': macro redefinition (compiling source file <root>\source\platformWin32\videoInfo\wmiVideoInfo.cpp) Full c:\program files (x86)\microsoft directx sdk (june 2010)\include\dxgitype.h 14
Warning C4005 'DXGI_STATUS_NO_DESKTOP_ACCESS': macro redefinition (compiling source file <root>\source\platformWin32\videoInfo\wmiVideoInfo.cpp) Full c:\program files (x86)\microsoft directx sdk (june 2010)\include\dxgitype.h 15
Warning C4005 'DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE': macro
function clientCmdupdateBotCounts(%list)
{
//clear old entries
for (%i=1;%i<4;%i++)
{
%entry = blast_t @ %i;
%entry.setVisible(false);
%entry = melee_t @ %i;
%entry.setVisible(false);
DefineConsoleFunction(ColorMulBeatDown, ColorI, (U32 i), ,
"color multiplication test")
{
ColorI color(255,255,255,255);
//order of ops test
color = (LinearColorF(color) * i / 256).toColorI();
Con::printf("test1: %f, result:%i,%i,%i,%i", (i / 256), color.red, color.green, color.blue, color.alpha);
color = ColorI(255, 255, 255, 255);
DefineConsoleFunction(ColorMulBeatDown, void, (), ,
"color multiplication test")
{
for (F32 step = 0.0f; step < 1.0f; step += 0.00390625)
{
ColorI color = ColorI::ONE;
LinearColorF linRes = (LinearColorF(color) * step);
color = linRes.toColorI();
ColorI stayLinear = linRes.toColorI(true);
//MainMenuAppLogo.bleh();
function SimObject::bleh(%this)
{
echo("hi");
%this.dump();
%this.schedule(1000,"bleh",%this);
schedule(100,0,"SimObject::bleh",%this);
%this.delete();
}
//--------------------------------------------------------------------------
F32 Projectile::getUpdatePriority(CameraScopeQuery *camInfo, U32 updateMask, S32 updateSkips)
{
F32 ret = Parent::getUpdatePriority(camInfo, updateMask, updateSkips);
ret++; <<------------------------------------------------------------------------ massively up relative priority. bullets hurt
// if the camera "owns" this object, it should have a slightly higher priority
if(mSourceObject == camInfo->camera)
return ret + 0.2;
return ret;