Jump to content

[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
Link to comment

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
Link to comment

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
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...