Alex1234 asked if I could explain how I set up the summonable critters in a previous demo video, so here's a quick and dirty tutorial on one way to go about doing it. I think I hit all the main steps here, but lemme know if I left something out. I made this a few months ago now and the memory is a little rusty.

1. Make the Summon
2. Set up/Edit Battle Object
3. Set up Ability Event
4. Set up Status Effect
5. Set up Ability
6. Optional - Set up/Edit Battle End

1. Make the Prefab and Combatant for your Summon
Because I have a weird fascination with jacket wearing rabbits in my demo, it too shall be used for the summonable creature.
image
*Make a new prefab for the creature you want to summon (including any animator or side scripts you need for your party members to normally function. The controller, OBJ vars, and Script components in the screen shot are required for my game, for example.)
*Make a new Tag type and set it to Summoned (so you can always reference these guys specifically later)
*In ORK, make a new combatant using this prefab (using whatever battle settings you normally use). Basically set it up like you would any normal party member. If your party members are AI controlled, give it some AI love. If they have unique abilities and classes, set those up too.

2. Set up/Edit Battle Object
Now you'll need to edit your battle object to allow for extra guys appearing on the field, otherwise they can spawn all over the place when they join (probably not what you want). If you have multiple battle objects across multiple scenes, these will also all need to be edited (unless you're using a prefab to control them all...which I do highly suggest for when stuff like this happens)

*Add additional ally spots to the Battle Object (as many as you might EVER need). For my setup, I'm working under the assumption that each of my three party members could summon an extra guy, so the maximum total number of guys ever on the field will be 6 (3 party members, 3 summons).
image
*Arrange the extra ally spots so they'll look decent with both the largest and smallest possible summon (otherwise you might run into really weird clipping issues later).
image

3. Set up the Ability Battle Event
Now you need to set up the actual event to handle the summon.

*Back in ORK, make a new battle event.
image
*Set up the start of the event as you would normally for any of your other casting type spells. In my example, I'm using a random camera position and 2 spawned particle prefabs - sometimes the camera will zoom in on the caster, and then play the casting and summon particle effects.
*Next add a Join Battle step. (Note - the Random step before the join battle is there for if you want to summon a wide variety of different creatures, like in my specific case. If you only ever want to summon one specific thing, just attach the calculate/spawn steps directly to the Join Battle). Set the level and class settings to whatever makes sense for your game.
image
*Rotate your new critter to look at the enemies (actor "All Allies" rotating to target "All Enemies", or use Look at Enemies). Otherwise your summon may be facing somewhere random.
*Finish up the event with your normal casting-type set up. For my example, that includes a wait step and cleaning up all the spawned particle prefabs.
*Save the event. Half way there!

4. Set up Status Effect
For my specific case, I wanted each party member to be able to spawn only ONE guy for the battle and that's it. So to do that, we need to set up a small status effect requirement that the ability will check for later.

*In ORK, head over to Status Effects and make yourself a new one. (I use the underscore naming convention as a way to differentiate hidden statuses that are used for upkeep type purposes like this. You can name it whatever you want.)
image
*Set the status to Hidden.
*Set the Effect End to "End with Battle".
*Set the Notification to 'Own Notification" and then do anything fancy you want here, like displaying special summoning text.

5. Set up the Summon Ability
Alright, now it's time to finally make the actual ability.

*In ORK, make a new Ability, with Target type Self, and whatever normal casting settings that you use for your game.
*Check the "Animate" box and add a new Battle Event. Attach the event you made in step 3 here (setting up and adding any prefabs or audio clips you need to run your specific event). Note - mine's Battle Event 1, and not 0, since I also use a generic "casting" type event for each spell ability that handles some animations and other random things, which is what's hogging up the other slot. Doesn't matter - just make sure your event is attached in here somewhere.
image
*Under Requirements, check "Use Requirements" and add a Status Requirement. Select the summoned status effect you made in step four and make sure that "Is Applied" is unchecked. Basically we want the ability to only be usable IF this effect hasn't been applied, eg, the party member hasn't summoned anything yet this battle.
image
*Set up whatever your use costs are.
*Under User Changes, add the Status Effect from step 4. Now whenever the summon is successfully cast, the user will have that effect applied, blocking him from summoning anything else during the battle.
image

6. Optional - Set up/Edit Battle End
If you're battling in another scene, walk away, you're done. Anything you summoned into that scene will be cleaned up as normal when you load back into your stored scene. If you're NOT battling in a different scene, you're going to need to clean up summoned critter or he might hang around after the battle is over. Like in my case, my battle arena exists in the same scene as where the player normally walks around, so I need to make sure to clean up anything extra things I spawn into the scene. There's probably a fully ORK way to do this, but as I already have a lot of custom scripts running during my battle end, I just stuck it there.

