Jump to content

Make party member hostile without initiating dialogue


jemapa

Recommended Posts

The Area script of a creature has nothing to do with the area it is in. It has nothing to do with creatures at all. The name is conventional. The way I see it, there is an hierarchy of scripts in the Infinity Engine, which happen to be called Override, Area... what is next, Class or Race? And so on to the bottom. Then actual areas and creatures - and containers, and doors, and triggers - are put against this pyramid, if you will, so each one falls in a particular place. That's just a metaphor. The important part is that a creature can have an Area-tier script, but is not supposed to, because being in an area is not a property of a creature. A wolf is a wolf wherever it is. If a wolf in Cloakwood is different from a wolf in the Temple area, then it's a different kind of wolf and it ought to have a different Race or Default script, or wherever it is wolves have their behavior written. Probably a different name, too. Otherwise it's a wolf, period. If Fiann has slightly different guards in different areas, there is no reason for him not to change their Class scripts, or again whatever it is that contains their behavior. There is no need to get into Area scripts for creatures at all.

 

And that's what makes this slot useful - that and the fact that it's just under Override. This is an "illegal" slot, so Infinity Engine and, for all I know, DLTCEP don't offer easy editing options for it - a very good thing. An exception or a backdoor into the AI is very valuable. If the editor software started to give proper access to Area script for creatures, everyone and his mother would make some insipid little use of it, not even knowing why, when that change or difference of behavior can easily be written in the regular script tiers. People would mess with Area, because they like to stick their fingers everywhere. The Area tier would then be no different from the others under Override - useless once again, because once again creatures would have some previous AI there, so a modder couldn't change Area without ruining programmed behavior. And if ten other script tiers were added, open to all with an editor, those too would become useless for the same reason. Stupid humans fill all rooms they are given with their junk, because - why not?

 

However, while Area remains outside of reach, it remains very useful. (I'm really sorry to derail this thread, by the way, OP; as I said, use what you like for the action you need. But this is as good a place to explain the system as any.) How is Area useful, you may ask, if scripts are not to be written for that slot? Oh, but they should be written - only those should be *temporary* scripts. Use an editor to set up regular, permanent behavior with Class etc., and write special extra-important and plot actions in Override. But when you need a creature, any creature, to react in a certain way outside of its regular routine, right when desired in the game, THEN you can use an ability or spell with opcode 82 to switch it to an Area script of your choice. You can have any number of scripts laid by just to stick in someone's Area when you need to. In that script you can write both the behavior and a termination of that behavior, i.e. the condition that will make the script check false, whereupon the creature will "drop the act" and come back to its normal actions in Class, Default and so on down the line. What happens to the Area script itself afterwards? You can let it stay in the slot if you expect the triggering conditions to recur, and if you want them to. Or if the Area behavior was triggered by something unique, like a global which then got switched to another value, then there is no need for you to worry about the Area script, it will never "awaken." But if the conditions may recur, you can use 82 again to put another Area script in the slot, one that simply reads

 

IF

 

False()

 

THEN

 

RESPONSE #100

 

NoAction()

 

END

 

This script is the same as having no script. Just put this dud there after the behavior is over. And you never have to worry about disrupting anything with these gate jumps, because again there is no porcelain-vase AI sitting in the Area slot that you need to bite your fingernails about. So long as editors do not allow the Area slot to be managed directly, and I hope they won't, modders together can use the backdoor for temporary behavior changes. One man's script in Area will simply displace another; no big deal, if people remember to keep the permanent and important stuff in Override. You can make your mod with your manipulations for this slot, and I can make mine.

 

In fact, I already have. I'm putting finishing touches on the basic commands of a mod that lets you control creatures, blue friendlies in this case, overriding (rather than overwriting) their behavior for a time. The commands are already here, they work. I just don't want to release the mod yet without filling it out with extra goodies. Nonetheless... and I honestly wanted to advertise the Area mechanism rather than what I made with it myself, but it looks like there is no escaping it... Nonetheless, I say, right now I have a toolbar of abilities that make creatures:

 

Attack a target of choice (up to 3 creatures commanded at once)

Blast that target with magic

Swarm another, parallel target with melee weapons - all creatures in a very wide area rush at him

Come to the calling party member in a crowd

Come and follow (up to 3 creatures)

Sacrifice themselves to give some benefits to the party

Pick or bash a door or chest (imitation in part, but works the same way)

Halt all

 

One or two more commands are in the works.

 

The change in behavior lasts until a few conditions are met or until a party member issues the Halt All command, which puts the dud scripts in everybody's Area slot. The creatures are then free to roam or anything their regular AI tells them to do. When Override scripts kick in, the Area-scripted behavior stops, then comes back. I can set the globals I need in the scripts from the abilities themselves with opcode 265.

 

That's what I'm talking about!

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...