VTOL VR Mod Loader

VTOL VR Mod Loader

61 arvostelua
VTOLAPI
4
   
Palkinto
Lisää suosikkeihin
Lisätty suosikkeihin
Poista suosikeista
Tiedostokoko
Julkaistu
Päivitetty
28.469 KB
11.6.2024 klo 5.07
6.12.2024 klo 17.37
12 muutosilmoitusta ( näytä )
Kuvaus
Provides useful methods for mod developers.



Add a reference to this dll from
steamapps\workshop\content\3018410\3265689427

Scene loaded action
VTAPI.SceneLoaded += SceneLoaded; void SceneLoaded(VTScenes scene) { switch (scene) { // Do code depending on the scene // If it's a scenario, this will only be ran when the scenario is ready. } }

Get Players Vehicle Object
GameObject obj = VTAPI.GetPlayersVehicleGameObject();

Referenceless Variable Access
public class ModA { private float _myEpicFloat = 420.69f; void Awake() { VTAPI.RegisterVariable("Danku-ModA", new VTModVariable("EpicFloat", _myEpicFloat, OnSetEpicFloat, OnGetEpicFloat)); VTAPI.RegisterVariable("Danku-ModA", new VTModVariable("DoThing", DoThing)); // Not a variable but who cares } void UnLoad() { VTAPI.UnregisterMod("Danku-ModA"); } // Actions are used to get and set the variables, so these can be replaced with lambda expressions. void OnSetEpicFloat(object v) { _myEpicFloat = (float)v; } void OnGetEpicFloat(ref object v) { v = _myEpicFloat; } void DoThing() { // Do Stuff } } public class ModB { private VTModVariables _modAVariables; private float _modAFloat = -1; void ModAStuff() { if (VTAPI.TryGetModVariables("Danku-ModA", out _modAVariables)) { if (_modAVariables.TryGetValue("EpicFloat", out var outFloat)) _modAFloat = (float)outFloat; _modAVariables.TrySetValue("EpicFloat", 1337f); _modAVariables.Invoke("DoThing"); } } }

Mod Loader Items
// Gets all subscribed steam items. IReadOnlyCollection<SteamItem> subscribedItems = VTAPI.FindSteamItems(); // Gets all local steam items from 'VTOL VR\@Mod Loader\Mods' IReadOnlyCollection<SteamItem> localItems = VTAPI.FindLocalItems(); // Checks if any steam item is loaded with the directory. bool itemLoaded = VTAPI.IsItemLoaded(itemDirectory); // Loads a steam item VTAPI.LoadSteamItem(steamItem); // Same as above but returns a UniTask<bool>. Not sure who may need it but its here. bool loadedItem = VTAPI.TryLoadSteamItem(steamItem); // Disables an item, obviously. VTAPI.DisableSteamItem(steamItem); // Same as above but returns a UniTask. Again, not sure who needs it. VTAPI.TaskDisableSteamItem(steamItem);
8 kommenttia
Delta99 8.10. klo 18.39 
Don't know what flatscreen mod is so probably not!!
JJorne 5.10. klo 11.03 
flatscreen, for example
Delta99 18.9. klo 19.46 
Do we have any idea what other mods?
TheTanMan 18.9. klo 16.31 
yes
Delta99 9.8. klo 14.54 
Not sure how I got subscribed to this. Do some other mods require this and I got it automatically or needed it for some other mod?
Legendz5150 7.4. klo 18.55 
Swaus
Ploob 5.2. klo 15.23 
Sigma
JackStaffDoge 22.1. klo 18.57 
wow