Summoning temporary battlers (spell, script)

Any documentation, tutorials, tips and tricks, or examples on how to use the IB2 Toolset

Summoning temporary battlers (spell, script)

Postby youngneil1 » Wed Jun 14, 2017 5:41 am

1. Introduction
Additionally to the party members and the creatures placed directly on the battlefield in the toolset, authors can also grant players or creatures the abilities to summon their respective temporary allies via spell. Furthermore, authors can place ibscripts on the ibscrip hooks of an enocunter for doing the very same (eg at the start of the battle or each round). All these allies (of the party or the enemy creatures) only last a configurable number of rounds before they vanish again. In case the encounter ends for some reason, they also vanish anyway.

2. Allies of the party
Allies of the party are technically player characters which eg can be made with the Player Editor of the toolset. For the player, these can still look like monsters/creatures if you assign them the token and name of a monster/creature (eg a bear). The player remains in control of the temporary allies and controls them manually in battle. They will not appear as portraits, have no inventory and will not be displayed in the party screen though. They can cast spells and use traits, providing a huge amount of flexibility. They can only be of normal size, using the the 100x, 200y pix tokens that all players use. When all real, permanent party members drop unconscious or dead in battle, the battle is considered lost even if some temporary allies are still alive. The engine loads these allies from the data folder of your module looking for a .json file with the name of the temporary ally. You can summon the very same temporary ally multiple times in a battle (like six guards all using the same .json file). When a square that the ally is supposed to appear on is occupied/non-walkable, the engine will try to find a fitting location nearby automatically.

3. Allies of the enemy creatures
Allies of enemy creatures are just normal creatures, which are run by the AI. They can have all sizes. You have to slay them, too, in order to win a battle. They are created by the engine like any normal creature, identified by their resref (which points to the creature blueprint to use for spawning this cretaure instance). You can summon creatures of the same (or different, of course) blueprint as many times as you want. Also, again the engine will place them nearby if their intended desitination square should be occuipied/non-walkable.

4.New spells

Summon Ally Bear (Pc)
This the provided example spell for summoning an allied player character. Please note that it calls the spellScript spSummonAlly, which takes two paramters (spellScriptParm1, spellScriptParm2): the first is for the name of the player character to summon (without .json, must be stored in data folder of your module), the second one is for the duration in rounds that the summoned player character will stay. It is a ranged spell, castable at a point location within range.

Summon Ally Spider (Crt)
This works very much the same, but is intended for enemy casters to use. Therefore, spellScriptParm1 defines the resref of the creature to summon. You can summon creatures of any size with this. The spell will be targeted by enemy AI against the nearest player character and will summon the creature as close to him as possible.

5.New ibscripts
The new summonAlly script can be used for summoning as many party allies as you wish. Its building block is this line:

Code: Select all
~gaAddTemporaryAllyForThisEncounter(parm(0),parm(1),parm(2),parm(3))

This is what the parms do:

Code: Select all
//gaAddTemporrayAllyForThisEncounter.cs - Adds a pre-made character (as palyer controlled creature, ie no inventory access, no portrtait, not on party screen) for this encounter
//parm1 = (string) PC file name (ex. Drin); ie without the .json ending
//parm2 = (int) x location
//parm3 = (int) y location
//parm4 = int) duration in rounds


You can use the "~gaAddTemporaryAllyForThisEncounter(parm(0),parm(1),parm(2),parm(3))" line as many times as you want in a single call of this ibscript. Just increase the parms count correspondingly, e.g. "~gaAddTemporaryAllyForThisEncounter(parm(4),parm(5),parm(6),parm(7))" and so forth. This way you can add any number of allies with a single ibscript call.

I failed to provide an ibscript example for summonig allies of the enemy creatures in the default module, but it works using a very similar technique. Just call this line here as many times as you wish:
Code: Select all
 "~gaAddCreatureToCurrentEncounter(parm(0),parm(1),parm(2),parm(3))"


Parms work very similar also:

Code: Select all
//gaAddCreatureToCurrentEncounter.cs - Adds a creature to the current encounter 
//parm1 = (string) the resref of the added creature (use one from a blueprint in the toolset's creature blueprints section) 
//parm2 = (int) x location of the added creature on the combat map (will be automatically adjusted to nearest location if the spot is already occupied or non-walkable) 
//parm3 = (int) y location of the added creature on the combat map (will be automatically adjusted to nearest location if the spot is already occupied or non-walkable)
//parm4 = (int) duration in combat rounds until the creature vanishes again 
User avatar
youngneil1
Backer
Backer
 
Posts: 4046
Joined: Sat Dec 08, 2012 7:51 am

Re: Summoning temporary battlers (spell, script)

Postby youngneil1 » Wed Jun 14, 2017 3:19 pm

Done :) .
User avatar
youngneil1
Backer
Backer
 
Posts: 4046
Joined: Sat Dec 08, 2012 7:51 am

Re: Summoning temporary battlers (spell, script)

Postby youngneil1 » Tue Oct 10, 2017 4:46 pm

Fixed an error with script parm descriptions above (for adding temporary allies of the party via script).
User avatar
youngneil1
Backer
Backer
 
Posts: 4046
Joined: Sat Dec 08, 2012 7:51 am


Return to Users Guide and Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron