Quantcast
Channel: Modding — Beamdog Forums
Viewing all articles
Browse latest Browse all 11774

A few uses for invisible minions

$
0
0
Invisible creatures running scripts are very helpful and for many tasks indispensable. Here are some ways I've been using them which may not be widely known. Template minion files should be kept on top of your override listing, if you plan to experiment with them a lot. I have standard files in mine which I copy and rename for new uses, each starts with + so that it shows on the very top of the Near Infinity Tree: +EFF.EFF, a Summon Creature file, "shskull" in Resource 2 so the minion appears without a cloud of smoke; +MINION.CRE, with the following statistics: Allegiance: NEUTRAL, General: BELT (or another items type to keep them immune to General-targeting spells), 1000 hit points, effects: Immunity to Effect: Damage (to avoid accidental hits and blood splashes), Protection from Creature Type: EVILCUTOFF (to keep enemies from hitting them by accident), NULL_ANIMATION. Sometimes I instead use some animation from the drop-down list, but with additional effects: Remove Animation and/or Remove Feet Circle. Minions with feet circles can be talked to and interacted with. Remove Creature, Self, at some seconds ahead is another good idea to avoid cluttering areas and having forgotten OnCreation actions firing again on reload. The Override Creature Data effect with personal space at 0 helps with strangely unwalkable spots occupied by NULL_ANIMATION creatures, but for big-circle creatures, with regular-size characters walking through them, there are sometimes snags and walkers can get stuck. +MINION.BCS, the minion's Override script. Now to the actual uses: 1) Area features without area editing or copies. I think I've seen this done but not often. When you want to put a statue on a town square, a cart on a marketplace, a boat on a shore and later remove them, you can create an item such as a ring, undroppable, with an Instant/While Equipped effect Play Visual Effect, Self. A minion wearing this ring, with all of the above effects to make it undetectable, unattackable and bloodless, will provide the permanent feature you need. The looped effect plays constantly, unlike regular Play Visual Effect uses, it persists in saved games, and, unlike regular map features, you can include animations and looping sounds. It's possible to put several effects on the ring. One can be a lighting-only illumination: use a VVC with a blank BAM and enable Special Lighting and Light Source to create a circle of light, better noticeable in shadows and late hours. With a separate VVC just for the backdrop you can use the Dream Palette and Time-Stopped options to turn the light golden and white respectively without affecting the colors of other, visible animations. With Blended enabled the light is hard and glaring, without it is softer. Use increased personal space to prevent characters from walking through your feature as though through a mirage. They will have to go around. You will need to test and find out where to center the BAM. When the right script command is given the minion will disappear and free the space. If you want the feature interactive, use a large animation, like a dragon, with the Remove Animation effect, but keep the circle. Don't use DOOMGUARD_LARGE, it has a shadow and sounds. Here is an example. The picture is not so great, it has no shadow, but this conveys the idea: 2) Phasing scripts in and out. A minion can be given a Delayed Set AI Script effect and so timed to run a different set of actions some time in the future. For example, in five hours of game time you can have a minion spawn a horde of monsters at specified points, proceeding where you want etc. Or you can use a Cast Spell on Condition effect, Self, containing this kind of script replacement, if the monsters need to appear at, say, nighttime. Doing these things with scripts for minions instead of just effects gives you much more control over details. To make a creature activate or deactivate you can switch it between a working script and a blank one. 3) Copying summoner name. A minion listed in the toolset as having no name (-1 or 0) will take on the name of the target of the EFF. Thus, any dialogue that you want to pretend is, say, Montaron's can be started by using the summoning EFF on him, and Montaron will be listed as the speaker (though you won't get the portrait). 4) Token names. If you want to change a minion's name in a flexible way, name it with a custom token. In your Weidu installaton write: COPY_EXISTING ~MINION.CRE~ SAY NAME1 ~~. The minion will end up with a blank token for the name, ready to be filled. Then write in your script: SetTokenObject("MINIONNAME",LastHitter/LastTalkedToBy/LastSeenBy/Player1 or whoever you want) The minion will be christened as that object. Make sure to refill the token OnCreation, though, or at any rate every time you intend to use it, because they are emptied on reload. It is even easier to use one of the existing tokens, preferably the token, which is unique in that it is only used in dialogs and gets reset in every dialog that you begin. This makes it safe to use elsewhere. Name the minion in the tp2 and in the script use: SetGabber(LastSummonerOf/LastSeenBy etc.) Now you can imitate someone's actions in all contexts. The minion can never copy someone's Major color, though, used in their name, so that may be a giveaway. Use an unobtrusive color like gray and hope no one will notice. 5) Pseudospeak when silenced. If you wish to assign custom sounds to a creature temporarily and want this to be a general method, useful with anyone, you are in tough luck: you must either change their sound lines with scripts, which is irreversible, unless you know just which lines to give them back later, or you have to Silence them. Silence comes with its own issues; unless you negate it briefly to make your creature converse, you have to imitate the conversation. You can do the above for the name, and the invisible minion will do the talking, with LastSummonerOf instead of Myself for all purposes. Excellence requires this pseudospeak to be convincing, though, so you need the full illusion - a pulsing selection circle. For this use an invisible minion with an animation and a feet circle but with the Remove Animation effect on and with personal space at 0 and write in its script:
JumpToObject(LastSummonerOf)
StartDialog(etc.)
Insubstantial minions land right on top of summoners, so the talk they begin seems to be genuine, with a pulsing circle and all. The circle is even of the right size for the summoner, even if the minion's animation is small. So you could have an animation-erased xvart jump on top of a silenced dragon, and the dragon would flash an immense circle. Just end all branches of the talk with DestroySelf(). 6) Back-and-forth shouting. A minion has only one "attachment" in this life - LastSummonerOf. This is its flexible and enduring referent. All other objects you could use are either fixed like Player1 or there is no certainty what they will refer to, like LastSeenBy, LastHitter, Nearest and so on. A minion only really knows its summoner - the target, so if you summon one on a creature to do a series of actions to it, the minion won't know to take account of the state of the party, other enemies and so on. Example: you use +EFF above from a spell to summon +MINION on an enemy and write some ActionOverride commands to make the enemy's life difficult. But let's say this is a Conjuration/Summoning spell and you also wish you could make the minion recognize that it was cast by a conjurer, if such was the case, and do something extra nasty to the target. How would the minion detect the caster's kit? It won't even know who to look at. You could put a trigger in the minion's script to search for all conjurers in the vicinity, and for spell states and local variables hung on them, but this is slow, unreliable and inflexible. Instead you should summon another minion, this time on the caster, and in its script put all of the profound and clever checks you care to. Then this second minion would shout for the first:
IF

