Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New Feature: Dynamic opinions
|
|
|
|
Re: New Feature: Dynamic opinions[message #337704]
|
Wed, 12 November 2014 23:08 
|
|
Flugente |
 |
Messages:3506
Registered:April 2009 Location: Germany |
|
|
As of r7652, mercs will only complain about other mercs killing civilians if the civilian as non-hostile at the moment of their death.
This means that killing a member of any faction does not result in the opinion change if that person is hostile at the moment of his death. However, if they are neutral, this will cause the opinion-change - even if the faction goes hostile right afterwards.
Example: If you visit the Hicks while they are friendly and then, say, gun down a Hick with an auto-burst in realtime, this will cause other mercs to complain, as that guy was peacefully minding his own business. Once the battle has started however, they are fair game. Seems fair enough to me, chivalry on the battlefield will thus not cause negative feedback among your troops 
This does not require any faction-checks, so should work at any UC-faction etc..
Also note that the only mercs complaining about this are those considered 'good guys' in their profile (basically those that refuse to shoot civilians in the first place). If you really want to avoid this (and have a bit of evil role-playing), you could set up a dedicated death squad that has no problems with this :pitchfork:
Report message to a moderator
|
|
|
|
|
Re: New Feature: Dynamic opinions[message #340392 is a reply to message #337718]
|
Fri, 03 April 2015 18:45 
|
|
Flugente |
 |
Messages:3506
Registered:April 2009 Location: Germany |
|
|
A few updates as of r7807 & GameDir r2233:
- Fix: dynamic opinion events on finishing battle did not occur due to faulty sector coordinates
- Fix: dynamic dialogue boxes were displayed with bad screen coordinates. This happened if a merc was talking simultaneously.
- Change: dynamic dialogue is also written into tactical log
- Change: in events that require a leader, any merc can be considered a leader, not just IMPs. The leader 'rating' is based on leadership, experience, and whether or not the merc has the squadleader trait and is an IMP. A a result, mercs will more often blame someone else for screwing up things, or praise the one most likely to be the 'commander' for victorious battles.
- added a few new dynamic opinion events:
- OPINIONEVENT_BESTCOMMANDEREVER - we won an important battle. Surely our leader's great strategy was a huge part of that...
- OPINIONEVENT_BATTLE_SAVIOUR - someone saved our life: they killed an enemy that was attacking us, while we were wounded. In this case, 'wounded' means 'we had at least 10 hp missing unbandaged. This makes 'farming' this somewhat not easy. Friendship requires a blood sacrifice!
- OPINIONEVENT_FRAGTHIEF - someone stole OUR kill. Dastardly fragfarmer! This server suxx! This event will be initated by 'arrogant' of 'showoff' character mercs.
- OPINIONEVENT_BATTLE_ASSIST - someone took an enemy down with our assistance. We are such a good team.
- OPINIONEVENT_BATTLE_TOOK_PRISONER - someone convinced the enemy to surrender. We like that, because we're not some insane psychopath. This event will be initiated by 'good guy' mercs, and those with a pacifist or intellectual character.
This batch of new events has the aim of making mercs that fight together 'interact' more with each other.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
|
|
Re: New Feature: Dynamic opinions[message #340603 is a reply to message #340518]
|
Sun, 19 April 2015 13:35 
|
|
Flugente |
 |
Messages:3506
Registered:April 2009 Location: Germany |
|
|
Update:
- r7820: Change: dynamic opionion: mercs only complain about retreat if the enemy was aware of them - otherwise they assume it was a sneaky operation, which won't be punished. So entering a sector and then leaving again, without enemy contact, won't give you any complaints from this feature (you will still get the usual morale penalty though).
- r7821: Change: the event OPINIONEVENT_BESTCOMMANDEREVER is only called if
- we won the battle battle,
- the enemy outnumbered us at least 2:1,
- the enemy had at least 4 times our losses and
- the enemy patrol numbered at least MAX_STRATEGIC_ENEMY_GROUP_SIZE people
As this event gives a significant bonus, making it harder to get seems fair to me. - r7824: Fix: mercs no longer complain about civilians if you kill cows or crows.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
|
Re: New Feature: Dynamic opinions[message #341756 is a reply to message #341117]
|
Wed, 15 July 2015 21:48 
|
|
Flugente |
 |
Messages:3506
Registered:April 2009 Location: Germany |
|
|
As of r7919, specific events can be turned off by simply setting their modifier in Morale_Settings.ini to 0. This is useful if you want to play with this feature, but feel that a specific event is silly, or not required, or whatever.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: New Feature: Dynamic opinions[message #344813 is a reply to message #342231]
|
Thu, 31 March 2016 03:50 
|
|
WilsonMG |
 |
Messages:28
Registered:October 2011 Location: USA |
|
|
I just disabled Dynamic Opinions and Dynamic Dialogue because they were causing nothing but negative relationships over trivial/inconsequential things. I noticed after disabling Dynamic Opinions and then putting it back on that the previous values were retained in MeLoDY... While Dynamic Opinions is disabled, are these values still present, just hidden because you no longer have access to MeLoDY or are they removed entirely?
EDIT: After some experimentation I was able to leave Dynamic Opinions on and just cancel out the relationship modifiers I found annoying, thereby "fixing" my merc's relationships somewhat. It's a workable solution that has allowed me to continue on.
[Updated on: Thu, 31 March 2016 09:40] Report message to a moderator
|
Private 1st Class
|
|
|
Re: New Feature: Dynamic opinions[message #344814 is a reply to message #344813]
|
Thu, 31 March 2016 13:07 
|
|
Flugente |
 |
Messages:3506
Registered:April 2009 Location: Germany |
|
|
The opinion values are stored in variables on each merc. Disabling the feature causes them to be no longer used by the morale system, nor being displayed, but they ar still there. Thus reactivating the feature means they are used again.
If you deactivate the feature, morale should slowly go back to 'normal' (without dynamic opinions). It might take a bit, as morale cannot change instantly (outside of combat).
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
|
Re: New Feature: Dynamic opinions[message #344821 is a reply to message #344815]
|
Fri, 01 April 2016 00:38 
|
|
Flugente |
 |
Messages:3506
Registered:April 2009 Location: Germany |
|
|
Yeah, I get that some events feel somewhat unncessary and somewhat silly ('frag-stealing' etc.). To be honest, I'm not totally content with some of the mechanics (like every event only happening once per day), but some limitations would have required more complicated code than I was feeling appropriate. As for the number of positive events - this feature was mostly born out of frustration that mercs were too damn happy all the time. Vanilla mercs team morale is like managing a bunch of Khorne berserkers - as long as you give them plenty of people to murder on a regular basis, they are as happy as a little girl on a pony farm. I'd actually like more negative events, but it 's not on my priority now.
Anyway, setting an event's modifier in Morale_Settings.INI to 0 stops that event from happening (not entirely sure you meant that, so there you go, in case you didn't).
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
|
|
Re: New Feature: Dynamic opinions[message #346492 is a reply to message #346464]
|
Fri, 05 August 2016 21:32 
|
|
Flugente |
 |
Messages:3506
Registered:April 2009 Location: Germany |
|
|
There are several slots in MercProfiles.xml for IMPs (PGMale, PGLady...). In that xml, friend relations are also set. When we create an IMP, we use one of these slots to write their data into. Note that after a game starts, MercProfiles.xml is stored in the savegame, editing the xml only affects a new game.
Thus what you could do is to set up the xml before you start the campaign by setting up possible friendships. Be warned though, unless you use a debugger you will not know for sure which IMP gets which slot.
The fact that we store the profile data in savegames is somewhat annoying. For some data it is perfectly reasonable (friend/hated relations are altered over time, stats grow over time...). For others it is very annoying (switching traits/personality/face anim coordinates/anything else requires a new campaign).
A good idea would be to create 2 xmls - one for data that is stored in savegame, one for data that is read purely from xml. Unfortunately, changing that would require significant savegame changes and require any modder to split their xmls too. Which is quite a hassle. Quite a few xmls have stupid things in there (like Ammotypes.xml) that we don't change for compatibility reasons.
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
Re: New Feature: Dynamic opinions[message #354469 is a reply to message #354466]
|
Wed, 22 August 2018 00:18 
|
|
Flugente |
 |
Messages:3506
Registered:April 2009 Location: Germany |
|
|
Some of those are good, some rather meh, and some hard to do. I might use some... at some point. I'm not exactly coding a lot at this point.
As to your question, as I don't have a lot of time, perhaps the code yield sufficient explanation for once:
// depending on what happened in the battle, our mercs might complain or celebrate
void HandleDynamicOpinionBattleFinished( BOOLEAN fBattleWon )
{
UINT32 ourlosses = 0;
UINT32 enemylosses = 0;
UINT32 oursidesize = 0;
UINT32 enemysidesize = 0;
// pick the 'leader' who gets all the praise (or blame, depending on how this went)
UINT8 leaderid = GetBestMercLeaderInSector( SECTORX( gCurrentIncident.usSector ), SECTORY( gCurrentIncident.usSector ), (INT8)gCurrentIncident.usLevel );
if ( leaderid != NOBODY )
{
// while it would be logical to also take civilian losses into account, this would lead to mercs always disapproving engaging hostile civilain factions like Kingpin and the Hicks
for ( UINT16 i = 0; i < CAMPAIGNHISTORY_SD_CIV; ++i )
{
ourlosses += 10 * gCurrentIncident.usKills[i];
ourlosses += gCurrentIncident.usWounds[i];
ourlosses += 8 * gCurrentIncident.usPrisoners[i]; // having our side being captured is not quite as bad as having them killed
oursidesize += gCurrentIncident.usParticipants[i];
}
for ( UINT16 i = CAMPAIGNHISTORY_SD_ENEMY_ADMIN; i < CAMPAIGNHISTORY_SD_MAX; ++i )
{
enemylosses += 10 * gCurrentIncident.usKills[i];
enemylosses += 11 * gCurrentIncident.usPrisoners[i]; // capturing the enemy is even better than killing them
enemysidesize += gCurrentIncident.usParticipants[i];
}
// if we've taken more losses than the enemy, our mercs will complain - even if we won. Our mercs don't seem to like phyrric victories...
if ( ourlosses > enemylosses && ourlosses > 75 )
{
HandleDynamicOpinionChange( MercPtrs[leaderid], OPINIONEVENT_WORSTCOMMANDEREVER, TRUE, TRUE );
}
else
{
// our mercs praise their leader if
// they won the battle
// the enemy outnumbered them at least 2:1
// the enemy had at least 4 times their losses
// the enemy patrol was of significant size (this is supposed to be given for huge battles only)
if ( fBattleWon && 2 * oursidesize < enemysidesize && 4 * ourlosses < enemylosses && enemylosses > 10 * gGameExternalOptions.iMaxEnemyGroupSize )
{
HandleDynamicOpinionChange( MercPtrs[leaderid], OPINIONEVENT_BESTCOMMANDEREVER, TRUE, TRUE );
}
}
}
}
I know now that it could never work between us, as much as we wanted to, it could never be! Not because you're a rabbit, but because you're black.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.Report message to a moderator
|
|
|
|
|
|
|
|
Re: New Feature: Dynamic opinions[message #354931 is a reply to message #354491]
|
Sun, 16 September 2018 22:10 
|
|
Toybasher |
 |
Messages:20
Registered:April 2018 |
|
|

I like the feature but I dislike how much negative things outweigh the positive. Johnny throws a hand grenade and a single piece of shrapnel hits Tommy and bounces off his vest? He gets super pissed.
Bob likes to steal shit? (No way to really control it) everyone hates him.
I also get messages like "X didn't share food" mercs can share food? If it's because they refuse because they hate each other than that only makes relationships worse! I also noted it seems to get triggered when a merc doesn't even have food TO share! I.E. if I have my mule carrying a crapton of food for the rest of my team everyone bitches at eachother apparently everyone is supposed to not only have food on them, but share it too.
I punched Pablo because he stole shit, and every merc (and seemingly not only the Good Guy Mercs like Ira or M.D.) got mad at me. Even Bull who seems to be the kind of guy who wouldn't give a shit.
I use a booster (Regen, Combat Stim, Energy, etc.) suddenly everyone accuses me of being a drug addict. (IDK if it still happens if someone else administers it) if it was specific to Larry or a merc was using them multiple times in one battle then sure, but it shouldn't be for literally one use on a merc who is nearly dead.
Have a single beer, "X is annoying when drunk!" across seemingly all mercs. I also have "X gets all the good stuff" on nearly every merc.
EDIT: What I think is going on is often when I have hungry mercs, I go to a nearby bar, order food for each merc one at a time (Walk up to bartender, select buy, buy and eat food, walk up next merc, buy and eat food, etc.) and maybe that's triggering it.
[Updated on: Mon, 17 September 2018 23:56] Report message to a moderator
|
Private 1st Class
|
|
|
|
Re: New Feature: Dynamic opinions[message #356404 is a reply to message #356378]
|
Sun, 13 January 2019 16:50 
|
|
az75 |
 |
Messages:189
Registered:June 2012 Location: Romania |
|
|
Perhaps we should have them terrorists become hostile in dialogue, thinking maybe like the general from Alma becomes hostile...they shouldn't be considered innocent civilians.
[Updated on: Sun, 13 January 2019 16:54] Report message to a moderator
|
Staff Sergeant
|
|
|
Re: New Feature: Dynamic opinions[message #356405 is a reply to message #356404]
|
Sun, 13 January 2019 16:58
|
|
Penta |
 |
Messages:60
Registered:May 2008 |
|
|
How exactly is the "Brutal" opinion triggered?
Reason I ask is because it seems like it gets triggered way too often, no matter what I do. I want to keep it turned on, just...not as frequently invoked...
Report message to a moderator
|
Corporal
|
|
|
Goto Forum:
Current Time: Sun Mar 16 20:57:22 GMT+2 2025
Total time taken to generate the page: 0.02823 seconds
|