-
Notifications
You must be signed in to change notification settings - Fork 473
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
NFSD Criminal Records Fix + Shipyard Fax Records System #1578
base: master
Are you sure you want to change the base?
Conversation
…ontier-station-14 into nfsd-criminal-records
…ontier-station-14 into nfsd-criminal-records
After upstream update only since this is editing |
Thats okay! Plan is to work on finishing the systems here. And fix any resulting issues from the merge. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
RSI Diff Bot; head commit f72e196 merging into 4291674 Resources/Textures/_NF/Objects/Misc/shipyard_record_fax_paper.rsi
|
Oh also get sprite to replace the lab NTX header with something more fitting... |
OKAY should be mostly ready up. and then getting some requirements fit and should be ready |
Fix uppercase mistake
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.
Summary: I like it, not a huge fan of how it's done here - criminal records should use a global record service (see pirate bounties), and shipyard should probably be through a PDA app. Will help when I can on these.
The fundamental idea here is good. I think the idea of having a sector-wide criminal records system makes sense. I don't think the changes as you wrote them do that exactly - I can help get a prototype for that when I have some time.
I'm pushing for a change in the pirate bounties to how sector-wide services can be globally created, accessed and stored (so you only have one "canonical" set of components) rather than using a component query.
I think that having the shipyard records stored in a PDA app might make sense. You won't need to spawn hundreds of entities for ships that will be eventually sold, and you will be able to track ships when they are sold. I know that this requires a lot of rework, happy to help with this when I have time.
I think that using false information for pirates is interesting in theory, but I maintain that the information should be plausible, and appear at first glance as a credible shipyard report.
The class per-shuttle is useful, but you've applied it to very few actual vessels.
The code review I left is largely irrelevant, as I think this needs a good few changes.
[DataField("class")] | ||
public string Class = "Undetermined"; |
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.
If you move this to an enumeration, you get some "free" validation when creating a new ship.
var faxQuery = EntityQueryEnumerator<ShipyardRecordPaperComponent>(); | ||
|
||
while (faxQuery.MoveNext(out var faxUid, out var recordPaperComp)) | ||
{ | ||
var ev = new ShipyardRecordPaperTransmitEvent(name, _profile.Name, _profile.Species, _profile.Gender, _profile.Age, _fingerprintComponent!.Fingerprint!, _dnaComponent!.DNA!, vessel.Category, vessel.Class, vessel.Group, vessel.Price, vessel.Description); | ||
RaiseLocalEvent(faxUid, ref ev); | ||
} |
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.
Does a broadcast event work here instead?
var faxQuery = EntityQueryEnumerator<ShipyardRecordPaperComponent>(); | |
while (faxQuery.MoveNext(out var faxUid, out var recordPaperComp)) | |
{ | |
var ev = new ShipyardRecordPaperTransmitEvent(name, _profile.Name, _profile.Species, _profile.Gender, _profile.Age, _fingerprintComponent!.Fingerprint!, _dnaComponent!.DNA!, vessel.Category, vessel.Class, vessel.Group, vessel.Price, vessel.Description); | |
RaiseLocalEvent(faxUid, ref ev); | |
} | |
RaiseLocalEvent(ref ev); |
|
||
/*var query = EntityQueryEnumerator<SectorStationRecordComponent>(); | ||
|
||
while (query.MoveNext(out var stationGridUid, out var comp)) | ||
{ | ||
if (TryComp<StationMemberComponent>(stationGridUid, out var stationMemberComponent)) | ||
{ | ||
var stationEntityUid = stationMemberComponent.Station; | ||
|
||
CreateGeneralRecord(stationEntityUid, args.Mob, args.Profile, args.JobId, stationRecords); | ||
|
||
/* | ||
if (TryComp<StationRecordKeyStorageComponent>(targetId, out var keyStorage) | ||
&& stationEntityUid != null | ||
&& keyStorage.Key != null) | ||
{ | ||
if (!TryGetRecord<GeneralStationRecord>(Key.Value, out var record)) | ||
continue; | ||
} | ||
} | ||
|
||
}*/ |
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.
Is this here for a reason?
/*var query = EntityQueryEnumerator<SectorStationRecordComponent>(); | |
while (query.MoveNext(out var stationGridUid, out var comp)) | |
{ | |
if (TryComp<StationMemberComponent>(stationGridUid, out var stationMemberComponent)) | |
{ | |
var stationEntityUid = stationMemberComponent.Station; | |
CreateGeneralRecord(stationEntityUid, args.Mob, args.Profile, args.JobId, stationRecords); | |
/* | |
if (TryComp<StationRecordKeyStorageComponent>(targetId, out var keyStorage) | |
&& stationEntityUid != null | |
&& keyStorage.Key != null) | |
{ | |
if (!TryGetRecord<GeneralStationRecord>(Key.Value, out var record)) | |
continue; | |
} | |
} | |
}*/ |
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.
With it I believe initially reason for leaving it was to make it easier to in future to upstream merges.
As the original code wiukd ecist as commwnted and in case new changes broke whole aystwm then changes could be disabled if needed.
Though there is chance that the idea behind the commented out block has changed
// Randomises job | ||
var random = _robustRandom.Next(1, 3); | ||
|
||
switch(random) | ||
{ | ||
case 1: | ||
playerJob = "Contractor"; | ||
break; | ||
case 2: | ||
playerJob = "Pilot"; | ||
break; | ||
case 3: | ||
playerJob = "Mercenary"; | ||
break; | ||
default: | ||
//Do nothing, when real job is visible that means something bad happened | ||
break; | ||
} |
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 don't think Mercenary will ever be selected. Also,
// Randomises job | |
var random = _robustRandom.Next(1, 3); | |
switch(random) | |
{ | |
case 1: | |
playerJob = "Contractor"; | |
break; | |
case 2: | |
playerJob = "Pilot"; | |
break; | |
case 3: | |
playerJob = "Mercenary"; | |
break; | |
default: | |
//Do nothing, when real job is visible that means something bad happened | |
break; | |
} | |
string[] jobs = { "Contractor", "Pilot", "Mercenary" }; | |
// Randomises job | |
var random = _robustRandom.Next(jobs.Length); | |
playerJob = jobs[random]; |
while (stationList.MoveNext(out var stationUid, out var stationRecComp)) | ||
{ | ||
if (TryComp<StationRecordKeyStorageComponent>(idUid.Value, out var keyStorage) | ||
&& stationEntityUid != null | ||
&& keyStorage.Key != null) | ||
{ | ||
if (!TryGetRecord<GeneralStationRecord>(keyStorage.Key.Value, out var record)) | ||
continue; | ||
|
||
AddRecordEntry((EntityUid) stationEntityUid, record); | ||
break; | ||
} | ||
} |
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.
What is the purpose of this loop? Neither stationUid and stationRecComp are used. Why would the global/sector record set need two separate station records, one for each station?
Might be missing something, but I don't quite get it.
If you want all of the criminal records computers to work on a global database, I think this needs a few changes in order to work, and at that point the access to the computer should probably be locked behind access groups.
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 have utilised code from the Shipyard that created new record.
Basically wanted to allow another station [NFSD Outpost in current state] to posses these records WITHOUT messing up other aspects like latejoining.
As the current station crew records are very one station heavy at moment codewise
if (!TryComp<IgnoreSectorStationRecordComponent>(player, out var playerComp)) | ||
{ |
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.
If statement avoids the entire while body. Push to the outside.
@whatston3 in regards of ship and class. |
Pardon the delay.
Fair point - I'd probably recommend adding it (merge conflicts be damned, the edits are small enough) I do want to return to this and help out after pirate bounties, seems like the largest open feature apart from the food rework and cargo vend. A bit of patience 🙏 |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
…-station-14 into nfsd-criminal-records
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
About the PR
It allows proper function of criminal records by adding a workaround which lets NFSD Outpost receive a record of each player that spawned in no matter in what location, can be Frontier Outpost, Latejoining vessel etc, it will get it without doubling.
This way NFSD Outpost has records of every single player, and criminal record console it is possible to write notes on player records as well as set their wanted level which works globally(from testing)
Adds system for Pirates and future antags. Where it can either fake the records, AKA real job won't be visible and replaced with one of the three most common jobs (contractor, pilot, mercenary), OR where they won't be registered in record at all.
On top of it is added the Shipyard Records, which every time someone purchases a vessel, a special fax will receive information and print an unique paper describing the vessel, captain and details regarding the captain as well as time.
This should drastically aid NFSD in their job as now they can gather and record evidence more easily.
On top of that vessels won't be anonymous anymore, and SR, STC and Sherrif can figure out who owns what ship.
Adds class to each vessel! Which can more precisely describe what kind of hsip and purpose certain vessel is.
The shipyard record paper color will match it's class.
Moreover Blackmarket and Syndicate vessels will have their information mixed with fake one. Giving detectives something to poke at instead of getting all information on silver platter.
=========
IMPORTANT ASPECT
This PR is gonna require mapping extra 2 faxes [vessel records] to Sherrif's and Station Represenative's offices.
Additionally NFSD Outpost will require extra mapped Criminal Records Consoles to be able to access those.
Also vessel Classes will need to be added to every single vessel in the map prototype, otherwise it will use the default "undetermined" type.
Why / Balance
NFSD greatly lacks managing as well as intel gathering tools. This will mainly assist detectives in forensics. Sherrifs in writing more accurate warrants or even sending patrols to check on suspected ships.
Can be used to record infractions on vessel record themselves.
For STC it will be a MASSIVE help as they got essentially list of every single vessel that exists, able to easily write when they docked and when they should undock.
SR will be able to use this information for other functions as well.
How to test
Add "AdditionalStationRecordsComponent" to NFSD Outpost
Latejoin onto station/ship that isnt NFSD outpost after its added
spawn criminal record console on NFSD
check if player information shows up
for shipyard fax records
spawn special fax with "ShipyardRecordPaperComponent" component
go to any shipyard console
purchase a ship
check the paper that this fax outputted
Media
Breaking changes
Any changes to paper and faxes
Changelog