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:
AzaezelX 2025-04-17 01:27:08 -05:00
parent e37ae27bc0
commit 4fb92f02a3
16 changed files with 386 additions and 40 deletions

View file

@ -169,3 +169,8 @@ datablock LightAnimData( SpinLightAnim )
rotKeys[2] = "az";
rotSmooth[2] = true;
};
datablock AIPlayerControllerData( aiPlayerControl )
{
};

View file

@ -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();

View file

@ -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());
}
}