Jump to content


Photo

Trouble with the 214 opcode ("Select spell")


  • Please log in to reply
17 replies to this topic

#1 temnix

temnix
  • Member
  • 983 posts

Posted 13 March 2017 - 02:09 PM

In the games this opcode is used, as far as I know, only for Nahal's Reckless Dweomer. There may be a couple of other uses, but no more than that. So I don't expect there to be wide knowledge about how it works, still... The Dweomer uses it with the option of choosing from Known Spells. And with this option the opcode works. I made a custom spell and made my illusionist learn it. When he cast it, he was able to choose from his range of standard spells. The problem is with the much more interesting option of choosing from a custom 2DA. I drew up one with a few homemade spells on it, and the character just won't cast them. The icon for the chosen spell flickers over the portrait, but nothing actually happens.

 

My first guess was that there was some kind of a problem with these spells, but the character can learn them separately, outside of the plug-in, and cast them. On the other hand, if I add to that 2DA a regular spell - I put in Magic Missile - then that spell is not cast either. What's going on?

 

Edit: as I was typing this, I thought of another possibility - that with the "Choose from a 2DA" option the character may need to have the spells on the list memorized. That would have been a bad limitation, because obviously the "Select spell" is a boot in the door and an entry to other spell options that a modder wouldn't want to give players directly. So I tested for it: made my gnome memorize a MM together with the 214 spell. And this time the magic missile did fly.

 

So there you have it - memorized spells only. Now, what could we do to bypass this limitation? Give the caster the spells on the list together with the casting, to expire in, say, 6 seconds? I'm open to suggestions.



#2 Gwendolyne

Gwendolyne
  • Administrator
  • 1016 posts

Posted 13 March 2017 - 02:23 PM

Post your 2da file to check if it is right written. I don't have any crystal ball...

 

And no, you don't need to know the spells chosen that way.


Edited by Gwendolyne, 13 March 2017 - 02:24 PM.

CARPE DIEM ....
 

In progress : Menace sur le Royaume de Diamant Éternel there.


#3 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 13 March 2017 - 03:05 PM

Also to ensure that other things are OK, you will want to upload the .spl as well(and the possible .eff's) etc.


Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#4 -kjeron-

-kjeron-
  • Guest

Posted 13 March 2017 - 06:09 PM

Spell Immunity, Summon Spirit Animal, and the former Enchant Weapon all use the 2da version, you can compare the files format with their's.

 

The requirements for the listed spells depend on what type you give for each spell in the 2da:

 

1: Follows all rules for normal spell-casting(memorization, decrementation, 1/round, etc), but does not work at all for Caster-targeted spells.

 

2: Does not Work, older version of the engine may crash.

 

3: Spell ignores 1/round rule, does not require memorization nor decrement a copy if memorized.  Uses normal casting time and level.

 

4: Identical to 3, except casting level varies depending on game/version/target. (some use caster level, some use level 1, some use lowest level, some use highest level).

 

5: Spell ignores 1/round rule and is cast instantly(even if paused), does decrement memorizations for the spell, but does not require the spell be memorized, 



#5 Galactygon

Galactygon

    Modding since 2002

  • Member
  • 938 posts

Posted 13 March 2017 - 10:36 PM

Spell Immunity, Summon Spirit Animal, and the former Enchant Weapon all use the 2da version, you can compare the files format with their's.

 

The requirements for the listed spells depend on what type you give for each spell in the 2da:

 

1: Follows all rules for normal spell-casting(memorization, decrementation, 1/round, etc), but does not work at all for Caster-targeted spells.

 

2: Does not Work, older version of the engine may crash.

 

3: Spell ignores 1/round rule, does not require memorization nor decrement a copy if memorized.  Uses normal casting time and level.

 

4: Identical to 3, except casting level varies depending on game/version/target. (some use caster level, some use level 1, some use lowest level, some use highest level).

 

5: Spell ignores 1/round rule and is cast instantly(even if paused), does decrement memorizations for the spell, but does not require the spell be memorized, 

Oh wow, this information has never been posted in the IESDP, thanks for the find!


Posted Image

#6 temnix

temnix
  • Member
  • 983 posts

Posted 14 March 2017 - 01:45 PM

Yes, thanks, kjeron. My version of the 2DA did not have the type at all. It wasn't correctly formatted. Now I'm going to imitate the list from Spell Immunity, which uses type 3.

 

Yup, that worked. No need for my workaround. :lol2:

 

Now another thing. The 2DA list has four spells on it, three are regular and the fourth is supposed to turn the targets into a variety of creatures. It uses the polymorph effect. The choice of creatures should be random between castings, but within a casting should all be of the same kind. One time the targets will turn into fat men, the next time it may be dogs or bats etc. How to accomplish that - with minimal effort? If I just put several polymorphs with different probabilities in the spell ability, the roll will be made for every target. Like this:

 

To fat man 100-70

To dog 69-49

To spider 48-20...

 

That's not right. To avoid this randomness, a spell ability can only have one type of creature, but there need to be either several spell abilities or several spells. With abilities in the same spell the choice is only determined by caster level, yes? I can't have two spell abilties with Minimum level 1, can I? Well, assuming I can't or that only one of those would trigger, it remains to create several spells, one for each polymorph. But the root spell goes on the 2DA with the others, how can it be randomly chosen? The only thing that comes to my mind is making several 2DAs, identical except for the fourth spell. And the super-root spell can have those probabilities for the "Select spell" effects. The player won't know that there is a random roll of the menu every time.

 

Still, this strikes me a labor-intensive solution.

 

In addition to that, another problem has come up. When I cast the sell number four - I'll put the cards on the table, it's Phantasmal Force - through the 214 opcode, then for some reason I don't get the benefit of the "number of targets" mechanic. That field in Spell ability lets you choose several recipients for the effects on the list. In this case the number in that field is 2. Used through 214, only the last of the targets receives the effects, or maybe the last target receives all of the applications at once, it's hard to say. When I made a scroll that taught the character this fourth application of Phantasmal Force directly, as a spell to be cast, it worked as intended, and both targets transformed.

 

Just now I checked the isotope 214 version and the simple man's version to make sure I hadn't changed anything in-between. I hadn't. I cast it through 214 (tried all of the valid types from kjeron's list), then I cast it directly, the difference is there.


