Pocket Plane Group

BG2 Completed Mods => Virtue => Topic started by: TruePurple on June 28, 2005, 06:23:29 PM

Title: Quest mod virtue compatibility?
Post by: TruePurple on June 28, 2005, 06:23:29 PM
Virtue values need to be written into each and every quest/npc situation right? Which, if any, quest/npc packs have virtue built in?/Which are compatible with virtue?(so that the virtue scripts don't apply to just part of the game)

A list of all story mods who have virtue values written in as a sticky topic would be nice, or such a list in virtues description text :)
Title: Re: Quest mod virtue compatibility?
Post by: SimDing0™ on July 06, 2005, 01:18:42 PM
I guess I can try to throw something together. What makes me kinda reluctant though is that a lot of quest mods simply don't need any special handling by Virtue, and I'd have to go through the modlist thinking about which ones it'll work with already as well as which ones I've coded specifically for.
Title: Re: Quest mod virtue compatibility?
Post by: Avenger_teambg on July 10, 2005, 04:48:59 PM
Instead of working yourself, you could encourage quest mod writers to employ virtue and document it too :)
Title: Re: Quest mod virtue compatibility?
Post by: SimDing0™ on July 11, 2005, 06:44:29 PM
Possibly. However, the problem then becomes that if another mod wants to check Virtue, the check requires Virtue to be installed or doesn't work properly. There's no way to reliably check Virtue if the mod's installed and reputation if it isn't. (There's an OR block that can sort of do it, but it doesn't allow for uninstalling Virtue mid-game.)

(And we'd end up getting Virtue penalties of 20 for behaving unkindly to Imoen and stuff.)
Title: Re: Quest mod virtue compatibility?
Post by: the bigg on July 11, 2005, 06:53:35 PM
But it doesn't allow for uninstalling Virtue mid-game.
Rewrite this code a little to detect Virtue presence at game-playing time instead than at install time http://forums.pocketplane.net/index.php/topic,19762.msg259321.html#msg259321  :)
Title: Re: Quest mod virtue compatibility?
Post by: SimDing0™ on July 11, 2005, 07:32:20 PM
Okay, yeh, what you're doing there's pretty clever. I can't say I can easily follow all the code, so I've attempted writing my own which probably won't work.

Code: [Select]
<<<<<<<< isthere.baf
IF
Global("D0VirtueInstalled","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("D0VirtueInstalled","GLOBAL",1)
Continue()
END
>>>>>>>>

<<<<<<<< notthere.baf
IF
Global("D0VirtueInstalled","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("D0VirtueInstalled","GLOBAL",0)
Continue()
END
>>>>>>>>

ACTION_IF NOT FILE_CONTAINS ~baldur.bcs~ ~D0VirtueInstalled~ BEGIN
EXTEND_TOP + ~baldur.bcs~ ~notthere.baf~
END
ACTION_IF NOT FILE_CONTAINS ~baldur25.bcs~ ~D0VirtueInstalled~ BEGIN
EXTEND_TOP + ~baldur25.bcs~ ~notthere.baf~
END

COPY_EXISTING ~baldur.bcs~ ~override~
REPLACE_BCS_BLOCK ~notthere.baf~ ~isthere.baf~
COPY_EXISTING ~baldur25.bcs~ ~override~
REPLACE_BCS_BLOCK ~notthere.baf~ ~isthere.baf~

I'm using the hypothetical EXTEND_TOP + that somebody, probably you, suggested on the WeiDU forum the other day. Now that I look back, a lot of your code looks to be faking this behaviour with the tempbaldur and stuff.

This method still falls down if somebody reinstalls the game completely but keeps their savegames, but I guess that's an obscure enough scenario to be forgivable.

I must say, if I implement this, I'll be pretty impressed if people actually bother adding Virtue support to their mods. :)
Title: Re: Quest mod virtue compatibility?
Post by: Bex on July 11, 2005, 07:37:15 PM
If I could actually, like, code and stuff, I, like, totally would.
Title: Re: Quest mod virtue compatibility?
Post by: the bigg on July 11, 2005, 09:04:58 PM
Okay, yeh, what you're doing there's pretty clever. I can't say I can easily follow all the code, so I've attempted writing my own which probably won't work.

Code: [Select]
<<<<<<<< isthere.baf
IF
Global("D0VirtueInstalled","GLOBAL",0)
THEN
RESPONSE #100
SetGlobal("D0VirtueInstalled","GLOBAL",1)
Continue()
END
>>>>>>>>

<<<<<<<< notthere.baf
IF
Global("D0VirtueInstalled","GLOBAL",1)
THEN
RESPONSE #100
SetGlobal("D0VirtueInstalled","GLOBAL",0)
Continue()
END
>>>>>>>>

ACTION_IF NOT FILE_CONTAINS ~baldur.bcs~ ~D0VirtueInstalled~ BEGIN
EXTEND_TOP + ~baldur.bcs~ ~notthere.baf~
END
ACTION_IF NOT FILE_CONTAINS ~baldur25.bcs~ ~D0VirtueInstalled~ BEGIN
EXTEND_TOP + ~baldur25.bcs~ ~notthere.baf~
END

COPY_EXISTING ~baldur.bcs~ ~override~
REPLACE_BCS_BLOCK ~notthere.baf~ ~isthere.baf~
COPY_EXISTING ~baldur25.bcs~ ~override~
REPLACE_BCS_BLOCK ~notthere.baf~ ~isthere.baf~

I'm using the hypothetical EXTEND_TOP + that somebody, probably you, suggested on the WeiDU forum the other day. Now that I look back, a lot of your code looks to be faking this behaviour with the tempbaldur and stuff.
Yeah, that code seems to be correct (although FILE_CONTAINS search for files (as in COPY) instead of gamefiles (as in COPY_EXISTING), so you need to manually extract baldur.bcs and baldur25.bcs to the override with the + option and then use FILE_CONTAINS ~override/foo~).
tempbaldur was (as you guessed) to fake the EXTEND_TOP + option.
Finally, to keep existing code correct I'd set d0virtuedisable to 1 if Virtue is not installed (add proper IF/THEN block to notthere.baf), and instead of d0virtueinstalled I'd use virtuesetup.

Quote
This method still falls down if somebody reinstalls the game completely but keeps their savegames, but I guess that's an obscure enough scenario to be forgivable.
There is a line where the user must have half a brain after all; however, setting it further is better than keeping it where it is now  ;)

Quote
I must say, if I implement this, I'll be pretty impressed if people actually bother adding Virtue support to their mods. :)
I'd certainly do this - meaning I'll patch all the code in Refinements, Mazzy the Palaidn and tb#quest, and will gently ask Quitch&Littiz to review all hundred or so of pages of RtW code. *loads gun*