Entertainment, Game Development.

Adventure Creator – Notes

These notes are for RPR specific but could be useful to others and/or my future project(s).

KickStarter is where it’s at for most of my control main ones: (Page 372 in the manual)

KickStarter.playerInput
KickStarter.stateHandler

KickStarter.mainCamera
KickStarter.player

KickStarter.settingsManager
KickStarter.variablesManager

I’ve got a tiny custom script to allow the player to look back and also free aim,

AC.KickStarter.stateHandler.IsInGameplay () is true when its regular gameplay, but say a paused camera switch etc happens it goes to false, which helps me disable custom player camera controls.

To retrieve a component by ConstantID, you use Serializer.returnComponent:

_Camera myCamera = Serializer.returnComponent <_Camera> (myConstantID);

Another important part is Speech texts tokens, example: [wait:1]

AC.EventManager.OnAfterChangeScene += SceneChanged;
KickStarter.ResetPlayer can reset the player – look inside ActionPlayerSwitch for an example on its usage.
https://www.adventurecreator.org/scripting-guide/class_a_c_1_1_kick_starter.html#a631a039d91bfb7b7e442787c6d05f42d

public bool IsInCutscene ()

{

return (AC.KickStarter.stateHandler.gameState == AC.GameState.Cutscene);

}

AC.KickStarter.actionListManager.IsGameplayBlocked ()

How many actions are running?

private int GetNumActionListsRunning ()
{
int numRunning = 0;
foreach (ActiveList activeList in KickStarter.actionListManager.activeLists)
{
if (activeList.IsRunning ())
{
numRunning ++;
}
}
foreach (ActiveList activeList in KickStarter.actionListAssetManager.activeLists)
{
if (activeList.IsRunning ())
{
numRunning ++;
}
}
return numRunning;
}

There’s a few outlier cases where that’ll return false but gameplay is disabled, e.g. when the player is moving towards a Hotspot. Better to use:

!AC.KickStarter.stateHandler.IsInGameplay ();

AC.KickStarter.stateHandler.IsInCutscene ();

// First, load the ActionListAsset from the .asset file in resources
actList = (ActionListAsset)Resources.Load(“your_asset_list”) as ActionListAsset;

// Then, populate the parameters if they exist – they need to be integer IDs – ie. the Constant ID component
actList.parameters[0].SetValue(constantID);

// Run the action list!
AdvGame.RunActionListAsset (actList);

https://pastebin.com/10wRf5gT

Hotspot[] allMyHotspots; void Start () { allMyHotspots = FindObjectsOfType (typeof (Hotspot)) as Hotspot[]; }

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: