-
Notifications
You must be signed in to change notification settings - Fork 2
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(code): Permanent changes to the player's ship via conversation actions. #190
base: experimental
Are you sure you want to change the base?
feat(code): Permanent changes to the player's ship via conversation actions. #190
Conversation
…ier to search for This is just the starting point. Nothing much to see here currently.
and some basic error checking for number of elements.
I can't see it doing anything yet, but I think this should in theory write the results to the save file, possibly in the details for the saved job.
It succesfully reaches L530 in GameAction, but it does not enter the For. I'm not sure why, but the log entries at L533 and L537 never turn up; but the one at L530 does all the time.
It succesfully reaches GameAction L530 (as it puts that statement in the log) but it does not enter the for loop in the next line for some reason. (note this is copied from the last time I ran it, before I corrected the text to read
So it succesfully read both the attribute name and amount to change it by in that spot. |
Vitalchip had a moment of inspiration that solved why the map kept getting erased, and now the atribute changes are making there way all the way through the code, and at least in the case of hull, temporarily changing the hull value that is stored in the player's save file but outside the "attributes" section of their ship. So it's not entirely solved yet, but massive progress. Co-Authored-By: vitalchip <[email protected]>
We can now successfully add attributes to the base ship hull! Needs sanity checks and perhaps a clean up and stuff, but in any case, awesome! Many thanks to VitalChip, without whom this would have taken much, much longer. If I even managed it at all. Co-Authored-By: vitalchip <[email protected]>
It works! The code now succesfully permanently alters base hull attributes of the player's flagship. The below code (which is currently in the job in the PR, but will be removed before merging) is fully functional and will add the specified hull or cargo space to the player's ship. This is strictly just the modifying capability. You can add or subtract from attributes, but not set. That part is still to come. Note that there is no inherant safety mechanisms in this (unless those present elsewhere magically kick in), so doing something like setting your hull to negative is possible as of right now.
|
Part 1 of adding "set". Part 3 to follow in a few hours. |
In testing found that there's a slight problem when mass is set to negative. It displays wrong in-game, but then appears correctly at 0.01 after reloading.
OK, both add and set both work now. And to the extent that I have tested, work correctly 100% of the time that the end value is valid. The one place that still needs work is on the handling of negative mass. I haven't tested in the "add" section yet, but in the "set" section when I set the mass to something negative, the code should catch that and change it to 0.01. In-game isn't showing that, though, it just looks like it didn't happen. However, after reloading the game shows that it has in fact saved the 0.01 mass correctly. So it seems like I just need to force it to update something somewhere, as the actual values seem to be working correctly. |
Mass and shields seem to have problems.
Mass and cost are stored separately in |
Thanks! |
SetMass and ModifyMass can probably be condensced at this point, but one thing at a time.
Everything works! Needs more testing, of course, but as best I can tell everything is working. add or set whatever attribute you want. Oh, cost will probably still act a little funny, not updating until reload. Might need to handle that special too, but all the more relevant values. Mass, drag, outfit space, etc. should all work properly. |
Feature
This PR addresses the feature discussed in #184
Summary
The ship has the potential to be the second most important character in the story, second only to the pilot/captain themselves. This is magnified by the fact that while the pilot/captain is the one doing all the talking and interaction in missions, in the rest of the game it is the ship that is doing all the actions. The ship gets shot at, runs away, charges the enemy, kills the enemy, carries the cargo, picks up the debris, etc. We spend virtually all our time dealing with the ship: Buying it, selling it, outfitting it, maneuvering it, praying it doesn't get destroyed, etc. Whereas the Pilot... We get to pick their name, and that's it. For the entirety of the game the pilot is an utter blank void with no discernible attributes or features other than a name, combat ranking, some popularity scores, and a list of what they've done.
Up until now, the ship is a cookie cutter copy. If you have a sparrow, fly it for decades, win the Free Worlds war with it, lead an invasion of Pug occupied territory with it, and travel to the center of the galaxy and back... And it will be, in every single respects, the exact same hull as the sparrow that you buy right out of the shipyard. There is absolutely zero uniqueness, character, or personality in that ship. Many of us love flying the Lampyrid or Emerald Sword precisely because they are unique. They have that personality that pretty much nothing else does.
This aims to change that. This is intend to provide content creators with the ability to, primarily in the course of mission conversations, apply permanent changes to the base ship. These are not outfits to be removed and transferred around, nor are these changes to the overall ship class. If the player buys another ship of the same type, it will not have whatever changes have happened to the other(s). These are changes that will render the ship they are applied to unique.
Scope:
I am initially planning on implementing this strictly for use within the Action node of conversations. That being said, There's really three places where the ship proper could be changed:
So while I am currently focused on the Action node in conversations, I would prefer to make it possible for the code to be reutilized in other places in the future. I'm willing and inclined to go the extra mile in order to make it easy for future efforts to use this code to make permanent changes as well.
Likewise, while I am initially planning on keeping it simple and just applying whatever the change is to the current flagship; in the future I would like to give content creators the flexibility to specify specific ships via UID that the changes apply to, regardless of where that ship is or whether it is the flagship or not. Likewise specifying general models of ships. (ex. "This change applies to the first Argosy")
Usage examples
attributes add hull -100
attributes add fuel 150
attributes set "parasite" 1
Goal:
attribute = Is the keyword that the game looks for to know it is going to be changing an attribute.
add = specifies that the value will be added to the current attribute value (can be negative or positive)
set = specifies that the value will replace the current attribute value.
name of the attribute that is to be added or set to.
how much to be added (can be negative) or what to set the value to. Some things can be negative, some can't.
Testing Done
Some in-game testing of various attributes.
NOTE:
if you have comments, questions, or general suggestions about the idea, please post them on the
Request For Comments - RFC: Ability to make permanent changes to player's flagship or specific ship in fleet #184 .
Please reserve comments here on this PR for things directly pertaining to the code that I have implemented.