edited September 2018 in ORK Scripting
Hello community, i'm almost starting school so i want to share with you my little knowledge in ORK Framework, maybe this tutorial is easy for some people but for some like me it's difficult to make some custom scripts so here is my first tutorial i plan on making others each time i discover something interesting to do with the Framework


So let's start with the first tutorial which will cover how to change battle at runtime using a custom option menu system

Step 1: Create 2 Variables for example ("useATB");("useDynamicCombat");

Step 2: Get the script i will link you and fill the two fields with your variables

Step 3: Open ORK Framework and naviguate through Menus/MenuScreens

Step 4: I guess i don't have to explain you how to make an option menu, this is covered in the tutorials i guess, then create a Custom Option and fill the FieldName by anything you want to appear on screen, and in the VariableKey just fill it with your variable name (exactly the same as your script)

Step 5: save your settings , try to keep the script on your combatant prefab or at least in the scene and it should work

Example Screens : image image

Oh and here is the code : using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ORKFramework;

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using ORKFramework;

public class BattleSystemSwitcher : MonoBehaviour {

public string useActiveTimeVariable;
public string useDynamicCombatVariable;




void Update ()
{

//Check the Game Variable in ORK containing the use of ATB system
if (ORK.Game.Variables.Check (useActiveTimeVariable, true)) {
Debug.LogError ("ChangedBattlesystem !");
//Set The battle Type To ATB
ORK.Battle.SetType (BattleSystemType.ActiveTime);
//Add the player to make the combat more dynamic !
if (ORK.Game.Variables.Check (useDynamicCombatVariable, true)) {
Debug.LogError ("DynamicBattles!!");
//Set The battle Type To ATB
ORK.BattleSystem.activeTime.menuPause = false;
ORK.BattleSystem.activeTime.dynamicCombat = true;
}

} else {
//reset to default turn based system if the bools aren't filled
ORK.Battle.SetType (BattleSystemType.TurnBased);

}


}
}
Post edited by Tr1nome on
Sign In or Register to comment.