Jump to content

Does this mod overwrite DEMLORD.BCS?


Recommended Posts

Hi,

A question: Our mod ("our" being Ratatoskr and myself) adds to DEMLORD.BCS, and we keep getting error reports that some mod installed after ours replaces the file (and thus breaks our code). Does it happen as part of your "Improved fiends and celestials" component?

We're not expecting you to recode that part (I assume the files are replaced for a reason); we just want to confirm that it's SCS so we can tell people to install our mod after that one if it is (since then SCS will replace the file, and our mod will then add to the replaced file, so both should work fine).

Thanks!

Edited by BCaesar
Link to comment

Yes. Built new from SSL in the fiend component, keeping the old name. The noncombat portions of the script are reproduced, while the combat portions are replaced.

The SCS version of DEMLORD.BCS:

- Reproduce the three dialogue control blocks.

- Skip the "DemonHatesAll" block.

- Reproduce the five "DemonWalks" blocks.

- Don't reproduce the remaining combat blocks.

- Append a standard SCS balor combat script.

 

Huh. Looking at this, it could easily be done in a more compatible way. Delete all blocks with "Allegiance(Myself,ENEMY)" or "See(NearestEnemyOf(Myself))" conditions (the combat blocks), move to the override slot, assign a balor script in the class slot. And splitting up combat and noncombat elements into separate scripts is nothing new for SCS.

Edited by jmerry
Link to comment
Posted (edited)

I don't know if this is useful at all, but in our tp2 file we:

EXTEND_TOP ~demlord.bcs~ ~AllThingsMazzy/scripts/evil/_bdemlord.baf~ EVALUATE_BUFFER

And then the actual code in _bdemlord.bcs is:

Spoiler

//The Demon Lord's Script Name is also demlord
//This is the script for the demon in Ust Natha should you do Viconia's quest and give him the eggs.

IF
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
	Global("_bDemonWalks","GLOBAL",1)
	AreaCheck("AR2201") //Temple of Lolth
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([1179.1031])
	CreateVisualEffectObject("SPPORTAL",Myself)
	SetGlobal("_bDemonWalks","GLOBAL",2)
END

IF
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
	Global("_bDemonWalks","GLOBAL",2)
	AreaCheck("AR2201") //Temple of Lolth
THEN
	RESPONSE #100
	Wait(1)
	MoveToPointNoInterrupt([734.1727])
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",3)
	MoveBetweenAreasEffect("AR2200","SPPORTAL",[4092.2503],S)  // Ust Natha
END

IF
	AreaCheck("AR2200")  // Ust Natha
	Global("_bDemonWalks","GLOBAL",3)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
		MoveToPointNoInterrupt([3848.2617])
		MoveToPointNoInterrupt([3823.2847])
		MoveToPointNoInterrupt([3711.2939])
		MoveToPointNoInterrupt([3469.2961])
		Wait(1)
		MoveToPointNoInterrupt([3316.2769])
		MoveToPointNoInterrupt([3329.2594])
		MoveToPointNoInterrupt([2974.2309])
		Wait(1)
		MoveToPointNoInterrupt([2799.2161])
		SetGlobal("_bDemonWalks","GLOBAL",4)
END

IF
	AreaCheck("AR2200")  // Ust Natha
	Global("_bDemonWalks","GLOBAL",4)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([2376.2166])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	MoveToPointNoInterrupt([1843.2659])
	Wait(1)
	MoveToPointNoInterrupt([1576.2712])
	Wait(1)
	MoveToPointNoInterrupt([1472.2973])
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",5)
END

IF
	AreaCheck("AR2200")  // Ust Natha
	Global("_bDemonWalks","GLOBAL",5)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
		CreateVisualEffectObject("SPPORTAL",Myself)
		Wait(1)
		JumpToPoint([1303.3073])
		CreateVisualEffectObject("SPPORTAL",Myself)
		Wait(1)
		MoveToPointNoInterrupt([1290.3234])
		Wait(1)
		MoveToPointNoInterrupt([902.3765])
		SetGlobal("_bDemonWalks","GLOBAL",6)
