Home » MODDING HQ 1.13 » Flugente's Magika Workshop » New Feature: Dynamic opinions
Re: New Feature: Dynamic opinions[message #354469 is a reply to message #354466]
|
Wed, 22 August 2018 00:18
|
|
Flugente |
|
Messages:3507
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
|
|
|
|
|
|
New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Fri, 05 August 2016 21:32
|
|
|
Re: New Feature: Dynamic opinions
By: Elvis_A on Fri, 12 August 2016 11:03
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Fri, 12 August 2016 13:46
|
|
|
Re: New Feature: Dynamic opinions
By: Elvis_A on Fri, 12 August 2016 21:26
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Fri, 12 August 2016 21:36
|
|
|
Re: New Feature: Dynamic opinions
By: Elvis_A on Fri, 12 August 2016 23:08
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Fri, 12 August 2016 23:41
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Wed, 22 August 2018 00:18
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Wed, 22 August 2018 10:12
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Wed, 22 August 2018 21:16
|
|
|
Re: New Feature: Dynamic opinions
By: Toybasher on Sun, 16 September 2018 22:10
|
|
|
Re: New Feature: Dynamic opinions
By: freshxx on Fri, 11 January 2019 20:21
|
|
|
Re: New Feature: Dynamic opinions
By: az75 on Sun, 13 January 2019 16:50
|
|
|
Re: New Feature: Dynamic opinions
By: Penta on Sun, 13 January 2019 16:58
|
|
|
Re: New Feature: Dynamic opinions
By: Taro_M on Thu, 29 May 2014 02:26
|
|
|
Re: New Feature: Dynamic opinions
By: grim on Thu, 29 May 2014 02:27
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Shanga on Thu, 29 May 2014 13:34
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Shanga on Thu, 29 May 2014 14:25
|
|
|
Re: New Feature: Dynamic opinions
By: Taro_M on Thu, 29 May 2014 15:08
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Taro_M on Thu, 29 May 2014 16:24
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Taro_M on Thu, 29 May 2014 18:36
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: anv on Fri, 30 May 2014 03:33
|
|
|
Re: New Feature: Dynamic opinions
By: Slax on Fri, 30 May 2014 05:01
|
|
|
Re: New Feature: Dynamic opinions
By: krux on Fri, 30 May 2014 16:33
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: anv on Sat, 31 May 2014 00:46
|
|
|
Re: New Feature: Dynamic opinions
By: krux on Sat, 31 May 2014 12:51
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: anv on Sun, 01 June 2014 03:21
|
|
|
Re: New Feature: Dynamic opinions
By: krux on Sun, 01 June 2014 04:12
|
|
|
Re: New Feature: Dynamic opinions
By: anv on Sun, 01 June 2014 16:28
|
|
|
Re: New Feature: Dynamic opinions
By: krux on Sun, 01 June 2014 18:53
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: anv on Mon, 02 June 2014 21:41
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: anv on Wed, 04 June 2014 01:35
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Slax on Wed, 04 June 2014 04:07
|
|
|
Re: New Feature: Dynamic opinions
By: spelid on Wed, 04 June 2014 17:11
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Slax on Thu, 05 June 2014 00:37
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: anv on Thu, 05 June 2014 03:15
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Taro_M on Sun, 08 June 2014 12:57
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Slax on Tue, 10 June 2014 00:29
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: JMich on Fri, 13 June 2014 01:39
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: anv on Sat, 21 June 2014 03:54
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Thor on Sun, 06 July 2014 14:21
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Thor on Tue, 08 July 2014 22:26
|
|
|
Re: New Feature: Dynamic opinions
By: Randok on Tue, 08 July 2014 23:18
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Randok on Tue, 08 July 2014 23:43
|
|
|
Re: New Feature: Dynamic opinions
By: LootFragg on Mon, 08 September 2014 08:56
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Mon, 08 September 2014 23:12
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Sat, 27 September 2014 23:23
|
|
|
Re: New Feature: Dynamic opinions
By: grim on Tue, 07 October 2014 13:40
|
|
|
Re: New Feature: Dynamic opinions
By: sylar951 on Wed, 08 October 2014 21:01
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Mon, 13 October 2014 23:39
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Tue, 14 October 2014 13:04
|
|
|
Re: New Feature: Dynamic opinions
By: grim on Tue, 14 October 2014 13:49
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Wed, 15 October 2014 01:12
|
|
|
Re: New Feature: Dynamic opinions
By: Shinr on Wed, 12 November 2014 10:50
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Wed, 12 November 2014 13:02
|
|
|
Re: New Feature: Dynamic opinions
By: Wil473 on Wed, 12 November 2014 16:20
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Wed, 12 November 2014 23:08
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Fri, 03 April 2015 18:45
|
|
|
Re: New Feature: Dynamic opinions
By: navaroe on Sat, 11 April 2015 11:21
|
|
|
Re: New Feature: Dynamic opinions
By: navaroe on Sat, 11 April 2015 11:24
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Sun, 19 April 2015 13:35
|
|
|
Re: New Feature: Dynamic opinions
By: smeagol on Sat, 23 May 2015 17:10
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
|
|
|
Re: New Feature: Dynamic opinions
By: Franimus on Thu, 27 August 2015 05:34
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Thu, 27 August 2015 20:24
|
|
|
Re: New Feature: Dynamic opinions
By: Franimus on Fri, 28 August 2015 02:26
|
|
|
Re: New Feature: Dynamic opinions
By: WilsonMG on Thu, 31 March 2016 03:50
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Thu, 31 March 2016 13:07
|
|
|
Re: New Feature: Dynamic opinions
By: WilsonMG on Thu, 31 March 2016 18:01
|
|
|
Re: New Feature: Dynamic opinions
By: Flugente on Fri, 01 April 2016 00:38
|
Goto Forum:
Current Time: Tue Dec 03 08:33:29 GMT+2 2024
Total time taken to generate the page: 0.02546 seconds
|