Jump to content
Sign in to follow this  
K4thos

[IWD2] Not obvious script differences

Recommended Posts

Quote

0x4089 OR(I:OrCount*)
Returns true if any of the next 'OrCount' triggers returns true.

from the IESDP description you may assume that OR works exactly the same in IWD2 as in other IE games. This is not the case. I've noticed that in IWD2 the first found trigger within Or declaration that returns true ends the Or loop. In other EE games all triggers within OR are checked 1 by 1 regardless if true match is found. It matters for things like targeting (object referencing set via See, Attacked etc.) and trigger priority (reversed).

 

If this was already known and there is a topic that discusses obscure changes like this please leave a link here.

edit: changed the topic name to more general one.

Edited by K4thos

Share this post


Link to post

I'm surprised at the opposite actually. 🤦‍♂️

Share this post


Link to post

So you are telling that the SCS would have been better within the IWD2 engine. 🤡

Share this post


Link to post
1 hour ago, Jarno Mikkola said:

So you are telling that the SCS would have been better within the IWD2 engine. 🤡

?

Share this post


Link to post

I am talking about processing speed here. No 5 minutes to render 1 fresh world stage at worst, cause the OR would allow things to check at priority stages... and so forth and so on. 

I'm sure you get that, now.

Share this post


Link to post

I don't think it would make any material difference, OR() blocks aren't a significant source of slowdown in SCS.

Share this post


Link to post

Another not so obvious scripting difference in IWD2 engine:

SetGlobal and IncrementGlobal in IWD2 sets the variable during the same script run, not in the next one, like in other IE games. For example this code:

IF
  Global("Marked","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("Marked","LOCALS",1)
    FloatMessage(Player1,1)  // Ettin
    Continue()
END

IF
  Global("Marked","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("Marked","LOCALS",1)
    FloatMessage(Player1,2)  // Beetle
END

prints only the first message.

Edited by K4thos

Share this post


Link to post

Unlike other IE games (at least EE ones) IWD2 AttackedBy trigger works correctly with nested objects. This one sounds more like an engine bug in other engine variants though, so I've also reported it on Beamdog redmine. If anyone is aware about other triggers with the same problems please post them here.

Edited by K4thos

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...