END

IF
	AreaCheck("AR2200")  // Ust Natha
	Global("_bDemonWalks","GLOBAL",6)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	SetGlobal("_bDemonWalks","GLOBAL",7)
	MoveBetweenAreasEffect("AR2100","SPPORTAL",[4892.237],S) //Underdark Main Area
END

IF
	AreaCheck("AR2100")  // Underdark Main Area
	Global("_bDemonWalks","GLOBAL",7)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	MoveToPointNoInterrupt([4093.1019])
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",8)
	MoveBetweenAreasEffect("AR2102","SPPORTAL",[311.417],S) //Dragon's Lair
END

//First dialogue between Demon and Dragon
IF
	AreaCheck("AR2102")  // Dragon's Lair
	Global("_bDemonWalks","GLOBAL",8)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
	!Dead("udsilver")
THEN
	RESPONSE #100
	MoveToPointNoInterrupt([1253.1337])
	SetGlobal("_bDemonWalks","GLOBAL",9)
	Continue()
END

IF
	Global("_bDemonWalks","GLOBAL",9)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Dialog("udsilver")
END

//2nd Dialogue
IF
	AreaCheck("AR2102")  // Dragon's Lair
	Global("_bDemonWalks","GLOBAL",10)
	!Dead("udsilver")
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	SetGlobal("_bDemonWalks","GLOBAL",11)
	Continue()
END

IF
	Global("_bDemonWalks","GLOBAL",11)
THEN
	RESPONSE #100
	StartDialogNoSet(Player1)
END

//3rd Dialogue
IF
	AreaCheck("AR2102")  // Dragon's Lair
	Global("_bDemonWalks","GLOBAL",12)
	!Dead("udsilver")
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	SetGlobal("_bDemonWalks","GLOBAL",13)
	Continue()
END

IF
	Global("_bDemonWalks","GLOBAL",13)
THEN
	RESPONSE #100
	StartDialogNoSet(Player1)
END

//4th dialogue
IF
	Global("_bDemonWalks","GLOBAL",14)
	Global("_bDemonPanics","GLOBAL",0)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	CreateVisualEffectObject("SPPORTAL",Myself)
	SetGlobal("_bDemonPanics","GLOBAL",1)
	Continue()
END

IF
	Global("_bDemonPanics","GLOBAL",1)
THEN
	RESPONSE #100
	StartDialogNoSet(Player1)
END

IF
	Global("_bDemonWalks","GLOBAL",14)
	!Dead("udsilver")
	Global("_bDemonPanics","GLOBAL",2)
THEN
	RESPONSE #100
	MoveToPointNoInterrupt([311.417])
END

//Code once the dragon dies.
IF
	AreaCheck("AR2102")  // Dragon's Lair
	Global("_bDemonWalks","GLOBAL",14)
	Dead("udsilver")
	!Dead("UDDEMON")
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	SetGlobal("_bDemonWalks","GLOBAL",15)
END

IF
	Global("_bDemonWalks","GLOBAL",15)
THEN
	RESPONSE #100
	MoveToPoint([1522.1497])
	Dialog([PC])
END

//Code to start timer after demon talks after dragon dies.
IF
	!Dead("UDDEMON")
	Global("_bDemonWalks","GLOBAL",16)
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	SetGlobalTimer("_bDemonRestsAfterDragon","GLOBAL",EIGHT_HOURS)
	SetGlobal("_bDemonWalks","GLOBAL",17)
END
	
IF	
	Global("_bDemonWalks","GLOBAL",17)
	GlobalTimerExpired("_bDemonRestsAfterDragon","GLOBAL")
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	SetGlobal("_bDemonWalks","GLOBAL",18)
END

IF 
	Global("_bDemonWalks","GLOBAL",18)
THEN
	RESPONSE #100
	StartDialogNoSet(Player1)