Kit(LastSummonerOf,MAGESCHOOL_CONJURER)
!CheckStatGT(LastSummonerOf,15,INT)

THEN

RESPONSE #1

GlobalShout(3642)
DestroySelf()

END

IF

Kit(LastSummonerOf,MAGESCHOOL_CONJURER)
CheckStatGT(LastSummonerOf,15,INT)

THEN

RESPONSE #1

GlobalShout(8964)
DestroySelf()

END

IF

True()

THEN

RESPONSE #1

GlobalShout(5534)
DestroySelf()

END 
The first minion's code would, naturally, have Heard() checks for all of these options: a specialist without extra smarts, a supersmart specialist and a mage, and proceed accordingly against its own LastSummonerOf. If you were to try and do checks like these through effects, you would be mired in subspells at best. You could also make this work in reverse - have the first minion report on the state of the enemy, e.g. on one of many stats not detected in Apply Effects List, and the second minion would put a custom spell on the party wizard, with bonuses, penalties, rewards and so on. Minions do their job, if their instructions are clear and simple, quickly and efficiently and go away. Having a set of templates handy, with all the right immunities and safeguards, makes using them not exactly a blast, but simple enough. And they are indispensable for creating atmosphere, like scripts in general. A minion can start a cutscene mode for your unfolding spell. It can force ActionOverride(PlayerX,SetSequence(SEQ_X)) gesturing on the party, which delivers a much more pronounced performance than the Set Animation Sequence opcode. And it can write DisplayStringNoName(Player1,X) for general messages spoken by the engine, the narrator or the gods.

Viewing all articles
Browse latest Browse all 11774

Latest Images

Trending Articles



Latest Images