Hi im new to ORK, and im having diffuculty in making ORK work. Im feel lost, i've been looking into the website's tutorials and they look like simple terms and definitions and concepts only. Im currently stuck on how to make a grid. So, I attached a BattleGridComponent to an empty gameObject. I also attached a BattleComponent to another gameObject. My understanding of what I've read on the tutorials is that I should call BattleComponent.StartBattle(bool), but i dont know how to expose the BattleComponent variable. Can't make it public and be seen in the editor, can't call GetComponent(), showing an error that " GetComponent requires that the requested component 'Battle' derives from MonoBehaviour or Component or is an interface.
UnityEngine.Component.GetComponent[Battle] ()" .. I dont undertand what's wrong

Animator animator = this.GetComponent();
animator.SetTrigger("test");
Battle test1 = GetComponent();
test1.StartBattle(false);

// animator executes correctly
// error on line GetComponent(); displays error message above
  • I'd recommend going through the game tutorials to learn all the basics, e.g. how battles are usually started. Also, the grid battle tutorials are a must if you want to do grid battles.

    As for your issue, the Battle class isn't a component - I think you're looking for the BattleComponent, which is used for setting up battles in your scenes.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks.. i have some concerns:

    1. so one of my initial points, which is if there are sample projects, there's none?
    2. the reason why im looking for a sample project is because the tutorials are so many and lengthy..

    Yeah it is a BattleComponent i was needing, so now i have 3 scripts on my scene
    1. BattleComponent
    2. BattleGridComponent
    3. GameStarter

    sorry, but i still feel lost, i don't know what to do next.. based on my readings, i have to call something like a "Start()" function, but i dont know where and on which component.
  • edited August 22
    Ah, sorry, forgot to answer that - you can download the completed game tutorial project in the showcase.

    You can start the battle set up in the BattleComponent by calling the StartEvent function:
    battle.StartEvent(null);

    Why do you need to start the battle via script, though? The battle component offers multiple ways to start the battle, e.g. upon entering the game object's trigger.

    Also, yes, the game tutorial series is pretty long, but that's due to creating an RPG is a pretty huge task even with something like ORK Framework. There's a lot to do, set up and learn :)
    Post edited by gamingislove on
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Lol, i make tutorials 3 times from 0 to 50 before i started to understand at least small part of system. You cant just push "make good game" button... ))
Sign In or Register to comment.