Greetings,
I've been trying without any success to create a simple dialogue cinematic. The tutorial "Cinematic field scene introduction" makes total sense and I've had a lot of success doing variations of that type of cinematic. But when I comes to something involving a combatant, hostile or otherwise, I'm not doing well at all :) I think I need it explained to me in simple terms.
I need to do quite a few semi-complex cinematic scenes but thought I would start out really simple. All I'm trying to do at the moment is spawn an NPC, have him walk to a waypoint via a Change Position Step, Rotate to the player and pop up a simple dialogue.
My Event Settings step has 2 waypoints added, which are also in my scene. Same as the cinematic tutorial. I was trying to use the Start Combatant Spawner step to spawn my NPC. I have a GameObject with the Event Interaction component and a Combatant Spawner component on it as well. The Combatant Spawner is set to Start Type none. I was thinking the Start Combant Spawner step would start the spawner, spawn my NPC, then I could use the waypoints to have him Change Position to them and thus "talk" to my player. I hope that makes sense :) Also, I tried adding a Search Objects step to try and get a hold of the combatant and have him Change Position but no luck there either.
Also, no matter the Start Type of the Combatant Spawner, I get the following error:
NullReferenceException: Object reference not set to an instance of an object
ORKFramework.Behaviours.CombatantSpawner+d__a.MoveNext ()
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
ORKFramework.Behaviours.CombatantSpawner:StartEvent(GameObject)
ORKFramework.Behaviours.CombatantSpawner:StartFromEvent()
ORKFramework.Events.Steps.StartCombatantSpawnerStep:Execute(BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep()
ORKFramework.Events.BaseEvent:StartEvent()
ORKFramework.Events.GameEvent:StartEvent(IEventStarter, GameObject)
ORKFramework.Behaviours.d__2:MoveNext()
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
So I know I have something messed up :)
So when the Help for the Start Combatant Spawner says "The selected object must have a correctly set up 'Combatant Spawner' component attached", what does that entail?
Anyway, I really need to work this out :) I need to be able to have dialogues, start battles and other cinematics and am getting nowhere fast.
One last question, I'm doing this in a Game Event. Is that a problem?
Thanks! :D
If the game object is already present or spawned by the event, it's easier to use it in the event and make it move somewhere. Having the combatant added to the object would take care of the animations when moving (in case you're using the auto move animations).
Also, if the combatant is using auto start battle settings, it might be best to first have him in a faction friendly with the player, otherwise it might trigger a battle that you don't want :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I think I can get that to work with some of my combatants. One thing I'm not sure how to work around is I'm using ORK to 'create' some of my other combatants.
I have a generic prefab that has all the Equipment Viewers etc. on it and when I create the combatant in the ORK Editor, I set it's gear etc. with the starter gear settings. Then I use a spawner to spawn the combatant in the scene, be it an enemy, NPC, Shopkeeper and so on.
So, technically, I don't have an enemy prefab to add to a game object in that respect. Can I use a combatant spawn step or something ( if there is such a thing :) ) to create the combatant entity itself in the event? I don't know if I'm asking that correctly?? :)
EDIT: Also, for clarification, what's difference between a combatant added with an Add Combatant component and an actual monster that walks around the scene. I do get something moving around the scene (if I look in scene view during play mode), but it's not the actual combatant that I created in ORK.
There's no difference for the combatant between Add Combatant and spawning it (e.g. Combatant Spawner). When using Add Combatant, the combatant will be added to the game object, while spawning will spawn the combatant's prefab and add it to it.
I.e. if you have a game object in your scene that should be a combatant, use Add Combatant (component or event step), otherwise use the combatant spawner to spawn it's game object into the scene.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Would I spawn the combatant spawner from a prefab in the event or just use an existing spawner in the scene and find the spawned combatant? Not sure which would be the best way to go.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
One more thing: Does the spawner need to part of the GameObject that has the Event Interaction component on it? I don't have ORK open at the moment but I think the Start Combatant Spawner has some help about have the spawner on the game object or maybe I'm mistaken. In any even, do I need to do anything special with the spawner for the event to find it?
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
My second node in the event is a Start Combatant Spawner node: Object: Actor, Actor: Scene Object.
But I'm getting this error when the scene loads:
NullReferenceException: Object reference not set to an instance of an object
ORKFramework.Behaviours.CombatantSpawner+d__a.MoveNext ()
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
ORKFramework.Behaviours.CombatantSpawner:StartEvent(GameObject)
ORKFramework.Behaviours.CombatantSpawner:StartFromEvent()
ORKFramework.Events.Steps.StartCombatantSpawnerStep:Execute(BaseEvent)
ORKFramework.Events.GameEvent:ExecuteNextStep()
ORKFramework.Events.BaseEvent:StartEvent()
So I'm not sure where I'm messing up :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Start Settings
Use Scene ID: disabled
Start Type: None
Orientation (Player)
Front: enabled
Back: enabled
Left: enabled
Right: enabled
Spawn at Object 0: which is a waypoint GameObject in the scene and in the event both.
Battle Settings
Battle Type: Turn Based
Battle Object: none
Use Nearest Battle: disabled
Combatant Settings
Remember Combatants: enabled
Spawn Random: disabled
Faction: Player (it's an NPC)
Combatant: Bob The Construction Worker (test subject :) )
Level Settings
Set Level: Default
Class Level Settings
Set Class Level: Default
Spawn Settings
Quantity: 1
Random Rotation: disabled
Set Scale: disabled
Respawn Settings
Respawn: disabled
Move AI Settings: all disabled
No waypoints added
All defaults here down, no variable conditions, auto destroy is enabled.
The Combatant Spawner is added to the Event Interaction object as Actor 2
I hope that gives you the information you need :)
I'll need a small Unity test project where this is happening to look into it further.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I added a couple of screen captures of the event and spawner settings in scene as well. I can still send a small project if my email doesn't help. Thank you!
You can solve that for now by e.g. using a small Start After time setting (like 0.1) or adding a small wait step before the Start Combatant Spawner step.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!