Jump to content

IWD2 and SetTeamBit()


FredSRichardson

Recommended Posts

Does anyone know what the SetTeamBit() scripting function actually does?

 

I've been studying the scripts in the Targos Docks area and so far I've figured out this much:

 

There is a set of Area Global variables TEAM_0, TEAM_1, ... which are assigned to "groups" of actors via scripts (check over here for more details). The variables are 0 unless a member of a "team" spots an enemy, and then all members of that team will gravitate over to the enemy and attack. This is actually pretty nice (no more fog-o-war exploitings :O).

 

In the case of the NPC actors, setting the TEAM_# variables causes members of that team to go hostile. It looks as though (in this area at least) TEAM_0 is reserved for the general "neutral" population. If it's set to 1, then the general global TARGOS_HOSTILE is set (it's pretty clear what that does).

 

There are two instances in this area where 2 groups of NPC's have there own team in addition to TEAM_0, the guys on the boat are in TEAM_1, and the two guys you meet after that are in TEAM_2.

 

While the TEAM_# variables are only set when seeing the enemy, being attacked, catching a pickpocketer, etc, each member of a team runs this block (always):

 

IF
 !IsTeamBitOn(TEAM_#_BIT)
THEN
 RESPONSE #100
   SetTeamBit(TEAM_#_BIT,TRUE)
   Continue()
END

 

This is generally done through a script 00T0#T.BCS which appears in the "Specific script" section (according to NI).

 

The one notable exception is that TEAM_0_BIT is never set (perhaps it's on by default?).

 

So I'm really wondering how the engine handles the team "bit". I suspect the call modifies the Actor record some how. Perhaps in some areas there are scripts that check for specific team members?

 

I'll try to run a test or two. I could check to see what happens if an NPC set the team bit for one of the monster groups.

Link to comment

Archived

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

×
×
  • Create New...