How does item ownership actually work?[message #338136]
|
Sun, 07 December 2014 13:46
|
|
CVB |
|
Messages:129
Registered:September 2014 Location: Berlin |
|
|
(I'm not sure if the following is a bug, an incompletely implemented feature or I'm simply too dense to understand the program. Since I assume that the answer needs knowledge of the code, I've placed the question in "Development Discussion" If this is wrong, feel free to move the thread)
1.13 Stable Release V7609 unmodified
In San Mona Sector D5 (Kingpin/Fight Club) there are many items with assigned ownership.
According to the map editor, ownership is as follows:
ACA Building in north estern map corner:
left locker - ammo stash - profile ID of owner is 95 = Kyle Lemmons
middle locker - set of kevlar body armour - profile ID of owner is 78 = Carmen Dancio
right locker - Mini-14 - profile ID of owner is 72 = Maddog
Private house south east of ACA Building:
ammo and stun grenades - profile ID of owner is 91 = Tony
Kingpin's house:
items are owned by profile IDs
73 = Darrel Jr.
77 = Enrico Chivaldori (!)
85 = Brenda Drake
76 = Auntie (!)
94 = Damon
However, if you take any of the items listed above in view of a Kingpin faction member, he turns hostile.
I have even tried to let Maddog take his own Mini-14, with the same result.
Why would Kingpin protect Enrico Chivaldori's or Auntie's possesions?
Why is a character attacked for taking his own items?
Does it even make a difference who is set as the owner of an item, or does the program simply react to any taking of an owned item in the same way?
If there is no difference, what is the purpose of setting the owner ID?
Report message to a moderator
|
Sergeant
|
|
|
|
|
|
Re: How does item ownership actually work?[message #338227]
|
Fri, 12 December 2014 12:04
|
|
Deleted. |
|
Messages:2663
Registered:December 2012 Location: Russian Federation |
|
|
First, the soldier profile of the ownership item is checked.
Second, the CIV_GROUP is checked.
HICKS_CIV_GROUP is skipped if FACT_HICKS_MARRIED_PLAYER_MERC is true.
If the owner is alive (bLife >= OKLIFE) and can see merc who picks item, then he becomes grumpy.
See code in Handle Items.cpp
Toggle Spoilervoid CheckForPickedOwnership( void )
{
ITEM_POOL * pItemPool;
UINT8 ubProfile;
UINT8 ubCivGroup;
SOLDIERTYPE * pSoldier;
UINT8 ubLoop;
// LOOP THROUGH LIST TO FIND NODE WE WANT
GetItemPool( gsTempGridNo, &pItemPool, gpTempSoldier->pathing.bLevel );
while( pItemPool )
{
if ( gWorldItems[ pItemPool->iItemIndex ].object.usItem == OWNERSHIP )
{
if ( gWorldItems[ pItemPool->iItemIndex ].object[0]->data.owner.ubOwnerProfile != NO_PROFILE )
{
ubProfile = (UINT8) gWorldItems[ pItemPool->iItemIndex ].object[0]->data.owner.ubOwnerProfile;
pSoldier = FindSoldierByProfileID( ubProfile, FALSE );
if ( pSoldier )
{
TestPotentialOwner( pSoldier );
}
}
if ( gWorldItems[ pItemPool->iItemIndex ].object[0]->data.owner.ubOwnerCivGroup != NON_CIV_GROUP )
{
ubCivGroup = gWorldItems[ pItemPool->iItemIndex ].object[0]->data.owner.ubOwnerCivGroup;
if ( ubCivGroup == HICKS_CIV_GROUP && CheckFact( FACT_HICKS_MARRIED_PLAYER_MERC, 0 ) )
{
// skip because hicks appeased
pItemPool = pItemPool->pNext;
continue;
}
for ( ubLoop = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; ubLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ubLoop++ )
{
pSoldier = MercPtrs[ ubLoop ];
if ( pSoldier && pSoldier->ubCivilianGroup == ubCivGroup )
{
TestPotentialOwner( pSoldier );
}
}
}
}
pItemPool = pItemPool->pNext;
}
}
and also
void TestPotentialOwner( SOLDIERTYPE * pSoldier )
{
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife >= OKLIFE )
{
if ( SoldierToSoldierLineOfSightTest( pSoldier, gpTempSoldier, TRUE, CALC_FROM_ALL_DIRS ) )
{
MakeNPCGrumpyForMinorOffense( pSoldier, gpTempSoldier );
}
}
}
Report message to a moderator
|
|
|
|
|
|