END

//Code to leave the silver dragon's cave.
IF
	Global("_bDemonWalks","GLOBAL",19)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	MoveToPointNoInterrupt([311.417]) //Near door of dragon's cave.
	SetGlobal("_bDemonWalks","GLOBAL",20)
END

IF
	Global("_bDemonWalks","GLOBAL",20)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	SetGlobal("_bDemonWalks","GLOBAL",21)
	MoveBetweenAreasEffect("AR2100","SPPORTAL",[4093.1019],S) //Underdark Main Area
END

//Code to kill any enemies in Underdark. Also to heal if in the elven temple.
IF
	AreaCheck("AR2500") //Elven Temple Outside UnderDark
	HPLT(Myself,10)
THEN
	RESPONSE #100
	StartDialogueNoSet(Player1)
END

IF
	OR(4)
		AreaCheck("AR2100") //Underdark Main Area
		AreaCheck("AR2402") //Western Tunnels
		AreaCheck("AR2401") //Exit Tunnels
		AreaCheck("AR2500") //Elven Temple Outside UnderDark
	Detect(NearestEnemyOf([PC]))
	!Allegiance(Myself,ENEMY)
THEN
	RESPONSE #100
	ReallyForceSpell(NearestEnemyOf([PC]),CLERIC_FLAME_STRIKE)
END

IF
	OR(2)
		AreaCheck("AR2100") //Underdark Main Area
		AreaCheck("AR2402") //Western Tunnels
	!Allegiance(Myself,NEUTRAL)
THEN
	RESPONSE #100
	ChangeEnemyAlly(Myself,NEUTRAL)
END

IF
	OR(2)
		AreaCheck("AR2401") //Exit Tunnels
		AreaCheck("AR2500") //Elven Temple Outside UnderDark
	!Allegiance(Myself,ALLY)
	!Global("_bDemonatSurface","GLOBAL",4)
THEN
	RESPONSE #100
	ChangeEnemyAlly(Myself,ALLY)
END

IF
	AreaCheck("AR2500") //Elven Temple Outside UnderDark
	!Allegiance(Myself,NEUTRAL)
	Global("_bDemonatSurface","GLOBAL",4)
THEN
	RESPONSE #100
	ChangeEnemyAlly(Myself,NEUTRAL)
	Wait(1)
	MoveToPointNoInterrupt([1521.1111])
END

//Code to walk in Underdark.
IF
	Global("_bDemonWalks","GLOBAL",21)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	MoveToPointNoInterrupt([4138.1604])
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",22)
END

IF
	Global("_bDemonWalks","GLOBAL",22)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([3914.2000])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",23)
END

IF
	Global("_bDemonWalks","GLOBAL",23)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	MoveToPointNoInterrupt([273.1870])
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",24)
END

IF
	Global("_bDemonWalks","GLOBAL",24)
	Detect([PC])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	ApplySpell(Myself,HEAL_NO_VISUAL)
	SetGlobal("_bDemonWalks","GLOBAL",25)	
	MoveBetweenAreasEffect("AR2402","SPPORTAL",[400.1873],S) //Western Tunnels
END

//Code to Move Demon in Western Tunnels
IF
	Global("_bDemonWalks","GLOBAL",25)
	Detect([PC])
	Global("_bWesternTunnelDemonHop","GLOBAL",0)
	!Detect([ENEMY])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([661.1914])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bWesternTunnelDemonHop","GLOBAL",1)
END

IF
	Global("_bDemonWalks","GLOBAL",25)
	Detect([PC])
	Global("_bWesternTunnelDemonHop","GLOBAL",1)
	!Detect([ENEMY])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([848.1667])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bWesternTunnelDemonHop","GLOBAL",2)
END

IF
	Global("_bDemonWalks","GLOBAL",25)
	Detect([PC])
	Global("_bWesternTunnelDemonHop","GLOBAL",2)
	!Detect([ENEMY])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([1270.1693])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bWesternTunnelDemonHop","GLOBAL",3)
