Hello!
I'm working on a game that's part visual novel, part tactical RPG. I've gone through the ORK game tutorial, as well as the grid battles tutorial. It's excellent, and does nearly everything I need. I'm hoping to integrate Fungus, an open-source dialogue system that I have some experience with which I've chosen because it gives me the visual novel capabilities that suit my game best. (It's here:
http://fungusgames.com/)
Fungus conversations are laid out in flowcharts. These can be called by script, and I have successfully done so with trigger boxes. In theory, I expect I can call them from an ORK event with the Call Function node. However, I'm having trouble doing so from a Battle Start Event.
I'd like to, at various points in the grid battle, call these flowcharts to insert dialogues from a character that will give instructions and advice. For example, a dialogue overlay that says something like "Hey, decide where you want to place Character X on the map" before/as the player placement occurs. And "Character X is a melee fighter, so you have to get close to the enemy!" or something when the player starts to move the character, and so on.
I have found a number of threads that deal with the Call Function node, but my options appear a bit different in the Battle Start Event. For example, my Actor options are the faction groups, and I'm not able to assign an actor in the Event Settings node. I'm not sure what to apply my script to so that I can correctly call it in the node.
I'd really appreciate some outside perspective on this. I think I've been staring at it all to long, and I suspect the answer is right in front of my face. Thanks!
I'm basing a lot off the ORK game tutorial series. Currently, I have an opening scene that is just a flat plane where BrownPants spawns. If he runs into a cube with this script attached, a Fungus flowchart is called and a dialogue box appears. Since I was having difficulty with the Battle Start Event, I attempted to call the function from a Game event, the game start event from the tutorial. I attached the following code to the BrownPants prefab: I added a Call Function node after the final node from the gamestart event (adding the Fire Sword recipe), and called the startTut function. It appears to call it, as my console displays the "triggered" notification, but it's followed by an error that an exception has been thrown. I understand that means there's an error in my function, but I'm failing to understand what that error is. I have set no parameters on the node.
I hope that helps explain where I'm at. Thanks again!
Use a Call Function node with the following settings (based on your code example):
- set Component Name to Flowchart
- enable Is Static
- set Function Name to ExecuteBlock
- click on Add Parameter
- set Parameter Type to String
- set String Value to Start (or whatever other value you want to use)
As you noticed, other event types than game events don't allow setting up actors, as they rely on a special set of actors (e.g. user and target in battle events). If you need to use other game objects, you'll need to e.g. use a Search Object node and store them in found/global object lists to use them in the event.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I gave your first suggestion a try, and get this alert: Am I right in understanding that means it isn't actually a static function?
I'll play with the search object approach and see what I can get. Thanks again!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I'm going to give some other game objects & events a try, but I do know the function gets called successfully in the Start Event, when the script is attached to BrownPants. An exception is thrown at the line, even though that line is executed perfectly fine when attached to a box trigger. I think that discrepancy is really throwing me, too. Does something load in an unfortunate order, perhaps?
Thanks again!
Thanks so much again for all the help! I can't wait to share where this goes. :D
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The exception being thrown was this: Something about the load order was making it so the Flowchart was null when the Start Event was looking for it on the BrownPants character. Moving the script to an object in the scene fixed it, so I just have an empty object with these functions on it for now. We'll see how long that works. :D
It seems to be doing the job from within a Battle Start Event, though interspersing steps of the battle with these Flowchart calls is still something I'm working out.
Thanks again!