Skip to content

Casting spells underwater

AurikAurik Member Posts: 4
I'm new to all this building and scripting. I have an idea of a few underwater flooded tunnels and rooms in a dungeon. I have found a way to make it so the players need water breathing items to simulate being underwater and not drowning. I however still can't find any information on how to make it so fire spells can't be cast in the underwater areas. Is there a way currently and how difficult is it to set up?

Comments

  • FreshLemonBunFreshLemonBun Member Posts: 909
    You have to recompile all of the affected spell scripts accounting for underwater areas.
  • ShadooowShadooow Member Posts: 402
    If all you need is to restrict certain spells, that is easy to do in spellhook. Just check for area tileset or variable and then cancel spells you don't want there to be cast.

    If you want to modify their effect, that is more difficult and will require of rewriting all the affected spells. It could be done in spellhook again, but it can get too messy there. Depends on what you want to replace it with and if that effect will be shared with multiple spells or each spell gets unique treatment.
  • AurikAurik Member Posts: 4
    Thanks FreshLemonBun for responding. Recompile as in edit the spells.2da? Or do you mean something else? The only thing I found was something called "Grimoire underwater rules" but I'm not sure if that is actually working, an old post or something else entirely.
  • AurikAurik Member Posts: 4
    Thanks for responding Shadooow. I'm checking over the spellhook information but as a novice it's still a little confusing. I have no experience at all with scripting or programming languages.
  • ProlericProleric Member Posts: 1,316
    You can't do much here without learning to script a bit. As others have said, the choices are - use the spell hook script (probably easier) - or - edit and recompile the individual spell scripts.

    Depending on your learning style, you may prefer Tarot Redhand's tutorials, the Lexicon lyceum, or Lilac Soul's Script Generator (which won't solve this problem for you, but will generate scripts from which you can glean how the basics work).

    The simple restriction would be a breeze in the spell hook if you can swot up on the basics.
  • FreshLemonBunFreshLemonBun Member Posts: 909
    I agree you need to learn to work with scripting to do most interesting things. It's not that hard for some of us non-technical people and there are a lot of easy tutorials on Youtube for things like website scripting which is similar to NWScript.
  • SyrusGreycloakSyrusGreycloak Member Posts: 10
    edited July 2020
    I did this in my Grimoire project that I haven't touched in years (I've only come back to NWN sparingly in the last year and I'm working on a module project). I added an Underwater column to spells.2da (among other things) and the spellhook script looks for a variable ("UNDERWATER") that was set on the caster or the caster's area (what @Shadooow was referencing above). It then checks for casting fire spells underwater, including spells where you switched energy types (I implemented Energy Substitution feats).

    Feel free to use it or tear it apart for your own uses. I don't promise it's without some bugs somewhere. Now that Beamdog made updates, I should probably revisit and update it, but I really want to get the module I'm working on done first.
Sign In or Register to comment.