END

IF
	Global("_bDemonWalks","GLOBAL",25)
	Detect([PC])
	Global("_bWesternTunnelDemonHop","GLOBAL",3)
	!Detect([ENEMY])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([1638.1624])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bWesternTunnelDemonHop","GLOBAL",4)
END

IF
	Global("_bDemonWalks","GLOBAL",25)
	Detect([PC])
	Global("_bWesternTunnelDemonHop","GLOBAL",4)
	!Detect([ENEMY])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([1832.1453])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bWesternTunnelDemonHop","GLOBAL",5)
END

IF
	Global("_bDemonWalks","GLOBAL",25)
	Detect([PC])
	Global("_bWesternTunnelDemonHop","GLOBAL",5)
	!Detect([ENEMY])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([1934.1166])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bWesternTunnelDemonHop","GLOBAL",6)
END

IF
	Global("_bDemonWalks","GLOBAL",25)
	Detect([PC])
	Global("_bWesternTunnelDemonHop","GLOBAL",6)
	!Detect([ENEMY])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([2211.924])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bWesternTunnelDemonHop","GLOBAL",7)
END

IF
	Global("_bDemonWalks","GLOBAL",25)
	Detect([PC])
	Global("_bWesternTunnelDemonHop","GLOBAL",7)
	!Detect([ENEMY])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([1958.712])	
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bWesternTunnelDemonHop","GLOBAL",8)
END

IF
	Global("_bDemonWalks","GLOBAL",25)
	Detect([PC])
	Global("_bWesternTunnelDemonHop","GLOBAL",8)
	!Detect([ENEMY])
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([1730.673])		
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",26)
END

IF
	Global("_bDemonWalks","GLOBAL",26)
	IfValidForPartyDialogue("Viconia")
	OR(2)
		Dead("uddoor02")
		Global("_bDemonMakesGateGuardsFlee","GLOBAL",1)
THEN
	RESPONSE #100
	MoveToPointNoInterrupt([1048.488])
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",27)
END

IF
	Global("_bDemonWalks","GLOBAL",27)
	Detect([PC])
THEN
	RESPONSE #100
	ApplySpell(Myself,HEAL_NO_VISUAL)
	
	SetGlobal("_bDemonWalks","GLOBAL",28)
	MoveBetweenAreasEffect("AR2401","SPPORTAL",[1261.1220],S) //Exit Tunnels
END

//Code to move in Exit Tunnels
IF
	Global("_bDemonWalks","GLOBAL",33)
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	ApplySpell(Myself,HEAL_NO_VISUAL)
	MoveToPointNoInterrupt([1267.747])
	Wait(1)
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([1056.397])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	OpenDoor("Door01")
	OpenDoor("Door02")
	OpenDoor("Door03")
	OpenDoor("Door04")
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",34)
END

//Dialogue after everyone is dead.
IF
	AreaCheck("AR2401")
	Global("_bDemonWalks","GLOBAL",34)
	!Detect([ENEMY])
	Detect([PC])
THEN
	RESPONSE #100
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	JumpToPoint([659.598])
	CreateVisualEffectObject("SPPORTAL",Myself)
	Wait(1)
	SetGlobal("_bDemonWalks","GLOBAL",35)
END

IF
	Global("_bDemonWalks","GLOBAL",35)
	CombatCounter(0)
	!Detect([ENEMY])
	Global("_bDemonTalksAtExit","GLOBAL",0)
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	SetGlobal("_bDemonTalksAtExit","GLOBAL",1)
END

IF
	Global("_bDemonTalksAtExit","GLOBAL",1)
THEN
	RESPONSE #100
	StartDialogNoSet(Player1)
END

IF
	Global("_bDrowReturnUstNatha","GLOBAL",1)
	CombatCounter(0)
THEN
	RESPONSE #100
	RandomWalk()
END

