-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: Add C# scripting support #667
base: develop
Are you sure you want to change the base?
feat: Add C# scripting support #667
Conversation
81551e3
to
5740041
Compare
- Added Roslyn to the project. - Added an example of parsing game logic settings from a .csx file. - Made GameLogicSettings.csx hotloadable. - Adjusted exp point modifier settings for enemies and quests to be hotload friendly. - Implemented a ScriptModule interface for GameServer scripts. - Converted extended NPC facilities into scripting .csx files for each NPC and made directory hotloadable. New NPC options can be added after the server starts without a restart.
5740041
to
ee1a11f
Compare
Replaced File.ReadAllText with Util.ReadAllText.
Moved game logic settings from the server settings object.
- Refactored code so implementation can be shared between Server and DdonGameServer. - Moved settings into settings module and implemented an example using a less structured scripting module interface. - Created new ScriptableSettings class to assist with interacting with non-structured settings module. - Created README.md files for suggestions and guidelines for module implementation.
return SettingsData.Get<T>("GameLogicSettings", key); | ||
} | ||
|
||
public T Get<T>(string scriptName, string key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getters in this file are simply for compatibility with what currently exists. I've used a different pattern for some of the new code I wrote for this PR as well.
- Created a new 'game_item' module. - Created RookiesRing.csx in the 'game_item' module. - Moved Rookie's Ring settings from general server logic to specific RookiesRing.csx settings file. - Implemented a new 'constant' and 'dynamic' mode for the Rookie's Ring. - Added a new option to completely disable the Rookie's Ring.
cd8243a
to
f832406
Compare
Added a mixin module which is used to collect various scripts which implement common functionality shared across the server and other scripts.
f5d44c8
to
976ff45
Compare
} | ||
else | ||
{ | ||
baseEnemyExp = enemyKilled.GetDroppedExperience(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed i have opinions. We could take this chance to make the exp value in the json nullable. If its null, use the calculated value, if its not, use the json value. A setting could toggle whether these custom values are used or not 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to make exp previews in DDOn Tools a total nightmare to deal with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How hard what it be to have a way to configure default exp calculation by the user? Does Godot have an evaluate feature where we can provide some code in an input box or something in the settings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm almost sure it's possible to do, but the problem is that you'd have to port over whatever your server has set up to Godot's script for DDOn Tools 🤔
hotload friendly.
Checklist:
develop
branch