*Open up your battle end event and make a new Call Function step. Place it around where you normally Destroy Combatants (and yeah, this didn't destroy my summons, just the normal guys, so I had to do this extra bit).
*Make a new C# script, paste this code in, and attach it to your player prefab (working under the assumption that you're not destroying your player in Destroy Combatants. Otherwise, attach it to something else that makes sense for your setup).


public void RemoveSummonedCreatures()
{
summonedCreatures = GameObject.FindGameObjectsWithTag ("Summoned");
for( var i = 0; i < summonedCreatures.Length; i++)
{
Destroy(summonedCreatures[i]);
}

}

*In the event, call this script from Object: Actor, Actor: Player Group. In my specific case, the RemoveSummonedCreatures call happens during the ResetCurrentPosition function, which is why that's displayed on the screenshot.
image
*Update all battle end events you might have with this.
My little chunk of the internet: http://artemic.com
  • edited November 2014
    Reserved in case I need it for more explanations/stuff I left out.
    Post edited by Firrerreo on
    My little chunk of the internet: http://artemic.com
  • that's quick! ok.. i will try this now :)
  • Thanks for the tutorial

    I am hoping to get summons in my project so will have to have a look into this and hopefully get it to work how id like :)

    Debating on summoning and having them as playable or just bring them in as a special effect and cause damage - like the traditional FF summons
  • Let me know if I need to explain something clearer. :). Yeah, for a traditional FF style summon this would be a bit of an overkill - a simple spawned prefab playing a canned animation would be more appropriate. I originally was going that route, but kinda liked the idea of having access to enemy skills in a different way. Now only gotta figure out how to balance it well. Whee.
    My little chunk of the internet: http://artemic.com
  • edited March 2015
    Yeah

    Why would be the best way of spawning a prefab?

    Trying to work out how it would be done
    Post edited by martyn on
  • Haven't actually tried this for reals (so it might need some tweakage to work) but I would go about it like this in the event system:

    Make a new battle event to be called by the summon ability. Add the summon prefab to the event settings, and have it all ready to go with its animations all set up in the project. Spawn the prefab (figure out where to place it in your arena at this point), then use the mecanim or legacy animation node (using your prefab as the object) to play the animation. Add some effects, camera movement, and waits to make sure that it finishes playing all pretty like, then calculate damage and do all the normal battle jazz. Destroy the prefab at the end of the event.

    My little chunk of the internet: http://artemic.com
  • the summoned combatant won't leave after the battle ...
  • Are you battling in a different scene or in the same scene as your main group runs around? If the latter, you'll need to manually remove it with that extra step #6, since it has been instantiated into the game. And ALL your battle end events will need to be updated that could be running in that scene.
    My little chunk of the internet: http://artemic.com
  • Hi I was just wondering if I can use this to make a Charm ability instead of summon as my two main chr's will be Beastmaster Bluemages I may add a summoner to though I have Heart particles ready but not sure how to add another ability.
  • Possibly some of it could be reused for a Charm ability? How did you envision your Charm skill working?
    My little chunk of the internet: http://artemic.com
  • I imagine I would cast charm and a random % chance to succeed charm would be cast like a Sabotage spell/Ability with chance to tame and or capture cast like poison but not do over time damage but succeed or not if succeeded pet/mob would be added to a pet list then use your summon to call pet when it was needed or wanted something like FF11 style
  • Charm in terms of confuse/attack allies > let the ability apply a status effect with Attack Allies enabled.
    For capturing them use the event system (battle event of the ability) and add a Join Active Group step, using the target actor (for chances, you can use a Chance step before that).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Ok cool thank you Gil I have a bit to do before I set this up but I will make a dummy project and play with it a bit so when I am ready I will be right to go
    one thing My char will be a blue mage who will learn blue magic from mobs only
    also I want the charm ability to only work non human type enemies
  • You can use a Check Status step to check which combatant the target is (and other things, e.g. it's combatant type, class, defence attributes, etc.). You should be able to use them in the ability's battle event to only work on certain types or draw magic from certain mobs.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited April 2017
    a bit late i know, but thanks for this, i've used a variation of it to allow both my player group, and the enemy combatants, to summon assistance during a battle

    a couple of things:

    firstly, after it was written gil must have added a new feature, because you can now mark combatants as "temporary" in Join Battle, making it easier to remove them at the end

    secondly, no matter what i tried, i could not for the life of me get ork to add the _summoned status effect in the ability's User Changes

    i gave up in the end and just added it in the SummonHelp Event where it was quite happily applied (although, it then ignored the "Hidden" attribute for some reason, so i've just had to allow the effect name to be displayed against the invoker)
    Post edited by HarryOminous on
Sign In or Register to comment.