Edited by temnix, 14 March 2017 - 05:35 PM.


#7 -kjeron-

-kjeron-
  • Guest

Posted 15 March 2017 - 07:29 AM

You'll need to use type 1 if its manual multi-target.  It does work, but its very strict about spell-casting rules, and almost impractical for use with wizard/priest spells.  If this subspell(Phantasmal Force) is a wizard/priest spell, either change it to innate(if this is its only use) or create an innate duplicate of it(if you still need a wizard/priest version), and make sure this versions level is not 0.

 

In the base Spell, for each subspell that allows multi-targeting, add as Global Effect:
Give Innate Ability "SubSpell#"

Since the spell is now innate, it will come pre-memorized, so you can use it with type 1.

 

In each of these "Subspell#"'s, set the ability location for each spell level to Unknown(3), so it is not available to the character.

Then, again for each subspell that allows multi-targeting add as a Global Effect:

Remove Spell "SubSpell#"

This will keep the subspells from accumulating on the character, which while usually harmless, unnecessarily bloats the creature file, sometimes to a ridiculous extent.

 

None of this will be visible to the player.



#8 temnix

temnix
  • Member
  • 983 posts

Posted 15 March 2017 - 12:01 PM

That's how I did it originally. I was hoping to avoid this with the numbered spell types. Well, I'll try to use type 1 and add a manual increase of Spells Cast Per Round. I wish I could avoid that "Aura Cleansed" message, though. I can just wipe it clean from the 2DA files - anybody going to miss it? I don't know if that opcode works with aura cleansing on "No."

 

By the way, all effects in a spell ability use a common saving throw, don't they? I only need one check there for all of them to apply or not apply. But what if I want some effects to always apply, like the appearance change, but further effects to apply sometimes - in this case the creature may or may not be confused by the makeover?

 

And also on the subject of the confusion opcode: which creature types or races are hard-coded to be immune to it? I know undead are, so it isn't necessary to put any filters in the spell if it's thrown in a mixed crowd, but I'm not so sure about golems or slimes. Elves and half-elves, for example, only get immunities to sleep and charm where the designers put filters in the corresponding spells.



#9 temnix

temnix
  • Member
  • 983 posts

Posted 15 March 2017 - 12:33 PM

Okay, opcode 267 did it for the aura, and the rest worked nicely with type 1. Winthrop is a dog!



#10 -kjeron-

-kjeron-
  • Guest

Posted 15 March 2017 - 01:43 PM

That's how I did it originally. I was hoping to avoid this with the numbered spell types. Well, I'll try to use type 1 and add a manual increase of Spells Cast Per Round. I wish I could avoid that "Aura Cleansed" message, though. I can just wipe it clean from the 2DA files - anybody going to miss it? I don't know if that opcode works with aura cleansing on "No."

