Author Topic: Implementation/compatibility questions for RtW.  (Read 2192 times)

Offline Littiz

  • Planewalker
  • *****
  • Posts: 23
Implementation/compatibility questions for RtW.
« on: September 21, 2005, 02:59:09 AM »
Ok, I'm planning to do some real work to integrate the Virtue system with RtW (if it's still fine for you, of course).
I know Quitch asked something already, but he does a lot of boasting and little action ;D

I'd really need to be "educated" a bit in the field.
I remember we included already some code for the Sword Angel kit, and that I can use a check to know if Virtue is installed or not.
What troubles me a bit is that if I must add this check and branching to the existing dialogues, many blocks would need to be exploded even further... but I hope I'll be able to handle this (but I admit it would even better if you have some simplier magical tricks  ;D).
What are the some strictly coding-wise issues I should be aware of?

Also, I'd need some "directions".
See, we have some internal checks about Player's action and choices.
Of course we'll have to decide when it's time for a Virtue change too, or when it's time for a reputation change only, and all.
If possible I'd like to stay close to your "style" when it comes to such decisions.
For instance, do you apply Reputation changes for actions taken in front of intelligent, talking monsters? Maybe only if they live to tell? (I hope we're not in such a level of detail).

Summaring, I need a bit of generic help/suggestions, if you can provide them. :)
(there's no hurry whatsoever, of course...)

Offline SimDing0

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Implementation/compatibility questions for RtW.
« Reply #1 on: September 21, 2005, 05:59:27 PM »
Right now, it's awkward for other mods to detect Virtue, since it relies on checking the D0Virtue global is greater than 0, which is also the case in savegames where Virtue has been uninstalled. I'll soon be releasing a version that uses the_bigg's method to set a more reliable variable "at install time". That's for Virtue checks, at least.
For Virtue changes, I tend to use a slightly naughty hack. Just include the Virtue changes in the dialogues/scripts anyway, and if Virtue isn't installed, it's just a dud variable and nothing happens. This does mean that the player will get a ton of Virtue changes all in one go later on if they install (which I'm currently investigating fixing), but I've been prepared to ignore that, and thus far nobody's complained.

There are three variables you'll be interested in for Virtue:
 * "D0Happiness","LOCALS" - This represents an NPC's happiness with the player's actions. Do not modify it directly.
 * "D0Virtue","GLOBAL" - This is your Virtue. Do not modify it directly.
 * "D0Change","GLOBAL" - This is what triggers Virtue changes, and this is what you modify. Always IncrementGlobal rather than SetGlobal.

Also bear in mind that Virtue has to be installed last. This means that RTW can't really detect if Virtue's installed in the TP2 and patch appropriately. You can work around this by duplicating the code I use to remove all incidences of ReputationInc if you want, but I'd suggest that it'd be easier to code for Virtue being installed last.

I assign Virtue changes on the basis that an evil act is one which intentionally and significantly harms an undeserving victim, physically or emotionally, while a good act is one which intentionally benefits a deserving one. Given that Virtue is only a 1-20 scale, however, it's only the more significant events which trigger changes-- telling Aerie you like her hair may make her feel good about herself, but it doesn't warrant a Virtue increase. I try to stay true to this even in the face of cultural or religious pressures: as much as incest is frowned upon, I wouldn't assign it a Virtue penalty, for example; and paladins do not take Virtue hits specifically for breaking their code by lying or whatever.
Reputation changes are typically assigned based on what word of your actions is likely to escape to "the outside world". This is a very broad category, and in BG2 terms, it typically means "demihuman communities on the surface". Your actions in the Underdark don't tend to trigger reputation changes because the chances of any news of it spreading to the surface are enormously slim. This does mean that there's no effective reputation counter for Ust Natha, but I'm willing to forgive that.

If you have any specific coding questions, feel free to ask me, and if there are any situations you'd like moral judgement on, you're welcome to start a thread here for debate.

Offline Littiz

  • Planewalker
  • *****
  • Posts: 23
Re: Implementation/compatibility questions for RtW.
« Reply #2 on: September 22, 2005, 01:08:59 PM »
Thanx Sim, please be patient since I'll be a little pedant ;D
Again, no real hurry for the answers though ;)

Quote
For Virtue changes, I tend to use a slightly naughty hack. Just include the Virtue changes in the dialogues/scripts anyway, and if Virtue isn't installed, it's just a dud variable and nothing happens.
If I can use something like this, almost all of my problems would be solved...
Quitch dialogues were "aware" of the ugly reputation implementation even before he knew about Virtue.
So, he planned Reputation drops, as a method, only for situations where the "word can actually spread".
As for purely good or evil acts, they have RtW-wise consequences despite of what may happen to Reputation.

In other words, we have already a sort of "internal Virtue system".
In this case, I'd just have to add Virtue changes in the proper places, and that'd be it...

Quote
There are three variables you'll be interested in for Virtue:
* "D0Happiness","LOCALS" - This represents an NPC's happiness with the player's actions. Do not modify it directly.
* "D0Virtue","GLOBAL" - This is your Virtue. Do not modify it directly.
* "D0Change","GLOBAL" - This is what triggers Virtue changes, and this is what you modify. Always IncrementGlobal rather than SetGlobal.
What kind of actions would the first two variables require, then? (I mean, from my part).

Quote
Also bear in mind that Virtue has to be installed last. This means that RTW can't really detect if Virtue's installed in the TP2 and patch appropriately. You can work around this by duplicating the code I use to remove all incidences of ReputationInc if you want, but I'd suggest that it'd be easier to code for Virtue being installed last.
I'm afraid I'm not following you.
But maybe all of this is a non-issue, given the fact that we already treat Reputation in a similar way as yours (as I take it)?

Offline SimDing0

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Implementation/compatibility questions for RtW.
« Reply #3 on: September 23, 2005, 06:54:37 AM »
What kind of actions would the first two variables require, then? (I mean, from my part).
To update them, nothing. Virtue does that automatically. I just mention them in case you want Virtue or NPC happiness checks anywhere,

Quote
I'm afraid I'm not following you.
But maybe all of this is a non-issue, given the fact that we already treat Reputation in a similar way as yours (as I take it)?
I'm just saying that Virtue will need to be installed after RTW (since I replace all ReputationInc actions in a C_E_R), so ideally the RTW Virtue support wouldn't need any ACTION_IF stuff in the TP2.

Offline Quitch

  • Perfection
  • Planewalker
  • *****
  • Posts: 270
  • Making the world a better place for evil
Re: Implementation/compatibility questions for RtW.
« Reply #4 on: September 23, 2005, 11:09:36 AM »
Ok, I'm planning to do some real work to integrate the Virtue system with RtW (if it's still fine for you, of course).
I know Quitch asked something already, but he does a lot of boasting and little action ;D

I've never known anyone complain so much.

I've got virtue well covered and introducing it into the existing code shouldn't be a problem.  Certain checks might need changing, and virtue will be set in places where nothing currently is, but there will be no new branches as such.  Virtue, as you say, was already accounted for before I even knew it existed, we just need to change a few things from alignment checks to virtue checks.  We won't bother accounting for non-virtue players.
Past: Ascension
Present: Return to Windspear
Future: Imoen Relationship
"Perfection has no deadline"

Offline Littiz

  • Planewalker
  • *****
  • Posts: 23
Re: Implementation/compatibility questions for RtW.
« Reply #5 on: September 24, 2005, 03:27:00 AM »
Thx Sim, I think I got it, more or less ;)

Quote
I've never known anyone complain so much.
Define "complain".
Is that sit down and doing something that the others talk about doing yet don't do?

If it is, then you have little to worry, since this revitalization attempt of mine is the last one.
Then I'll give up myself (as you were going to do just a few days ago), and I'll leave the mod to people interested in "resurrecting" it (if any)..

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: