Jump to content

Making a Simulacrum friendly


Recommended Posts

Okay, I know, when you cast Simulacrum it already is friendly. But I have made a version of simulacrum that is targetable. The original vision was to make it so that you could, for instance, cast it on Keldorn for an extra tank, or on Viconia for an extra cleric - in essence, let an Illusionist use a spell for the utility of Vhailor's Helm. But players, being smart, tried to cast this on enemies. And unfortunately, when you cast "Targeted Simulacrum" on a hostile red dragon... you end up with two hostile red dragons. Ouch!

On @kjeron's advice I set up a thing where the Targeted Simulacrum spell cast a subspell that permanently applied a repeating effect, which casts a subspell with op72 Change AI Type -> "ally" and op241 Control Creature -> "dire charmed, neutral, no text" and then quickly canceled the repeating effect on the target. In principle, since the repeating effect is applied with timing mode 9, the simulacrum should inherit it and be affected by the op72 and op241 effects within a second or two, while the target being cloned should have the effect canceled before it is applied. In practice, this was utterly unreliable and in fact more often left me with a charmed target and a hostile simulacrum.

Then I thought, am I wildly overthinking this? So my question today is: why not put op72 and op241 effects directly into SIMULACR.spl? This way the effects will be applied to every simulacrum made by any method. But this should be fine because the normal use of that spell is to create an ally. In my testing this way, I cast normal Simulacrum and it seemed completely normal; and then I cast Targeted Simulacrum on a red dragon and it successfully made a friendly red dragon. So far, so good.

There are two potential problems I can see with this:

 1) Enemies might cast Simulacrum themselves, and we want their simulacra to be allies with them. So my first question is, when op72 sets the EA value to "ally," is that relative to the caster of the spell? Or is "ally" shorthand for "green circle" meaning really an ally of the player outside the computer game? And ditto for the Charm opcode: does it mean controlled by the in-game caster, or controlled by the out-of-game player?

 2) There are three places in the game where enemies create clones of party members, clones which are red-circle and fight against the party. At the end of Durlag's Tower in BG1, in the Irenicus fight in Spellhold in BG2, and in the swamp full of undead in ToB. I could not find and .SPL files that create this effect, so I infer that these events are purely driven by scripts. But I suppose these scripts could involve SIMULACR.spl in some form, and my change could then interfere with those fights. Does anyone have any knowledge about this?

I think in either case I could get around the problem with the use of a spellstate or a proficiency. But I want to make sure I've covered all the angles. Does anyone see any other potential problems, or have information about the ones already mentioned?

Thx!

Link to comment

IIRC there's a script assigned to clones 🤔 There's some hotkey or lua command that shows all info about object under cursor, so it should be possible to find out by examining a clone in-game.

The Nyalee fight in SCS relies on scripting, which was the only option because it tries to create actual copies of targeted party members (different param than simulacrum spell), and clones iirc ended up without scripts and allegiance. That was vanilla BG2, though.

EE might or might not have more options available via splstate targeting.

Edited by Ardanis
Link to comment
1 hour ago, subtledoctor said:

 2) There are three places in the game where enemies create clones of party members, clones which are red-circle and fight against the party. At the end of Durlag's Tower in BG1, in the Irenicus fight in Spellhold in BG2, and in the swamp full of undead in ToB. I could not find and .SPL files that create this effect, so I infer that these events are purely driven by scripts. But I suppose these scripts could involve SIMULACR.spl in some form, and my change could then interfere with those fights. Does anyone have any knowledge about this?