Why do you want/need the Arua Cleansing effect?  The base spell can already ignore the 1/round rule, and the subspell will queue to cast as soon as it can, so you don't lose any casting speed compared to casting a spell normally.  Or do you want to have the entire thing ignore 1/round like Nahal's does?

 

By the way, all effects in a spell ability use a common saving throw, don't they? I only need one check there for all of them to apply or not apply. 

That's the opposite of how it works.  Each effect needs its saving throw set individually.  You can use a different save, (best of)multiple saves, and varying bonus and penalties for each effect in a spell.

All effects in a spell do use the same dice roll for a given saving throw and target.  If 2 effects have the same save type and bonus, a given target will either succeed both or fail both.

 

Elven Charm and Sleep immunity is the exception, not the norm.

Most effects that creatures are immune to are provided by undroppable equipment.



#11 temnix

temnix
  • Member
  • 983 posts

Posted 15 March 2017 - 02:03 PM

Yes, how Nahal's does it: the main spell is only a shell, and the spell of choice from the book is cast immediately. That's how Phantasmal Force works too - the main spell just turns on the interface with choices for shaping the illusion. But I have to correct myself - no, I can't seem to get rid of the Aura Cleansed string. There is only one string with that content in the TLK, I put a 267 on it, even tried putting it in Global Effects of the main spell - it still shows up. Also, do you know if there is any way to do away with the spell-cast messages? There are a few too many for my liking. First there is the main spell, then that stupid Aura, then each of the charges is spelled out in the window too. Like a short story from just one casting.

 

About saving throws. Yes, that's good to know. I took away the saving throw for the transformation and left it for the disabling effects.

 

While we are on this: what is the "Allow spotting" flag?


Edited by temnix, 15 March 2017 - 02:04 PM.


#12 -kjeron-

-kjeron-
  • Guest

Posted 15 March 2017 - 02:35 PM

You can't stop most hardcoded effects with other opcodes.

You can effectively delete this string with Weidu, at least for this purpose.

STRING_SET 23797 "<NO TEXT>"

This will prevent it from being displayed after every cast.

 

The subspell's casting can either show for all targets or never, there is no in-between.

If you set the spells name to string reference "-1" it will not display its casting string, but it also won't display anything on its tooltip.

 

Allow Spotting - No clue.



#13 -kjeron-

-kjeron-
  • Guest

Posted 15 March 2017 - 04:18 PM

Never mind about editing the Aura Cleansed String, something else was interfering.



#14 temnix

temnix
  • Member
  • 983 posts

Posted 15 March 2017 - 05:34 PM

What do you mean?



#15 -kjeron-

-kjeron-
  • Guest

Posted 15 March 2017 - 07:43 PM

Bad memory, the <NO TEXT> token doesn't work here.

Use:

STRING_SET 23797 ""

to disable the Aura-Cleansed feedback



#16 temnix

temnix
  • Member
  • 983 posts

Posted 16 March 2017 - 08:39 AM

Okay, will do. Thanks again. Since you seem to know Weidu, can you tell me how to patch a spell -> spell ability -> effect no. X -> property no. Y ("# dice throws/maximum level/")? I have a hideous number of these spell abilities and effects in them, most of which need to be edited to say "6" in that field. If you can save me this hour of my life, you're definitely going in the thanks section.


Edited by temnix, 16 March 2017 - 08:40 AM.


#17 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 16 March 2017 - 01:54 PM

I don't know about editing... but if you have them without the effect, you can add them into the spells via patch function like this(scroll down to find the "ADD_SPELL_EFFECT" -part):
COPY_EXISTENT ~targetspell.spl~ ~override~
LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode = ~plah~ target = ~plah~ timing = ~plah~ resist_dispel = ~plah~ probability1 = 100 END
The plah being your variables to the function request with the = before it.
This for example uses the opcode 261 to restore a level 1 divine spell when ever the spell is casted...
COPY_EXISTING ~sppr103.spl~ ~override~
      LPF ~ADD_SPELL_EFFECT~ INT_VAR opcode = 261 target = 1 parameter1 = 1 parameter2 = 1 timing = 4 duration = ~60~ resist_dispel = 2 probability1 = 100 END
..after 60 seconds, if the spell casting is successful. Aka this makes the cure light wounds spell able to restore itself.

The OPCODE is probably the X you were asking about and the Y was the variable either the dicenumber or dicesize, ps, the question you asked is NOT exact, so I can't give you and exact answer, just like you have yet to attach the files I requested ..

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#18 temnix

temnix
  • Member
  • 983 posts

Posted 17 March 2017 - 08:36 AM

It's editing I need - editing of a large number of lines. And the other question has been resolved already.