Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jul 2014
R
Rhidian Offline OP
addict
OP Offline
addict
R
Joined: Jul 2014
I have come up with a certain script for fun, but it would be infinitely better if I could pick out the hostile enemies for any given encounter when combat starts.

What I have right now is something like this:
Code
INIT Section
DB_ProtectedCharacters(CHARACTER_HOM_Astarte);
DB_ProtectedCharacters(CHARACTER_HOM_Astarte_SecondFight);
DB_ProtectedCharacters(CHARACTER_HIB_Leandra);


KB Section
IF
CharacterEnteredCombat(_Char, _ID)
AND
NOT _Char.isPlayer()
AND
NOT DB_ProtectedCharacters(_Char)
THEN
CharacterSetHitpointsPercentage(_Char, 0);


I imagine that I would use something like CharacterGetRelationToCharacter, but I'm not sure which value would be necessary.

Joined: Oct 2008
A
ALF Offline
journeyman
Offline
journeyman
A
Joined: Oct 2008
You can use CharacterGetRelationToCharacter and check for a value less than 25 (so < 25).
Note that this will only work for Global characters. Local characters in your combat won't be handled by it.

Joined: Sep 2014
Z
apprentice
Offline
apprentice
Z
Joined: Sep 2014
There are some databases maintained by the main story scripts that could be helpful.
EvilDude - contains all 'Evil' characters. These are defined at game initialization by those with a relation to Arhu of < 25. It can be added to at anytime.
IsStoryNPC - is a database containing what I think are protected characters (uses call CharacterMakeStoryNpc)
The query CharacterGetAttitudeTowardsPlayer might also be useful, not sure its difference to CharacterGetRelationToCharacter but they are different


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5