IF
	Global("_bDrowAttackElves","GLOBAL",4)
	AreaCheck("AR2401")
THEN
	RESPONSE #100
	MoveBetweenAreas("AR2500",[1906.1128],W) //Elven Temple Outside UnderDark
END

//Last dialogue in Elven Temple
IF
	AreaCheck("AR2500") //Elven Temple Outside UnderDark
	!Detect([ENEMY])
	Global("_bDemonatSurface","GLOBAL",0)
THEN
	RESPONSE #100
	SetGlobal("_bDemonatSurface","GLOBAL",1)
END

IF
	Global("_bDemonatSurface","GLOBAL",1)
THEN
	RESPONSE #100
	MoveToPointNoInterrupt([1521.1111])
	Wait(1)
	SetGlobal("_bDemonatSurface","GLOBAL",2)
END

IF
	Global("_bDemonatSurface","GLOBAL",2)
	IfValidForPartyDialogue("Viconia")
THEN
	RESPONSE #100
	SetGlobal("_bDemonatSurface","GLOBAL",3)
END
	
IF
	Global("_bDemonatSurface","GLOBAL",3)
THEN
	RESPONSE #100
	StartDialogNoSet(Player1)
END

 

Do you think that'll break yours it done after? The whole thing is just a series of actions triggered off of our own global. It shouldn't affect anything if that global isn't set.

 

Edited by BCaesar
Link to comment

While you have allegiance checks and enemy scans in there, none of them are exactly the forms used in the existing combat elements of the script. So my proposal wouldn't delete any of your additions to the script; full compatibility in either order.

Link to comment
4 hours ago, BCaesar said:

The whole thing is just a series of actions triggered off of our own global

I would say, don't update an existing script but create your own then set it to the override slot. Like that SCS won't remove your script.

Link to comment

And if both mods create new scripts, that's another way for things to break when they're combined - this time by omitting parts of the original plot scripting. Joy. Scripts that combine combat and plot are just so much trouble.

Link to comment

It is a complete pain to handle scripts that combine combat and scripting - nothing native in WEIDU really allows surgical work here, so SCS is pretty slash-and-burn.

However, these days it's easier to work around this, so I can probably do something about it. Might not make the next version but I'll address it as soon as I can.

Link to comment
10 hours ago, jmerry said:

While you have allegiance checks and enemy scans in there, none of them are exactly the forms used in the existing combat elements of the script. So my proposal wouldn't delete any of your additions to the script; full compatibility in either order.

 

3 hours ago, DavidW said:

It is a complete pain to handle scripts that combine combat and scripting - nothing native in WEIDU really allows surgical work here, so SCS is pretty slash-and-burn.

However, these days it's easier to work around this, so I can probably do something about it. Might not make the next version but I'll address it as soon as I can.

Thanks. We picked up some modding skills in the course of doing this, but what you guys put together is beyond us. Ratatoskr tried the game with SCS installed and not installed and said she was pretty sure that's where the conflict was, but when I asked her what the SCS tp2 file said, and she said the whole tp2 file looked like gibberish to her. It's far more complicated than anything either of us coded.

No hurry on the update. If you're able to make it work that's wonderful, but until then we'll just stick a note in ours mentioning the compatibility issue (and that it'll work fine if ours is installed after).

Link to comment
11 hours ago, jmerry said:

when they're combined

I am not sure to really get it. If the mod extends an existing script with some triggers (here series of actions triggered off of our own global) it does not need to be combined. The current script could be left untouch, active and freely updated by SCS and a new one could be added with a higher priority.

Like you said :

11 hours ago, jmerry said:

Scripts that combine combat and plot are just so much trouble

 

Link to comment
On 6/25/2024 at 12:42 AM, jmerry said:

Huh. Looking at this, it could easily be done in a more compatible way. Delete all blocks with "Allegiance(Myself,ENEMY)" or "See(NearestEnemyOf(Myself))" conditions (the combat blocks), move to the override slot, assign a balor script in the class slot. And splitting up combat and noncombat elements into separate scripts is nothing new for SCS.

