BGforgeNet / FO2tweaks

Fallout 2 tweaks
https://forums.bgforge.net/viewforum.php?f=26
115 stars 10 forks source link

grenades_anywhere cause party members to attack the player #98

Closed dekrus closed 1 year ago

dekrus commented 1 year ago

When attacking an "empty" hex with a grenade, on some versions of sfall, companions within the "random(4, 6)" radius start attacking the player, even if they were not within the grenade's blast radius.

This part of the code causes this behavior: https://github.com/BGforgeNet/FO2tweaks/blob/1ea03bd878525c64f0731d2581a4803ce0994865/source/gl_g_grenades_anywhere.ssl#L101-L103

I propose to add a check if the object belongs to the player's group.

if object != dude_obj andAlso has_trait(TRAIT_OBJECT,object,OBJECT_TEAM_NUM) != TEAM_PLAYER then set_object_data(object, OBJ_DATA_WHO_HIT_ME, dude_obj); or if object != dude_obj andAlso not(is_in_array(object,party_member_list(1))) then set_object_data(object, OBJ_DATA_WHO_HIT_ME, dude_obj);

burner1024 commented 1 year ago

Some versions? Do you have a reproducible use case?

dekrus commented 1 year ago

В фоллаут 1.5 на этом сейве можно глянуть. Любой extended или 5.0 сфалл. Просто кинуть гранату рядом с напарницей( не важно заденет взрывом или нет)

Также сейв на F2 FE 3.9.3 + ECCO.

На обычном F2 без ессо напарники не нападают на игрока.

burner1024 commented 1 year ago
  1. I only target one sfall.
  2. Regardless, try to recompile the script with the change that you proposed and see if that resolves your issue.
  3. Regardless, if a party member attacks PC for any reason, that seems like a bug in your sfall version and should be reported to its maintainer. Also, try shooting party members and see if they attack you then.
dekrus commented 1 year ago
  1. It turned out that this behavior is present on version 4.3.8 as well, and other custom scripts (not yours) in these mods are likely to blame.
  2. But both of the options I suggested help me prevent "friendly fire" from party members after using grenades on empty tiles.
  3. After directly attacking a party member (with any weapon, including grenades), they still do not attack the player, even after taking damage from him.
burner1024 commented 1 year ago

OK, thanks for testing and suggestions.