Jump to content


Photo

Question about feature/bug: change to the NoAction() script action


  • Please log in to reply
9 replies to this topic

#1 Dan_P

Dan_P
  • Member
  • 6 posts

Posted 09 December 2021 - 11:17 PM

Update: If anyone else runs into this issue with their own scripts, it's fixed in the DLL file linked in this post.

 

 

Hi, I noticed installing ToBEx (v26 or v28) core component changes the NoAction() script action to remove Modal states (Find Traps, Turn Undead, etc.). I didn't see any mention of this in the TobEx_ini.txt. Anyone know if this is intended behavior or a bug? It's different from not only the unmodded game, but also other IE games, including the EEs, IWD1, and IWD2.

I was thinking it was unintended, since there are already ways to remove a Modal state, without taking any obvious action, such as using ClearActions() or setting a short timer. The change removes an easy way to maintain a Modal state, while preventing other script blocks below it from running.

I did figure out that disabling the "Expanded Actions" hack in TobExCore.ini reverts the change, but doing that will also remove some other stuff.


Edited by Dan_P, 22 April 2022 - 10:39 AM.


#2 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 13 April 2022 - 04:06 PM

Hi Dan_P

 

Can you provide script to test NoAction() for char with Modal state abilities(find trap/turn undead/...)

I don't know how to correctly write SCRIPTS, so ask you for help



#3 Dan_P

Dan_P
  • Member
  • 6 posts

Posted 16 April 2022 - 09:43 AM

Hi Dan_P

 

Can you provide script to test NoAction() for char with Modal state abilities(find trap/turn undead/...)

I don't know how to correctly write SCRIPTS, so ask you for help

 

Sorry for the late response. You can use the attached file. Just put in scripts folder. It'll appear as Custom (noaction). It only has one block in the script, which is this:

 

IF
	ActionListEmpty()
	OR(4)
		ModalState(BATTLESONG)
		ModalState(TURNUNDEAD)
		ModalState(STEALTH)
		ModalState(DETECTTRAPS)
THEN
	RESPONSE #100
		NoAction()
END

 

Basically, if you use one of these modals, the script will trigger NoAction(). As mentioned in my other 2 posts, without TobEx, modals are unaffected. With the TobEx core component + Expanded Actions hack, the NoAction() will stop them.

 

Also, I saw you posted in the Improved GUI thread that you have a fix for the crashing issue, so thanks for that.

Attached Files


Edited by Dan_P, 16 April 2022 - 09:50 AM.


#4 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 20 April 2022 - 09:18 AM

Hi Dan_P

Basically, if you use one of these modals, the script will trigger NoAction(). As mentioned in my other 2 posts, without TobEx, modals are unaffected. With the TobEx core component + Expanded Actions hack, the NoAction() will stop them.

Please check fixed .dll, just replace existing

This is bug with original engine, it removes modalstate for most action opcodes except:

0    NOACTION
23 MoveToPoint
22 MoveToObject
84 Face
18 Hide
83 SmallWait
99 ???
89 Follow
90 MoveToPointNoRecticle
215 FollowObjectFormation
63 Wait

Expanded Actions adds new CLEAR_BLOCK_VARIABLES action opcode, this opcode is always active in scripts (i don't understand original TobEx's idea of it) and causes modal change, i just added CLEAR_BLOCK_VARIABLES to exception list.

List is still bugged, for example when you want to DisplayString(Myself,xxxx) in scripts, you get same modal removing

 

https://ufile.io/1nbsmoxo



#5 Dan_P

Dan_P
  • Member
  • 6 posts

Posted 21 April 2022 - 10:03 AM

Please check fixed .dll, just replace existing

 

Hi, thanks for taking a look at this. I tested the DLL. This is what I observed (tested with the above script as well as my own script mod).
 
Expanded Actions enabled:
- NoAction() no longer disrupts modal actions.
- however, the NoAction() keeps the character constantly in an action stance while the modal is active.
- the normal behavior, without Tobex, is the NoAction() does not put the character in an action stance (character stands normally).
 
