Jump to content


Photo

Protection From Spell


  • Please log in to reply
32 replies to this topic

#1 T.G.Maestro

T.G.Maestro

    Eclipse

  • Member
  • 4415 posts

Posted 25 October 2004 - 06:27 AM

I have a big problem. I encountered great difficulties when I tried to make a spellcaster unable to cast a specified spell twice in a specified duration. I'll explain:

I intend to make an innate spell that after cast, makes the caster unable to cast other (SPECIFIED!) innate spells/abilities for a set duration. Normally I'd use a nice Protection from Spell opcode to do this, but here comes the problematic part. I noticed that this opcode cannot protect against spells/abilities that use .pro files to apply their effects on the targets. For example I can be protected from Stoneskin (since it uses no projectiles at all), but cannot make the caster unable to cast Meteor Swarm for example (because of that damn .pro).

My question would be: how can I make the caster unable to cast "projectiled" innate spells by a spell?

Thanks for any help, I'm waiting for any good suggestions!
TG
Posted Image

Refinements v2 has been released!
Go and visit the website or the forum for more info!

Member of The Silver Star team.

#2 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 25 October 2004 - 06:41 AM

Please learn to use the IESDP. Opcode 83, protection from projectile, will do this.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#3 T.G.Maestro

T.G.Maestro

    Eclipse

  • Member
  • 4415 posts

Posted 25 October 2004 - 06:50 AM

Thanks, I'll give it a try immediately (I REALLY don't know, how I missed that opcode... :blink: ).
A note though, the description of this opcode looks rather... odd:

#83 (0x53) Protection: From Projectile [83]
    Parameter #1: Irrelevant
    Parameter #2: Type
    Description:
    Gives the targetted creature(s) immunity to the weapon type
    specified by the 'Type' value
.


Edited by T.G.Maestro, 25 October 2004 - 06:51 AM.

Posted Image

Refinements v2 has been released!
Go and visit the website or the forum for more info!

Member of The Silver Star team.

#4 T.G.Maestro

T.G.Maestro

    Eclipse

  • Member
  • 4415 posts

Posted 25 October 2004 - 07:25 AM

Hmm, sorry Cam, but even after "having learned to use the IESDP", the problem remains - the opcode you mention won't do too much in this case, at least I'm unable to make it so.

Here is what I do/did:

I created an innate ability, with a brand new area-effect projectile. Now, to make it unuseable for a while after it has been cast, I added the opcode: Protection from Projectile (83). My new .pro file used the 0x111 (273) value in the IDS, so I set this as the value to be protected from. And guess what? I was able to use that same innate ability again, right in the following round. <_<
After this I tried to apply this opcode via an EFF file, still no use.
The third time I tried to apply it via a spell cast on the caster (by the starting ability) that has this opcode protection. Still no use, the innate remained useable.

If I'm doing something wrong, please tell me.

Oh, and there is a good reason why I don't use the IESDP as my only source of knowledge: while it has all the basic info on a subject, many times it cannot be relied upon completely.
And I guess there is nothing wrong in asking another (perhaps more experienced) modder, thats what this forum is about AFAIK. ;)

As a summary, my question is the same: how is it possible to make an innate ability (one that uses a projectile) unuseable by itself or another spell for a limited time?

Edited by T.G.Maestro, 25 October 2004 - 07:26 AM.

Posted Image

Refinements v2 has been released!
Go and visit the website or the forum for more info!

Member of The Silver Star team.

#5 Stone Wolf

Stone Wolf
  • Member
  • 1672 posts

Posted 25 October 2004 - 07:35 AM

I'll second that request. I've got some areas planned (for the second portion of my mod, so no rush) that some schools of magic don't work in. I can just apply immunities to schools to all creatures, but that's a little awkward.

#6 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 25 October 2004 - 07:51 AM

Usually when I have problems getting an opcode to work, it's generally something funky with the targeting, timing or something else I've overlooked. When I run into these problems I take a look at how other spells use the same opcode--try looking at SPWI311 (protection from normal missiles), Inertial Barrier (SPIN546), or Storm Shield (SPCL721). You may need to use both the spell protection opcode in addition to the projectile immunity.

One other side note about the projectile immunity thing--unlike the spell protection opcode, it does not display a string that indicates it has failed or has no effect. And being immune to a projctile or spell does not mean you can prevent a spell from being cast--just from it taking effect.

And if anyone finds incorrect or incomplete information in the IESDP, report it! It's constantly being updated and researched with the goal of being comprehensive and accurate. :)


edit: After re-reading uour post, it appears you want the caster to be unable to cast the same innate ability again--protecting from the opcode and projectile will make them immune to the effects of the spell, but they will still be able to cast it. I can't think of a non-hacky way to do this, unless you know exactly how many other memorizations of the spell they have.

