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

Snippets can now call EOC effects #54139

Merged
merged 6 commits into from
Jan 16, 2022

Conversation

bombasticSlacks
Copy link
Contributor

@bombasticSlacks bombasticSlacks commented Jan 7, 2022

Summary

Features "Snippets can now call EOC effects"

Purpose of change

Something Erk wanted so the game can track what the player does and doesn't have knowledge of for convos with NPCs

Describe the solution

Added the infrastructure to attach an "effect_on_examine" to any snippet with an ID.

the effect is invoked the first time you query the info on the snippet (so on examine). The snippet is stored as being seen and won't call again.

I've added example snippets of "engineer scribbles" to Cody the Artisan Blacksmiths house which after looking at you can ask her about. She'll brush you off currently but in the future there may be followup.

Describe alternatives you've considered

Testing

Spawn the isolated road OMs
talk to Cody
image
examine the papers in front of her
image
talk to her again and note the new dialogue.
image

Additional context

Currently the game crashes if you attempt to give the player an item as an effect while they see a snippet from the look menu.
As well if you open an item from the inventory and it adds an item you can drop the item you were going to examine and get the item info for the spawned item.
In reality no piece of paper should be spawning an item so this shouldn't come up and I imagine would require some heavy reworking of the menus in question to fix.

@NetSysFire NetSysFire added the [C++] Changes (can be) made in C++. Previously named `Code` label Jan 7, 2022
@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 labels Jan 7, 2022
@Ramza13
Copy link
Contributor

Ramza13 commented Jan 7, 2022

So this works but it might be simpler and more powerful if you just supplied an EOC id and then activated that EOC. it would give you access to conditions and I think mean less new code.

@bombasticSlacks
Copy link
Contributor Author

bombasticSlacks commented Jan 7, 2022

Can an EOC add a variable based on the invoking item/id? I thought about that option but if 30 snippets have 30 EOCs that is each just u_add_var: has_read_snippet_x context: world_knowlege that seems really cumbersome and bloated

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 7, 2022
@Ramza13
Copy link
Contributor

Ramza13 commented Jan 7, 2022

So you could make it able to read inline EOCs so it wouldn't be separate entries but you're not wrong that it is kinda bloated.

Another though is to take a look at the message function in npctalk.cpp and the same_snippet argument. I think all I-am-erk wants is to set a variable and you could make a message argument that causes it to set a variable. Not sure if that would mean changing all the newspapers or not though.

Or just ignore me and leave it alone as it does whats needed at the moment.

@bombasticSlacks
Copy link
Contributor Author

bombasticSlacks commented Jan 7, 2022

I think I might have to make it also handle inline EOC's cause erk wants to be able to increment a general knowledge variable. The setup I have works fine for
set variable to true
cause a true variable being set to true again doesn't matter but for a counter variable you need to check

if(has not yet seen this) increment
otherwise it would increment each time the effect was called unconditionally. I'll mull it over and confirm with Erk what he thinks would be easiest on the implementation side.

Erk seems content with just effects access. If it needs to be expanded I can worry about that in the future.

@I-am-Erk I-am-Erk mentioned this pull request Jan 7, 2022
@github-actions
Copy link
Contributor

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • engineer scribbless

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 14, 2022
@bombasticSlacks bombasticSlacks marked this pull request as ready for review January 15, 2022 02:48
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jan 15, 2022
@kevingranade kevingranade merged commit 88fb51c into CleverRaven:master Jan 16, 2022
@bombasticSlacks bombasticSlacks mentioned this pull request Jan 17, 2022
5 tasks
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 [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants