mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
GFX card profile config file logging moved to debug only
WIP mode of guiSliderCtrl to be a filled rectangle instead of a textured UI Fixed bug with guiTextEditCtrl losing focus updating history passing malformed strings Updated WIP options menu Editor/Project settings WIP Updated editor theme to be consistent, and feed off the editor settings Updated popup menus to reference renamed profiles Added more in-progress modules for examples/stress testing
This commit is contained in:
parent
226529fd1b
commit
f1777016b8
179 changed files with 10144 additions and 415 deletions
16
Templates/Modules/AI_Guard/AI_Guard.cs
Normal file
16
Templates/Modules/AI_Guard/AI_Guard.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
function AI_Guard::onCreate(%this)
|
||||
{
|
||||
exec("./Scripts/aiPlayer.cs");
|
||||
exec("./Scripts/guardTrigger.cs");
|
||||
|
||||
if(isObject(DatablockFilesList))
|
||||
{
|
||||
DatablockFilesList.add( "data/AI_Guard/Datablocks/aiPlayerDatablocks.cs" );
|
||||
DatablockFilesList.add( "data/AI_Guard/Datablocks/aiPlayerMarker.cs" );
|
||||
}
|
||||
}
|
||||
|
||||
function AI_Guard::onDestroy(%this)
|
||||
{
|
||||
}
|
||||
|
||||
15
Templates/Modules/AI_Guard/AI_Guard.module
Normal file
15
Templates/Modules/AI_Guard/AI_Guard.module
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<ModuleDefinition
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
ModuleId="AI_Guard"
|
||||
VersionId="1"
|
||||
Group="Game"
|
||||
scriptFile="AI_Guard.cs"
|
||||
CreateFunction="onCreate"
|
||||
DestroyFunction="onDestroy">
|
||||
<DeclaredAssets
|
||||
canSave="true"
|
||||
canSaveDynamicFields="true"
|
||||
Extension="asset.taml"
|
||||
Recurse="true" />
|
||||
</ModuleDefinition>
|
||||
53
Templates/Modules/AI_Guard/Datablocks/aiPlayerDatablocks.cs
Normal file
53
Templates/Modules/AI_Guard/Datablocks/aiPlayerDatablocks.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
// aiPlayerDatablocks.cs
|
||||
// breaks out the datablocks for aiguard.cs to make them easier to edit.
|
||||
// also manages the trigger controller
|
||||
|
||||
//////////////////////////////////////
|
||||
//
|
||||
// TRIGGER CONTROLLER
|
||||
// This code handles the placing and behavior of aiSoldierTriggers
|
||||
/////////////////////////////////////////
|
||||
|
||||
datablock TriggerData(guardTrigger)
|
||||
{
|
||||
tickPeriodMS = 100;
|
||||
};
|
||||
|
||||
////////////////////////////////////////
|
||||
//This is the default datablock for the Guard.
|
||||
//I changed the stock datablock name from those used in AIPLAYER.CS
|
||||
//I did this to allow me to create different classes of bots with their own
|
||||
//thinking and reaction routines for each class.
|
||||
///////////////////////////////////
|
||||
//
|
||||
//You can specifiy as many datablocks as you have characters.
|
||||
//The first variable after PlayerData must be a unique name. The second variable (after the semicolon)
|
||||
//must be a valid body type.
|
||||
|
||||
datablock PlayerData(DemoPlayer : DefaultPlayerData)
|
||||
{
|
||||
maxDamage = 100;
|
||||
|
||||
maxForwardSpeed = 14;
|
||||
maxBackwardSpeed = 13;
|
||||
maxSideSpeed = 13;
|
||||
|
||||
//The art used by this datablock
|
||||
shapeFile = "data/Soldier/Shapes/soldier_Rigged.DAE";//"art/shapes/actors/Soldier/soldier_rigged.DAE";
|
||||
|
||||
//Set the bot's inventory so it can use different weapons
|
||||
maxInv[Rifle] = 1;
|
||||
maxInv[BulletAmmo] = 1000;
|
||||
maxInv[RocketLauncher] = 1;
|
||||
maxInv[RocketLauncherAmmo] = 1000;
|
||||
maxInv[GrenadeLauncher] = 1;
|
||||
maxInv[GrenadeLauncherAmmo] = 1000;
|
||||
|
||||
maxInvRifle = "1";
|
||||
maxInvBulletAmmo = "1000";
|
||||
maxInvGrenadeLauncher = "1";
|
||||
maxInvGrenadeLauncherAmmo = "1000";
|
||||
maxInvRocketLauncher = "1";
|
||||
maxInvRocketLauncherAmmo = "1000";
|
||||
};
|
||||
|
||||
16
Templates/Modules/AI_Guard/Datablocks/aiPlayerMarker.cs
Normal file
16
Templates/Modules/AI_Guard/Datablocks/aiPlayerMarker.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//The AIPlayer marker is placed in the map during edit mode. When the map is loaded the
|
||||
//marker is replaced by a guard player. (Assuming that the $AI_GUARD_ENABLED variable is set
|
||||
//to true.) The marker is hidden or not depending on the value set in $AI_GUARD_MARKER_HIDE.
|
||||
//The AIPlayer marker can use a dynamic variable - set during map creation - called 'respawn'
|
||||
//Creating and setting the 'respawn' variable will override the default value set in
|
||||
//$AI_GUARD_DEFAULTRESPAWN. This allows more freedom in determining which bots respawn and which do not.
|
||||
|
||||
datablock StaticShapeData(AIPlayerMarker)
|
||||
{
|
||||
// Mission editor category, this datablock will show up in the
|
||||
// specified category under the "shapes" root category.
|
||||
category = "AIMarker";
|
||||
|
||||
// Basic Item properties
|
||||
shapeFile = "data/Soldier/Shapes/soldier_Rigged.DAE";//"art/shapes/actors/Soldier/soldier_rigged.DAE";
|
||||
};
|
||||
1639
Templates/Modules/AI_Guard/Scripts/aiPlayer.cs
Normal file
1639
Templates/Modules/AI_Guard/Scripts/aiPlayer.cs
Normal file
File diff suppressed because it is too large
Load diff
34
Templates/Modules/AI_Guard/Scripts/guardTrigger.cs
Normal file
34
Templates/Modules/AI_Guard/Scripts/guardTrigger.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
|
||||
function guardTrigger::onEnterTrigger(%this, %trigger, %obj)
|
||||
{
|
||||
echo(%trigger @ " has been triggered!");
|
||||
// we've been triggered. Now check to see if the player triggered the trigger
|
||||
// we don't want other enemies to keep spawing more enemies!
|
||||
%tgtid = AIPlayer::GetClosestPlayer(%trigger);
|
||||
//echo("nearest human is " @ %tgtid);
|
||||
// check to see if the player triggered this.
|
||||
if (%tgtid == %obj)
|
||||
{
|
||||
// if triggerMany is set, then we shouldn't do anything. (or do something different.)
|
||||
// if you want a trigger to always spawn an enemy, set the trigger's triggerMany value to "true"
|
||||
// default behavior is to trigger once.
|
||||
if (!%trigger.triggerMany && !%trigger.doneOnce)
|
||||
{
|
||||
|
||||
// set the spawnGroup variable to pass on to the spawn function
|
||||
%spawnGroup = %trigger.spawnGroup;
|
||||
|
||||
// let the game know we've already been triggered once.
|
||||
%trigger.doneOnce = true;
|
||||
|
||||
// spawn the group
|
||||
AIPlayer::spawnByGroup(%spawnGroup);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// we've been triggered before. Don't do anything
|
||||
// If you wanted to do something different, this is where you would put it.
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue