Jump to content

How to turn party members hostile


Guest Test1499

Recommended Posts

Guest Test1499

I wish to turn certain party members to turn hostile
I had look at BG2 vanilla game and DLG from poisoning the grove appeals to me but i have trouble to turn it to functioning code

OR(3)
!IfValidForPartyDialog("Aerie") // Aerie
!IfValidForPartyDialog("Jaheira") // Jaheira
!IfValidForPartyDialog("Cernd") // Cernd

ActionOverride("Valygar",LeaveParty())
ActionOverride("Valygar",Enemy())
ActionOverride("Minsc",LeaveParty())
ActionOverride("Minsc",Enemy())
ActionOverride("Keldorn",LeaveParty())
ActionOverride("Keldorn",Enemy())
ActionOverride("Mazzy",LeaveParty())
ActionOverride("Mazzy",Enemy())

Link to comment

The basic commands there are clear and standard enough: LeaveParty() and Enemy(). Those apply to the "active" creature, so they need an ActionOverride() if the script block is being run from someone else's perspective.

You can't just throw the ActionOverride in without thought, though - if the active creature is the same as the one being overridden to, that command and any that follow it won't be executed. So, for example, if it's in Jaheira's dialogue and I want her to leave the party and become an enemy, I need to use 

LeaveParty()
Enemy()

on their own. (That appears in the same conversation you were quoting from, in a branch that Jaheira speaks up in.)

What else is there? The conditions. In a dialogue, responses can have a "trigger" script block - those "!IfValidForPartyDialog" lines in your example - to determine when that response appears. Then the response can have an "action" script block; this is what actually gets done when the conversation goes through that response.

The same scripting language is used by the game's BCS scripts. For example, Keldorn has this block in his script for if you attack his family:

IF
	OR(9)
		Dead("peony")  // Peony
		Allegiance("peony",ENEMY)  // Peony
		Dead("maria")  // Lady Maria
		Allegiance("maria",ENEMY)  // Lady Maria
		Dead("leona")  // Leona
		Allegiance("leona",ENEMY)  // Leona
		Dead("vesper")  // Vesper
		Allegiance("vesper",ENEMY)  // Vesper
		Global("AttackedKeldornsFamily","GLOBAL",1)
	InParty(Myself)
	AreaCheck("AR1003")  // Firecam's Estate
	Global("KeldornKickMe","LOCALS",0)
THEN
	RESPONSE #100
		SetGlobal("KeldornKickMe","LOCALS",1)
		DisplayStringHead(Myself,11532)  // This is the end, m'<PRO_LADYLORD>. It always was... My destiny demands it as much as yours.
		LeaveParty()
		Enemy()
END

(First block of KELDORN.BCS)

Here, the condition block is "when does this happen?"; if the script is running and the conditions are met, the action block will be executed. Subject to priority order, of course - creature override scripts are higher priority than creature class scripts, the first block in a BCS script is higher priority than the second, and so on.

You haven't gotten into the details of what you're trying to do, so I can't get more specific about anything.

Link to comment
Guest Test 1499

The example is probably enough

to recap

In Dialogue
>>
Select option NPCs dont like
>>
proclamation of hostility from either of 3 NPCs
>>
Calls for reinforments dialogue
>>
If in party they will turn hostile
>>
EOD

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...