Jump to content

IWD2 scripting question


Domi

Recommended Posts

It's a 2-part question:

 

As far as I can tell there is no (?) background running script (ie the same as baldur/baldur25). There is baldur.bcs there, but it does not seem to do anything. Is there one I am missing?

 

If there aren't any, what I am working on is the following:

 

All party members have the same script assigned to them:

 

DPLAYER3.BCS.

 

What I am trying to do, is to make Player1 dialogue him/herself once the Hot Key is pressed:

 

IF
  HotKey(P)
  IsPlayerNumber("charbase",1)
THEN
  RESPONSE #100
  ActionOverride(Player1,StartDialogueNoSet(Myself))
END

 

By self-explanatory reason, upon pressing the hot-key, the action occurs as many times as there are NPCs in the party. What I am looking for is some sort of a check that allows me to have a trigger that says that only the creature with a specified death variable runs the script. Anything I can do short of deleting the DPLAYER3.BCS from all the joinable NPCs (it's empty anyways)?

Link to comment

Btw, who told you there is no baldur.bcs running in iwd2???

The rest check i told you earlier works with THAT!!!

 

baldur.bcs:

IF

Checkstat(Player1,0,FATIGUE)

THEN

RESPONSE #100

Displaystring(Player1,3) // ~Mon SmSword d6 Slash~

Changestat(Player1,FATIGUE,1,SET)

END

Link to comment

Yes, that's what I saw with Baldur as well - it flat out did not work for me in the area I was in. You're probably right, they disabled the thing. IWd2 often kicks out as 'almost the same, but different" kindda thing. :)

 

EDIT: Brilliant! IsScriptName("charbase",Myself) eliminates the problem! thank you! And while I was at it, it hit me that IsPlayerNumber(Myself,1) would have done the trick. Well, now I have a fool-proof check (if there is such thing, lol) and can initiate dialogues with joinable NPCs in IWD2 to my little heart's content. Thanks again, Avenger and the Bigg!

Link to comment

One year later, I have the same question for IWD. :band:

 

Only, IsScriptName and IsPlayerNumber aren't available there, and I am not sure how this one works:

0x401D Specifics(O:Object*,I:Specifics*Specific)

 

Is there a way?

Link to comment

Okay, got it, thank you! It's working now.

 

Just in case someone might need it in the future, here is the code:

(I remembered the rule about One Byte, too)

 

DPLAYER3.baf

IF
HotKey(K)
!Specifics(Myself,168)
!StateCheck(Myself,CD_STATE_NOTVALID)
THEN
RESPONSE #100
ActionOverride(Player1,StartDialogueNoSet(Myself))
END

To each NPC script:

IF
!Specifics(Myself,168)
THEN
RESPONSE #100
ChangeSpecifics(Myself,168)
END

 

And, finally, the dialogue: MULTIG.d

(since it gets assigned to all protagonists/custom chars automatically).

 

BEGIN MULTIG

CHAIN IF ~True()~ THEN MULTIG PID
~[...]~

 

Now my only worry is compatibility: what if another mod needs MULTIG(which hasn't existed before, hence my BEGIN MULTIG) for some reason? I guess they are going to be in trouble, right?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...