Jump to content
Sign in to follow this  
Farmboy0

[IWD1] state of modal states

Recommended Posts

Hello everyone,

 

I am not sure if this is common knowledge around here.

If it is I apologize, I am new around here.

 

I recently started playing Icewind Dale 1 again and installed and used Yovaneth's Icewind Dale Scripts which I conviniently downloaded from spellhold studios. Unfortunately they proved to be dissatisfactory. Esp my Bard was doing nothing in combat.

 

Trying to find out why this happened I took the scripts apart to see what makes them tick.

After some changes of my own the script still didnt act to my satisfaction.

 

This led me to test modal states and their functions further with some simple test script I made.

 

Here is what I found out:

 

A modal state is a state a character can be in where he passively carries out an action in the background.

This state stays active for as long as the character isn't ordered to do something else except walking.

 

As you are probably aware Icewind Dale 1 features 5 modal states:

* 0 NONE

* 1 BATTLESONG

* 2 DETECTTRAPS

* 3 STEALTH

* 4 TURNUNDEAD

 

Each of this states can be respectively entered per script with the following action:

* 0 NoAction()

* 276 PlayBardSong(I:BardSong*bardsong)

* 13 FindTraps()

* 18 Hide()

* 33 Turn()

 

These functions when called by script will behave differently though as they would were they used through the GUI.

 

1.PlayBardSong

a) makes the script start over, Continue() doesn't work

b) sets the modal state of the character to BATTLESONG for the next second(script getting processed once with modal state set then modal state is reset to NONE)

c) highly unreliable, characters may not get the effect of the bard song(when continuely calling PlayBardSong it can take up to a minute till characters actually receive the effect)

 

2. FindTraps

a) makes the script start over, Continue() doesn't work

b) sets the modal state of character to DETECTTRAPS for the next second(script getting processed once with modal state set then modal state is reset to NONE)

 

3. Hide

a) can be called every second, the GUI forces a recast time of 6 seconds by disabling the button

b) modal state is only set to STEALTH when hiding is successful and only for next 6 seconds(6 processings of the script), then it is reset to NONE

c) the stealthed character will check positive to a state check to invisibility(0x00000010 STATE_INVISIBLE)

c) a successful hide breaks the Hide function in such a way that it cannot be called successful again, there will not even be text saying hide in shadows failed/successful

 

Workaround for the broken Hide function:

1. disable the AI

2. when the button is available, activate Stealth from the GUI, hotkey works too

3. wait for a successful/failed stealth attempt, this can take up to a minute

4. enable the AI again

 

4.Turn

not tested yet

 

Also the Backstab function doesnt crash the game anymore, it simply wont do anything.

(At least in my game it didn't)

Share this post


Link to post

In ToB, it crashes (calls assertion).

In HoW and iWD2, it parses the object, but doesn't do anything with it.

Edited by Avenger

Share this post


Link to post

After playing around more with PlayBardSong I discovered the following:

It works reliably if you only call it once per different song you want to play.

So calling PlayBardSong to play a different song from the one currently active will work.

Calling the same song repeately will not.

Share this post


Link to post

I've added some of this into the local copy; other parts seem implicit in the meaning of the word modal.

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...