Edited by CamDawg, 25 October 2004 - 07:55 AM.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#7 T.G.Maestro

T.G.Maestro

    Eclipse

  • Member
  • 4415 posts

Posted 25 October 2004 - 07:59 AM

Ca, I think the problem of your suggestion (and all the examples you list) is that they affect the caster to be immune to the effects of that projectile. This, and not being able to CAST that spell by the projectile are two different things. While the first can protect you from that projectile if it is targeted at you (for example Protection from Normal Missiles protects YOU from the listed projectiles when they are targeting you, yet what I need makes the caster unable to use a spell using that exact .pro file). I hope you can follow me here :D .

Anyway, as I said, the problem remains the same as I described in my previous post. ;)
Posted Image

Refinements v2 has been released!
Go and visit the website or the forum for more info!

Member of The Silver Star team.

#8 T.G.Maestro

T.G.Maestro

    Eclipse

  • Member
  • 4415 posts

Posted 25 October 2004 - 08:06 AM

I'll ask it a bit different then.
Lets imagine that we modify Meteor Swarm to be an innate ability. Good.
Now, we want to make it sure that even if the player has 5 castings/day of this innate, he won't be able to use it in 1 hour for example after it has been cast.

In this case we cannot add the Protection from Spell opcode, it only works for spells/abilities WITHOUT .pro files. Yet as I described above, the Protection from Projectile opcode won't help either, at least I don't know whats wrong.

Could you detail step by step the process you'd solve this problem with Meteor Swarm above? (I mean what settings would you use, where and how?)
Posted Image

Refinements v2 has been released!
Go and visit the website or the forum for more info!

Member of The Silver Star team.

#9 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 25 October 2004 - 08:07 AM

Then I think what you're looking for is impossible--short of removing disallowed spells and restoring them at the end of the innate duration or disabling the spellcasting or innate button outright, I do not think it is possible to prevent *casting* of a spell. The next best solution is simply to make everyone under the effects of the innate immune to subsequent castings of said innate--protection from the spell and projectiles would be the way to go about this.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#10 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 25 October 2004 - 08:14 AM

I can only think of ugly, hacky solutions for your meteor swarm question.

One possible solution is the old invisible creature trick. The spell would actually summon an invisible creature with a script--if the timer is expired (or not set), it casts the spell for you. If the timer is not expired, it would not cast and could disply a string that the hour has not been expended. It still would not prevent the player from casting of the spell, though it would keep the actual Meteor Swarm-esque spell from appearing. The scripting would be a bit more complex, as you would have to allow each party member to have a separate timer, but it would work.

Another option would be to use LOCALS variables to track how many castings the player has. When the spell is cast, you could remove all copies of the spell from memory, and then restore them after an hour has expired. This would prevent the spell from being *cast*, but then anything involving the spell (from granting it to casting to resting) would need to deal with this variable. Another drawback is that if the player rests during this time, they'll get their spells restored from resting + ones restored from the spell/script.

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#11 T.G.Maestro

T.G.Maestro

    Eclipse

  • Member
  • 4415 posts

Posted 25 October 2004 - 08:27 AM

Then I think what you're looking for is impossible

Exactly what I feared when I aksed my starting question... :(

short of removing disallowed spells and restoring them at the end of the innate duration or disabling the spellcasting or innate button outright

Neither of those are useful in the situation we're in over at Refinements (the TD project, see for details here. ;)

I do not think it is possible to prevent *casting* of a spell.

A spell using a .pro file, to be precise. It is possible to use the Protection from Spell opcode everywhere else...

The next best solution is simply to make everyone under the effects of the innate immune to subsequent castings of said innate--protection from the spell and projectiles would be the way to go about this.

Using my example above (the one with Meteor Swarm) it is only the caster who should be unable to CAST that innate again in a set duration.
Posted Image

Refinements v2 has been released!
Go and visit the website or the forum for more info!

Member of The Silver Star team.

#12 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 25 October 2004 - 08:52 AM

I do not think it is possible to prevent *casting* of a spell.

A spell using a .pro file, to be precise. It is possible to use the Protection from Spell opcode everywhere else...


Protection from Spell does not prevent casting. ;)

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.


#13 Cuv

Cuv

    Area Maker (retired)

  • Modder
  • 925 posts

Posted 25 October 2004 - 10:08 AM


I do not think it is possible to prevent *casting* of a spell.

A spell using a .pro file, to be precise. It is possible to use the Protection from Spell opcode everywhere else...


Protection from Spell does not prevent casting. ;)

View Post


Why not try an effect in your spell

Disable Spellcasting (145).... for a short duration?

#14 Littiz

Littiz
  • Modder
  • 1078 posts

Posted 25 October 2004 - 10:53 AM

<_<
@TGM, it's good to notice that still you don't trust my words <_<
:bash:

You might finally accept that the solution I proposed more than a week ago took already in account ALL the issues we needed to solve. -_-
So, either we use my solution or we'll have to renounce to something (for example the cooldown time, that might be replaced by other penalties... actually not a terrible option, imho ;) )

@Cuv: unfortunately we'd need a long but spell-specific effect here :)
@Cam: hey, do you ever happen to code something simple :P :D (j/k ;) )

Edited by Littiz, 25 October 2004 - 10:59 AM.

Ever forward, my darling wind...


#15 Caedwyr

Caedwyr

    Wraith Editor

  • Member
  • 962 posts

Posted 25 October 2004 - 12:30 PM

One possiblity that came to mind, was to replace the Spell meteor storm with a dummy spell during the time period it cannot be cast in.

So,

1a. Have a counter which keeps track of the number of times the spell has been cast per rest period.
1b. Have a timer to keep track of when Meteor Storm was last cast successfully
2. Have the spell Meteor Storm as an innate with 5 casts per rest period, for example.
3. When Meteor storm is cast, the counter is increased by one.

4. Meteor Storm is removed from the innate abilities (opcode 172 or 173, I can't remember which)

5. Meteor Storm is replaced with a second spell Meteor Stormb (Also called Meteor Storm, same icon), but with a different effect. This spell remains in place until the timer in 1b has expired at which time it is replaced by the original Meteor Storm. When the player attempts to cast Meteor Stormb, the dummy spell returns a message saying "You must wait x time until Meteor Storm may be cast again". This dummy spell is made to behave like an at-will ability, so it is immediately replaced after being cast.

6. When the timer in 1b has expired, Meteor Stormb is removed and is replaced by Meteor Storm with number of uses remaining equal to INITIAL # OF USES - COUNTER IN 1a



Hacky for sure, but it may actually work.
"Knowledge is Power. Power Corrupts. Study Hard. Be Evil." - Ferret

PnP Celestials
Geomantic Sorcerer Kit

#16 T.G.Maestro

T.G.Maestro

    Eclipse

  • Member
  • 4415 posts

Posted 25 October 2004 - 01:06 PM

@TGM, it's good to notice that still you don't trust my words 

You might finally accept that the solution I proposed more than a week ago took already in account ALL the issues we needed to solve.

And introduces new problems. Frankly, its like the old discussion about Inner Time.. it's not like I don't read or hate your ideas, its only that they have their (hidden) costs. I already detailed this in the Refinements forum.
And the fact that I try to get possible solutions from every source of knowledge I know is not equal with the fact that I *trust* your words.

for example the cooldown time, that might be replaced by other penalties... actually not a terrible option, imho

Exactly what I had in mind these days. We'll discuss it in the forum later, maybe tomorrow.

Protection from Spell does not prevent casting.

It prevents the effects to be applied by the specified spell. It is nearly the same technically.

One possiblity that came to mind, was to replace the Spell meteor storm with a dummy spell during the time period it cannot be cast in.

Might work, but definitely mind-draining for more than 10 different spells... :P
Posted Image

Refinements v2 has been released!
Go and visit the website or the forum for more info!

Member of The Silver Star team.

#17 -Guest-

-Guest-
  • Guest

Posted 25 October 2004 - 01:14 PM

And introduces new problems. Frankly, its like the old discussion about Inner Time.. it's not like I don't read or hate your ideas, its only that they have their (hidden) costs. I already detailed this in the Refinements forum.

And how did it end with Inner Time?
We removed the stuff that I said we had to remove from start.

Protection from Spell does not prevent casting.

It prevents the effects to be applied by the specified spell. It is nearly the same technically.

Totally different actually. You can't place a 5-hours long protection effect upon ALL the creatures of ALL the areas where the party MIGHT go ;)

#18 Littiz

Littiz
  • Modder
  • 1078 posts

Posted 25 October 2004 - 01:15 PM

what the..?!?!
That was me.

Ever forward, my darling wind...


#19 Caedwyr

Caedwyr

    Wraith Editor

  • Member
  • 962 posts

Posted 25 October 2004 - 02:02 PM

Might work, but definitely mind-draining for more than 10 different spells...


Which could be an argument to limit the number of True Dweomers if you do decide to go this method.
"Knowledge is Power. Power Corrupts. Study Hard. Be Evil." - Ferret

PnP Celestials
Geomantic Sorcerer Kit

#20 CamDawg

CamDawg

    ALL GLORY TO THE HYPNOTOAD

  • Modder
  • 1505 posts

Posted 25 October 2004 - 04:51 PM

@Cam: hey, do you ever happen to code something simple :P :D (j/k ;) )


Hehe, no. You know that. ;)

Out of curiousity, is your solution for this specific problem or was it to re-define the problem? If the former, please share--I always like to learn new coding tricks. :)

Why is this Hypnotoad video so popu... ALL GLORY TO THE HYPNOTOAD.
____
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.