These are all SCS-added. If I'm remembering the method correctly, it doesn't interfere with simulacr. (I use a spell to grant all simulacra a new script which then turns them hostile; I don't know a good way to do it other than by script, but I need to assign them scripts in any case.)

Link to comment

Got it, thanks. My new implementation is:

  • the new 9th-level "Projected Simulacrum" spell applies a spellstate to the target permanently so that it transfers to the clone, but then removes it.
  • SIMULACR.spl gets a new op326 effect which conditionally casts a subspell, only if the clone has that spellstate
  • the subspell applies op72 and op241, turning the clone friendly

This is a spell only for illusionists, i.e. only for players. So I'm not worried about letting enemies cast this spell. And it shouldn't interfere with any use of SIMULACR.spl that doesn't also apply this spellstate, so it should not mess with enemies, or with any scripted use of clones.

So I think it's sorted! Thanks for the info guys.

(EDIT - and, with the update, I've also shifted this spellstate and the two others used by the mod to instead use proficiency bits, which frees up three spellstates for use by others.)

Edited by subtledoctor
Link to comment

Only effects with the Instant/Permanent duration get carried over to a simulacrum. The way to assure its allegiance is to put an Instant/Permanent EA change on the target, farther down the list the cloning effect, then a removal of the switch. There is no need for a repeating EFF or to mess with the basic mechanism for simulacrums, it would be interfering with players' other uses of this effect.

Link to comment
10 minutes ago, temnix said:

Only effects with the Instant/Permanent duration get carried over to a simulacrum. The way to assure its allegiance is to put an Instant/Permanent EA change on the target, farther down the list the cloning effect, then a removal of the switch. There is no need for a repeating EFF or to mess with the basic mechanism for simulacrums, it would be interfering with players' other uses of this effect.

a) No, it would not interfere with other uses.

b) You can't casually apply opcode 72 with timing mode 9 and then remove it because, to quote the IESDP:

  • Only reliable timing mode is Timing Mode 1 (all others are bugged and can convert to this timing mode under various circumstances).
  • Timing Modes 1/4/7 will permanently set the creature(s) IDS value, leaving no removable effect.

By setting a permanent repeating effect (in this case via 177/232), the clone will inherit the repeating effect. And it can be removed from the target. Then, when the effect fires on the clone, it will cast a subspell with opcode 72.

For whatever reason that was unreliable. But it doesn't matter, it's easier to just apply the effect in simulacr.spl and gate it behind a spellstate. Then all you have to do to the target is apply the spellstate. This way you can do all sorts of things using the Simulacrum spell as your base. In my case, I have three leveled versions of simulacrum which gimp the clone to varying degrees, instead of the single unreliably level-drained instance. But you can do other things. Off the top of my head, apply an op53 or op135 effect to the clone and make it take the appearance of a shadow or invisible stalker, and you can simulate making someone's shadow come alive and fight against them, Game of Thrones-style.

Heck, that's a good idea, I think I'll use that.

Link to comment

That's a lot of bullshit from the guide. There is nothing wrong with changing allegiance with effect 72. With GENERAL there is. But you just don't know the difference, do you? Well, go ahead, build a tower of Babel.

Link to comment

Yes, I took that at face value. Why wouldn’t I? I mean if it was the only way to get it done I might put more time into testing it. But why would I waste time worrying about that when the alternative method I ended up using is superior anyway?

Edited by subtledoctor
Link to comment

What is superior about it? You piled on a garage sale's worth of tweaks, when all you needed to do was to swap the allegiance in and out. I've done that a million times, including for simulacra, it works fine. You can't be blamed for not knowing it, but you can be blamed for sticking with a lousy solution now and messing with the basic simulacrum mechanic in a way that might interfere with other people's use of it.

Link to comment

You're insane dude. You think it's better to permanently turn the enemy into an ally - temporarily permanently, sure sure - rather than just slapping them with a harmless spellstate? Yes, my way is completely superior, and it doesn't interfere with anyone else, it couldn't unless they miraculously use the same spellstate as me. And that won't happen because  - and this part is going to blow your mind - I have the good sense to use a modding prefix.

Edited by subtledoctor
Link to comment
On 5/7/2022 at 2:23 PM, subtledoctor said:

On @kjeron's advice I set up a thing where the Targeted Simulacrum spell cast a subspell that permanently applied a repeating effect, which casts a subspell with op72 Change AI Type -> "ally" and op241 Control Creature -> "dire charmed, neutral, no text" and then quickly canceled the repeating effect on the target. In principle, since the repeating effect is applied with timing mode 9, the simulacrum should inherit it and be affected by the op72 and op241 effects within a second or two, while the target being cloned should have the effect canceled before it is applied. In practice, this was utterly unreliable and in fact more often left me with a charmed target and a hostile simulacrum.

I posted a cleaner solution (to a similar problem) here for Mislead.  No spellstate needed.

Link to comment

kjeron, only GENERAL is bugged and unremovable. Race, class, allegiance changes all go away, specific I don't know. There is no need for a cleaner solution.

Edited by temnix
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...