mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-25 22:35:37 +00:00
completed list of roughly ported over scripthooks.
todo: need to figure out why followobject is only hitting the first path node. likely amixup with goal handling
This commit is contained in:
parent
e37ae27bc0
commit
4fb92f02a3
16 changed files with 386 additions and 40 deletions
|
|
@ -169,3 +169,8 @@ datablock LightAnimData( SpinLightAnim )
|
|||
rotKeys[2] = "az";
|
||||
rotSmooth[2] = true;
|
||||
};
|
||||
|
||||
datablock AIPlayerControllerData( aiPlayerControl )
|
||||
{
|
||||
|
||||
};
|
||||
|
|
@ -104,6 +104,7 @@ function ENavEditorSettingsPage::init(%this)
|
|||
{
|
||||
// Initialises the settings controls in the settings dialog box.
|
||||
%this-->SpawnClassOptions.clear();
|
||||
%this-->SpawnClassOptions.add("Player");
|
||||
%this-->SpawnClassOptions.add("AIPlayer");
|
||||
%this-->SpawnClassOptions.setFirstSelected();
|
||||
}
|
||||
|
|
@ -240,7 +241,7 @@ function NavEditorPlugin::initSettings(%this)
|
|||
{
|
||||
EditorSettings.beginGroup("NavEditor", true);
|
||||
|
||||
EditorSettings.setDefaultValue("SpawnClass", "AIPlayer");
|
||||
EditorSettings.setDefaultValue("SpawnClass", "Player");
|
||||
EditorSettings.setDefaultValue("SpawnDatablock", "DefaultPlayerData");
|
||||
|
||||
EditorSettings.endGroup();
|
||||
|
|
|
|||
|
|
@ -459,6 +459,12 @@ function NavEditorGui::onLinkSelected(%this, %flags)
|
|||
|
||||
function NavEditorGui::onPlayerSelected(%this, %flags)
|
||||
{
|
||||
if (!isObject(%this.getPlayer().aiController))
|
||||
{
|
||||
%this.getPlayer().aiController = new AIController(){ ControllerData = aiPlayerControl; };
|
||||
%this.getPlayer().setAIController(%this.getPlayer().aiController);
|
||||
}
|
||||
NavMeshIgnore(%this.getPlayer(), true);
|
||||
updateLinkData(NavEditorOptionsWindow-->TestProperties, %flags);
|
||||
}
|
||||
|
||||
|
|
@ -526,7 +532,7 @@ function NavEditorGui::findCover(%this)
|
|||
%text = NavEditorOptionsWindow-->TestProperties->CoverPosition.getText();
|
||||
if(%text !$= "")
|
||||
%pos = eval("return " @ %text);
|
||||
%this.getPlayer().findCover(%pos, NavEditorOptionsWindow-->TestProperties->CoverRadius.getText());
|
||||
%this.getPlayer().getAIController().findCover(%pos, NavEditorOptionsWindow-->TestProperties->CoverRadius.getText());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -547,7 +553,7 @@ function NavEditorGui::followObject(%this)
|
|||
toolsMessageBoxOk("Error", "Cannot find object" SPC %text);
|
||||
}
|
||||
if(isObject(%obj))
|
||||
%this.getPlayer().followObject(%obj, NavEditorOptionsWindow-->TestProperties->FollowRadius.getText());
|
||||
%this.getPlayer().getAIController().followObject(%obj, NavEditorOptionsWindow-->TestProperties->FollowRadius.getText());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue