Kaidonni, this is what I meant:
- Code: Select all
function keep_item(npc, item)
if item==nil or alife():object(item:id())==nil then return end
if npc == nil then return end
local section = item:section()
That still might not work, but it is something that exists in the AIPack for some reason -- probably to handle grenades or other items that have been deleted.
¯¯¯¯¯¯¯¯¯¯
Grump642, that is strange. One possible cause:
Group is different from
faction, and the group that exists near Fanatic/Sid is not associated with them -- but the dude near the bridge was. Or perhaps Sid/Fanatic were marginal on their goodwill with you for other killings or incidental damage.
Some background for the curious: As I understand it, there are three different sets of values relating to goodwill/relation: individual, group (usually in lairs, gulag, camps) and faction (loners, Freedom, Duty, ecologists, bandits, mercenaries, military, Monolith, etc.).
The attitude that an NPC has toward you is an algebraic sum of these values. Below -400, you are enemy. Above 500 means friend. The limits: -3000, +1000 for the faction, but only -1000, +1000 for the individual.
* Cf.
gamedata\config\creatures\game_relations.ltx.
Lairs are based on group assignments instead of proximity. One example of this is that you can turn the border Freedomers friendly by defending the border against the Monolith, but Cap usually stays neutral until the faction itself goes green. (Of course there are exceptions, like healing Cap or shooting the dudes that specifically hit him.)
Skull's group is also an example: If they turn enemies for any reason against you where you didn't fire the first shot (unprovoked attack does a lot more damage to your relationship with Duty than hurting folks already in battle mode), then you can shoot at them with impunity, as hurting
enemies does not affect faction relationship at all. From
game_relations.ltx:
- Code: Select all
free_friend_attack_goodwill = -2500
free_neutral_attack_goodwill = -1000
free_enemy_attack_goodwill = 0
danger_friend_attack_goodwill = -200
danger_neutral_attack_goodwill = -200
danger_enemy_attack_goodwill = 0
One can see from the above the various ways in which helping Freedom dealing with Skull's group affects your relationship with Duty.
Another example is Pavlik. If you shoot him before he turns enemy, you incur the wrath of Freedom. Once he programmatically turns red on the mini-map display (or disappears), you will suffer no loss of goodwill with Freedom to take him down.
Hurting a non-enemy member of a group or faction
normally affects your goodwill with the group/faction if they are aware that it was you (e.g., the guy you shot saw or heard you before he died, or his buddy saw/heard you).
Finally, you can be neutral with an individual in a group of friends, probably due to collateral damage. Or, for that matter, enemies in a group of neutrals...
__________
*This is why you can drop a medkit to heal an enemy with code to set him to friend status, but he remains enemy due to the vastly greater negative faction contribution.
Without the letter R, friends would be fiends.