Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hallucinations: Misc fixes #54307

Merged
merged 2 commits into from
Jan 12, 2022
Merged

Conversation

dseguin
Copy link
Member

@dseguin dseguin commented Jan 11, 2022

Summary

None

Purpose of change

Fixes #53674.
Fixes #53678.
Fixes #52808.
Fixes #53675.

Describe the solution

Add additional checks for hallucinations on various actions in monster::move, as well as conditional dialogue for hallucinated NPCs. This fixes certain actions to/from hallucinations:

  • Hallucinated monsters can only target other hallucinations or the player
  • Hallucinated monsters cannot shove vehicles
  • Hallucinated monsters and NPCs cannot open doors
  • Attempts to steal from hallucinations always fail
  • Player can no longer trade with hallucinations via interaction menu
  • Hallucinated NPCs cannot train the player (and vis-versa)

Describe alternatives you've considered

I guess some of these bugs could be written off as "the player imagined opening the door/finding that item/etc."

There's some additional weirdness about hallucinations that I haven't addressed here, like projectiles that do real damage (and grenades...)

Testing


Hallucinations can only target other hallucinations and the player

Spawning a zombie hulk (real) and a giant wasp (hallucinated):

monster_target_hallu
target_hallu_gone

Spawning a zombie hulk and a giant wasp (both hallucinated):

fight_hallu

They attack each other, but nothing is printed to the log.


Hallucinations can't shove vehicles

Spawning a zombie hulk next to a beetle results in the hulk shoving the car:

shove_hallu
shove_real

Trying the same with a hallucinated zombie hulk results in the car not being shoved.


Hallucinations can't open doors

(Left: hallucinated feral human, right: real feral human)

open_door_hallu


Attempting to steal from a hallucination

steal_menu
steal_hallu


Asking hallucination to train the player

train_hallu


Attempting to trade via interaction menu

npc_interact_menu
trade_hallu


Additional context

TODO:

  • Restore teleporting hallucinations (so they can move through doors) Looks like it was never broken to begin with
  • Modify friendly dialogue options to prevent taking/giving items from/to hallucinations
  • Testing

@Fris0uman
Copy link
Contributor

All checks to convince a hallucinated NPC to follow are rejected

Befriending hallucination was one of the main point to make hallucination NPcs in the first place #28157

@dseguin
Copy link
Member Author

dseguin commented Jan 11, 2022

Befriending hallucination was one of the main point to make hallucination NPcs in the first place #28157

I see, no problem. I'll revert that particular change.

@Fris0uman
Copy link
Contributor

Also I don't know what happened to that piece of code but in the initial implementation NPC hallucination were setup to teleport throgh doors without opening them.
image

Because if they can't open doors at all they'll stay stuck on the other side instead of following you.

@dseguin
Copy link
Member Author

dseguin commented Jan 11, 2022

That's weird, I'll see if I can restore that behaviour.

@dseguin dseguin force-pushed the fix_hallucinations branch from 71d4ddf to 1342cfa Compare January 11, 2022 21:38
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jan 11, 2022
@Maleclypse Maleclypse added <Bugfix> This is a fix for a bug (or closes open issue) Monsters Monsters both friendly and unfriendly. Mechanics: Character / Player Character / Player mechanics labels Jan 11, 2022
@kevingranade
Copy link
Member

"the player imagined opening the door/finding that item/etc."

There's a whole different can of worms concerning potential hallucinatory items or even hallucinatory changes to the map but the question there is where does it stop and I think unless someone is super super passionate about making a deeper hallucination system that stopping roughly where you have it is the right way to go

@dseguin
Copy link
Member Author

dseguin commented Jan 12, 2022

Because if they can't open doors at all they'll stay stuck on the other side instead of following you.

It looks like that behaviour still works:
2022-01-11.22-02-35.mp4

Not sure if that's the way it's supposed to work, but the door remains closed.

@dseguin dseguin force-pushed the fix_hallucinations branch from 1342cfa to 4f18da9 Compare January 12, 2022 03:46
@dseguin dseguin marked this pull request as ready for review January 12, 2022 04:32
- Prevents hallucinations from attacking non-hallucinations
- Prevents hallucinations from opening doors
- Prevents hallucinations from shoving vehicles
- Prevent hallucinations from opening doors
- Prevent player from stealing from hallucinations
- Prevent player from trading with ally hallucinations
- Prevent player from asking ally hallucinations to drop items
- Prevent hallucinations from training the player (and vis-versa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions Mechanics: Character / Player Character / Player mechanics Monsters Monsters both friendly and unfriendly.
Projects
None yet
4 participants