CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.64k stars 4.18k forks source link

EOC Sample Codes #68432

Open lispcoc opened 1 year ago

lispcoc commented 1 year ago

Is your feature request related to a problem? Please describe.

EOC has good documentation, but not all features have enough sample code. Sometimes it is easier to understand something by looking at the code used than by reading detailed specifications in text.

Solution you would like.

I think we should have the MOD to put together sample code for EOC. In order to include content in vanilla or other overhaul MODs, it is necessary to consider the balance with other elements. I think we need a place where we can purely collect technical ideas and know-how without worrying about such factors.

Describe alternatives you have considered.

No response

Additional context

No response

GuardianDll commented 1 year ago

https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/json/effects_on_condition/example_eocs.json contain examples of EoC usage, and while moving EoC effects from NPCs.md to EFFECT_ON_CONDITION.md, i'm trying to fill it with usage examples (which, fairly speaking, going slow because i'm a bit busy and can afford only small PRs now)

lispcoc commented 1 year ago

https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/json/effects_on_condition/example_eocs.json contain examples of EoC usage, and while moving EoC effects from NPCs.md to EFFECT_ON_CONDITION.md, i'm trying to fill it with usage examples (which, fairly speaking, going slow because i'm a bit busy and can afford only small PRs now)

I think this json should be moved to the MOD folder since it is under vanilla management and event EOC may affect vanilla behavior. I have also personally created some sample code, so I would like to compile it as a PR soon.

GuardianDll commented 1 year ago

i think we can probably put it into TEST_DATA? or, well, just make a separate doc file with examples? but having mod will allow player to just turn it on and see it as it is 🤔

lispcoc commented 1 year ago

I think it's a good idea to put the sample code under the test_data. It's a little hard to see, but I think there will be no problem if we post a link from the document.

ZhilkinSerg commented 1 year ago

There are ~1000 EOCs that are used for something in the game. Why do we need some synthetic examples?

GuardianDll commented 1 year ago

1000 generic EoCs, true, but some examples are not presented whatsoever, and some are not presented enough: for me personally generalized EoCs, using val_var and queue_eocs_with is still a mystery

lispcoc commented 1 year ago

~~As far as I know, these aren't used anywhere in the game (though I think they might have some future use). u_has_part_temp, npc_has_part_temp I think there are probably other functions like this.~~

Sorry, it seems to have been used once in Xedra_Evolved

lispcoc commented 1 year ago

What I feel is particularly problematic is the lack of samples regarding Event EOCs. A issue #68375 was made a while ago, and it turned out that this can be achieved with the current function. I think there is still not enough knowledge sharing among people even who are used to game development.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not bump or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.