-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Assign faction to (some) item and vehicle placement #56110
Conversation
As long as factions can be spawned multiple times it doesn't really work to define them globally (although I don't know if the current system handles that properly either). |
What do you mean by that? I'm only talking globally within a mapgen, so that the default faction gets set before any of the placement instead of happening at the end. Specifically replacing (for the refugee center):
with
And then instead of having |
I was talking about the issue that there may be several instances of each faction because "unique" isn't. However, as you clarified, this isn't "global" in the world sense, but "global" within the rather limited scope of the specific mapgen. Thus, you're "just" improving on the current logic to be used more efficiently, which is a good thing. |
Took another stab at this. I haven't been able to get jmapgen_loot implemented cleanly and I'm struggling to get data passed around within mapgen's |
Summary
Infrastructure "Assign faction to (some) item and vehicle placement"
Purpose of change
I needed a way to place items and vehicles that are owned by a faction so that the player can't just take them without repercussions.
Also may fix a bug related to variants in the following code, since variant wasn't being included:
Also implemented:
Potential Improvements: (I've tried a couple times, but can't implement these cleanly)
Support jmapgen_loot?Replace faction_owner with global faction in mapgenDescribe the solution
Set a faction for spawning items and vehicles.
Describe alternatives you've considered
Testing
I've tested with
place_item
,item
, andplace_vehicles
on the Tacoma foreman missions and included those changes as examples. When spawned, the items and vehicles correctly show as being owned by the Tacoma commune. I also tested withplace_items
, but don't have an example included.Additional context
In its current state, it solves my initial problem for the Tacoma missions. I've attempted to extend support to improve mapgen, but every attempt so far has been a giant mess that doesn't work. If anyone wants to assist or thinks they know a clean way to make those changes, please let me know.