It is somewhat more complicated than that. One of the attack blocks occurs higher in the script than some of the noncombat elements, and so effectively turns those elements off if combat is triggered.

Still doable - but not (I think) with the tools I had available when I wrote that component.

Link to comment

OK, here's where I have got to.

The vanilla DEMLORD script consists of four parts:

  1. some high-priority noncombat scripting.
  2. a combat block triggered if the demon is hostile and can detect a PC but 'DemonHatesAll' is not set
  3. A series of scripted moves controlled by the 'DemonWalks' variable
  4. some combat scripting (all containing either 'See(NearestEnemyOf(Myself))' or 'Allegiance(Myself,ENEMY)')

SCS now performs some delicate surgery on DEMLORD that

  • leaves (1) alone
  • edits (2) to just set a local variable 'dw_demon_hostile' to 1
  • edits (3) (identified by the 'DemonWalks' trigger) to require dw_demon_hostile=0 in each block (replicating the way the old block prevented 3 from firing)
  • deletes (4) (identified by 'See(NearestEnemyOf(Myself))' or 'Allegiance(Myself,ENEMY)'), with the step-2 block excluded)

Then SCS's own combat scripting is palmed off to a new script, DW#DLORD, that is inserted directly below DEMLORD in UDDEMON.CRE.

@BCaesar: will that solve the compatibility issue?

Link to comment
On 6/26/2024 at 8:30 PM, DavidW said:

OK, here's where I have got to.

The vanilla DEMLORD script consists of four parts:

  1. some high-priority noncombat scripting.
  2. a combat block triggered if the demon is hostile and can detect a PC but 'DemonHatesAll' is not set
  3. A series of scripted moves controlled by the 'DemonWalks' variable
  4. some combat scripting (all containing either 'See(NearestEnemyOf(Myself))' or 'Allegiance(Myself,ENEMY)')

SCS now performs some delicate surgery on DEMLORD that

  • leaves (1) alone
  • edits (2) to just set a local variable 'dw_demon_hostile' to 1
  • edits (3) (identified by the 'DemonWalks' trigger) to require dw_demon_hostile=0 in each block (replicating the way the old block prevented 3 from firing)
  • deletes (4) (identified by 'See(NearestEnemyOf(Myself))' or 'Allegiance(Myself,ENEMY)'), with the step-2 block excluded)

Then SCS's own combat scripting is palmed off to a new script, DW#DLORD, that is inserted directly below DEMLORD in UDDEMON.CRE.

@BCaesar: will that solve the compatibility issue?

As best I can tell, yes. What we do is add a whole bunch of actions to the top, all with our own global as one of the triggers (which is set in player dialogue earlier). So if that global is triggered then the demon does a whole bunch of stuff.

So this seems like it should be fine. Our mod doesn't require anything already existing in DEMLORD.BCS to be there for it to work properly, it just requires the stuff we add not to be deleted/changed by another mod.

Thanks so much!

Link to comment
On 6/26/2024 at 8:30 PM, DavidW said:
  • deletes (4) (identified by 'See(NearestEnemyOf(Myself))' or 'Allegiance(Myself,ENEMY)'), with the step-2 block excluded)

 

Just confirming, that wouldn't do anything to a block like this from our code would it?
 

IF
	OR(4)
		AreaCheck("AR2100") //Underdark Main Area
		AreaCheck("AR2402") //Western Tunnels
		AreaCheck("AR2401") //Exit Tunnels
		AreaCheck("AR2500") //Elven Temple Outside UnderDark
	Detect(NearestEnemyOf([PC]))
	!Allegiance(Myself,ENEMY)
THEN
	RESPONSE #100
	ReallyForceSpell(NearestEnemyOf([PC]),CLERIC_FLAME_STRIKE)
END

It's got Allegiance(Myself,ENEMY)) except with a ! in front of it.

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