Expanded Actions disabled:
- has the correct behavior, NoAction() does not stop modals and also does not put the character into an action stance.
 
So the DLL fixes the main issue of NoAction() disrupting modal states. Seems like the Expanded Actions hack is still doing something to change NoAction(), though it's more of an aesthetic issue with the action stance.


#6 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 21 April 2022 - 10:26 AM

Hi Dan_P

Expanded Actions enabled:
- however, the NoAction() keeps the character constantly in an action stance while the modal is active.
Please explain what do you mean "action stance", may be some example ?


#7 Dan_P

Dan_P
  • Member
  • 6 posts

Posted 21 April 2022 - 11:10 AM

Hi Dan_P

Expanded Actions enabled:
- however, the NoAction() keeps the character constantly in an action stance while the modal is active.
Please explain what do you mean "action stance", may be some example ?

 

Sorry, I didn't know the correct term so I just called it "action stance". I think it's the same as the combat stance? Basically, you know when you perform actions such as clicking the Turn Undead icon, the character leans forward slightly, then stands straight back up? Using the above script, when a modal is active, the character is always leaned forward. The normal behavior is the character stands normally, as if no script action was being triggered.

 

The difference can be tested really quickly just be disabling or enabling the Expanded Actions hack, and using a modal action in the game.



#8 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 22 April 2022 - 05:36 AM

Hi Dan_P


 


Expanded Actions enabled:
- however, the NoAction() keeps the character constantly in an action stance while the modal is active.

Please explain what do you mean "action stance", may be some example ?

 

 
Sorry, I didn't know the correct term so I just called it "action stance". I think it's the same as the combat stance? Basically, you know when you perform actions such as clicking the Turn Undead icon, the character leans forward slightly, then stands straight back up? Using the above script, when a modal is active, the character is always leaned forward. The normal behavior is the character stands normally, as if no script action was being triggered.

This is READY animation (SEQ_READY), at idle char must have HEAD_TURN animation
 
Again missed check for new CLEAR_BLOCK_VARIABLES action, i added it to exclusion list when engine try to set READY animation sequence. I think when new opcodes was added, Ascension64 didn't found depended checks. When you reported about bugs, i found two checks, but there can be more, it is impossible to found it staticaly. NOACTION opcode used in ~100 places inside engine, CLEAR_BLOCK_VARIABLES must have same behaviour, so theoricaly we must to check agains this opcode too in these 100 places :(
 
https://ufile.io/s89h87qr


Edited by Insomniator, 22 April 2022 - 05:43 AM.


#9 Dan_P

Dan_P
  • Member
  • 6 posts

Posted 22 April 2022 - 10:32 AM

This is READY animation (SEQ_READY), at idle char must have HEAD_TURN animation
 
Again missed check for new CLEAR_BLOCK_VARIABLES action, i added it to exclusion list when engine try to set READY animation sequence. I think when new opcodes was added, Ascension64 didn't found depended checks. When you reported about bugs, i found two checks, but there can be more, it is impossible to found it staticaly. NOACTION opcode used in ~100 places inside engine, CLEAR_BLOCK_VARIABLES must have same behaviour, so theoricaly we must to check agains this opcode too in these 100 places :(
 
https://ufile.io/s89h87qr
Thanks, I'll remember those animation names. I tested the new DLL and can confirm it fixes the scripting issues between modal states and NoAction(). 
 
Do you mind if I include the DLL in my script mod? Not many people use my mods, so it's really just for myself until you update TobEx AfterLife with the fixed DLL.


#10 Insomniator

Insomniator
  • Modder
  • 358 posts

Posted 22 April 2022 - 07:19 PM

Do you mind if I include the DLL in my script mod? Not many people use my mods, so it's really just for myself until you update TobEx AfterLife with the fixed DLL.


No problem