Jump to content

A Series of Questions about aspects of the IE engine


Recommended Posts

I have another question, though this one requires something of a preface. A kit can be applied to a character at any time using utilities like EEkeeper; in fact a character can even retain a kit for a class different than their own, for example, a Fighter could have the Assassin Kit applied to him, and, even though it will not effect his fighter levels in any way, the game will remember that said character has that kit. Then if that fighter chooses to dual classes into a thief, rather than becoming a True-Class thief, he will start his second class as an Assassin, with all of it's unique class features and restrictions intact, and then will continue the game as a Fighter x / Assassin x dual. It is an interesting engine feature that I'm surprised has never been utilized in the main game.

 

With that said, my question is how is the most direct way to apply a kit to a character, preferably via an opcode? I know there are opcodes to change alignment, sex, level, etc.

A script action. Usually though, one uses a spell that casts; a summon spell; that makes an invisible creature; that runs that script.

Link to comment
Is anything wrong with simply using this in the creature's own script?

This action removes the active creature's current kit and adds the specified kit. Abilities from any previous kit are removed. AddKit(0) can be used to remove a creatures current kit without adding a new one. Class restrictions apply for kits. When attempting adding an invalid kit, the existing kit (if any) will be replied.

 

Why is there need for spells or invisible helpers or other such?
Sorry, I forgot to mention that I look from the EE side of things, although it used tow work in BGT as far as I remember.
Edited by Roxanne
Link to comment

@Roxanne, sure, I guess, but it's kind of hard to say whether it could be "added to the creature's script" when we don't know which creature Reddbane is talking about. Further, he seems to be discussing adding a kit to a character in-game... if you just add AddKit to its script, how do you determine when it fires? Wouldn't it happen immediately? In that case wouldn't you just design the .CRE to have the kit in tbe first place?

@Reddbane, a fairly simple example of using the AddKit script with an invisicre (invisible creature) is in the old version of my mod, in which you could get a multiclass kit by using an item. See the multiclass kits component here:
https://github.com/UnearthedArcana/Scales_of_Balance/tree/590b7deb3f546c54db1e7ef57f56036fce7b2e66

 

You can repurpose the .SPLs, .CREs and/or .BAFs from there to use in an item or spell of your own. (E.g. scales_of_balance/mc/d5_mieli.spl, d5_mieli.cre, and d5_mieli.baf)

Edited by subtledoctor
Link to comment

Roxanne, sure, I guess, but it's kind of hard to say whether it could be "added to the creature's script" when we don't know which creature Reddbane is talking about. Further, he seems to be discussing adding a kit to a character in-game... if you just add AddKit to its script, how do you determine when it fires? Wouldn't it happen immediately? In that case wouldn't you just design the .CRE to have the kit in tbe first place?

 

@Reddbane, a fairly simple example of using the AddKit script with an invisicre (invisible creature) is in the old version of my mod, in which you could get a multiclass kit by using an item. See the multiclass kits component here:

 

You can repurpose one of the .ITMs, .SPLs, and/or .CREs from there to use in an item or spell of your own.

The example I had in one of my mods was to give a (joined) NPC a special kit after completion of a personal task. So yes, in this case the AddKit had some script conditions like the globals from the successful solved quest. But you can use that any other way you want, e.g. reaching some level of having some XP or what else.

IF 
ANY NUMBER OF ANY TYPE OF CONDITIONS OR GLOBALS YOU WANT TO CHOOSE
Global("GiveKit","Locals",0) 
THEN 
RESPONSE #100 
SetGlobal("GiveKit","Locals",1) 
AddKit("thenewkit") 
END

PS - I still have the issue with one of your mods in my EET game that used a (light blue) scroll.itm for that purpose and they are found on nearly every dead enemy priest's corpse (Yes, I know you improved that in a newer version, but in an EET game these things stick around for a LONG time...).

And all those invisible helpers...they work fine, but in a game of some hundred hours there are quite a lot of them that for whatever reason did not destroy after they did their job. Some areas can get mighty crowded unless you know where to look for the source of some problems. And one can easily have 20+ mods installed that all use the invisibles.

Edited by Roxanne
Link to comment

Well yeah. If it is meant to be conditioned on some environmental/quest-related factors, then it can and should simply be scripted. In that case you're scripting things anyway.

 

But if you want to initiate it at a time and place of you're choosing, rather than depending on external conditions, then it can be handy to trigger it by .SPL effects. and in that case an invisible creature is the most convenient solution.

 

Plus there is the issue that script conditions in a .CRE's script or in BALDUR.BCS orcsomething like that are checked constantly, which uses some nonzero amout of resources. There's something to be said for only firing a script once, if it's the sort of thing that is only meant to happen once. (Frankly this sort of thing would more appropriately be done via a spell, if only there were a spell effect to do it.)

 

Anyway as far as invisible helpers, I agree with you that they should be avoided wherever possible. I only use them for stuff like this, where you choose a kit once, running a script once, from a creature that was summoned once and then dismissed. As far as your games go, I can only guess, knowing about your taste in mods, that you have some installed that may not use the most efficient or modern techniques...

Edited by subtledoctor
Link to comment

@subtledoctor

I'm actually studying your Kensai revision, since it does use a script to apply a kit, after using a script to initiate a dialogue choice. I've been able to locate the relevant files (Spl, script, cre) files that initiate dialogue that begins the choice, but I wonder if you could help point me to the relevant script and creature files that apply the respective (weapon) kit change once the dialogue decision had been taken? That is what names shoud be looking for .BCS and .CRE, since all I could disover, so far, was D5_KENF.CRE and D5D5_KENF.BCS, which I assume is used to "create" the dialogue choice?

Link to comment

Dialogues can initiate Script Actions. So the main thing that needs to be done is to initiate the dialogue. You summon the .CRE, you give the .CRE a super-simple script that uses ActionOverride to get its summoner (you) to start a dialogue, then certain dialogue responses trigger script actions like AddKit.

 

Don't look at the kensai stuff after it's installed; look at the mod's .tpa file and see what files are COMPILEd, and take a look at those .D and .BAF files.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...