Jump to content

A question about combat scripting


Sikret

Recommended Posts

Hi,

 

I have a question regarding coding combat scripts for creatures who have a dialogue before the battle begins in the game. For example, consider Torgal. Torgal has a short dialogue with the PC before the battle begins. Now, if I want to write a baf file for Torgal's combat system, I'm not sure how to do it without affecting his dialogue with the PC. For example, if I start the script in this way:

 

IF
 Detect([PC])
 Global("Torgaltactic01","LOCALS",0)
THEN
 RESPONSE #100
   Enemy()
   ReallyForceSpell(Myself,CLERIC_SHIELD_OF_THE_ARCHONS)
   SetGlobal("Torgaltactic01","LOCALS",1)
END

 

Torgal will change to an enemy immediately after seeing a party member, but what will happen to his dialogue with the PC? How should I write the opening line of the script if I want his dialogue to appear normally before the fight begins?

Link to comment

Would this alternate code make the initial dialogue to appear appropriately before the battle?

 

IF
Detect([PC])
Global("Torgaltactic01","LOCALS",0)
THEN
RESPONSE #100
  StartDialogueNoSet([PC])
  Enemy()
  ReallyForceSpell(Myself,CLERIC_SHIELD_OF_THE_ARCHONS)
  SetGlobal("Torgaltactic01","LOCALS",1)
END

 

PS: I'm aware that a way to see if it will work (or not) is to test it in practice in the game, but to test it in that way, I'll have to install the mod I am working on, which is not ready to be installed yet.

Link to comment

Below is a third way I have tried to write the .baf file. Although, I haven't tested it yet, I'm very optimistic that it will work flawlessly. (Comparing it with the way Weimer had written the baf files of his tactics mod, it must work unless it had also failed in Tactics):

 

IF
 NumTimesTalkedTo(0)
 Detect([PC])
 Global("Torgalcombat01","LOCALS",0)
THEN
 RESPONSE #100
   StartDialogueNoSet([PC])
   SetGlobal("Torgalcombat01","LOCALS",1)
END

IF
 Detect([PC])
 Global("Torgalcombat02","LOCALS",0)
THEN
 RESPONSE #100
   Enemy()
   ReallyForceSpell(Myself,CLERIC_AURA_OF_FLAMING_DEATH)
   SetGlobal("Torgalcombat02","LOCALS",1)
END

 

(and the rest of the script will follow)

 

I haven't actually found any written tutorial or document about the exact use of the StartDialogueNoSet(*) command anywhere, but Weimer has used it apparently for the same purpose that I have in mind. If anyone here knows anything about this Weidu command, I'll be grateful if he offers detailed information; otherwise, I'll need to install and test it in the game to be sure of its functionality.

 

PS: Perhaps the first global in the mentioned code is redundant, but it's not harmful.

Link to comment
I haven't actually found any written tutorial or document about the exact use of the StartDialogueNoSet(*) command anywhere, but Weimer has used it apparently for the same purpose that I have in mind. If anyone here knows anything about this Weidu command, I'll be grateful if he offers detailed information; otherwise, I'll need to install and test it in the game to be sure of its functionality.

 

PS: Perhaps the first global in the mentioned code is redundant, but it's not harmful.

 

That "command", or _action_ as it should properly be called, has nothing to do with WeiDU as such. It is an Infinity Engine scripting command. A list of scripting actions usable in BG2:ToB can be found here (including the StartDialogueNoSet). If you have not yet familiarised yourself with the IESDP, I would recommend you do so here. It contains, among other things, lists of the various actions and triggers, complete with descriptions based on the experience of various people. If you're into scripting, you might also want to check out the Complete Scripting Guide by SimDing0 over at Pocket Plane.

Link to comment

Thank you, Darios!

 

I ckecked it in IESDP and StartDialogueNoSet was exactly what I had guessed. Hence, the third code (above) will work. (I had previously searched for it almost everywhere but that specific page :down: ) Thanks again!

 

PS: As for Sim's complete scripting guide, I had already checked it but there was no reference to that action in it.

Link to comment

Archived

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

×
×
  • Create New...