Two modding questions

Started by Zangulus, May 10, 2021, 09:42:48 PM

Zangulus

1) How do I tell if the player is currently in a land claim they own or are part of the faction?
2) Where is the code for picking grass and items off the ground?

Thank you.

ai_enabled

Hello!

Quote1) How do I tell if the player is currently in a land claim they own or are part of the faction?
if (LandClaimSystem.SharedIsOwnedLand(character.TilePosition,
                                      character,
                                      requireFactionPermission: false,
                                      out _))
{
    // the character owns the land under it
    return false;
}


Quote2) Where is the code for picking grass and items off the ground?
For grass, twigs and similar small click-to-pickup objectsΓÇösource code (https://github.com/AtomicTorchStudio/CryoFall/blob/f656598b5a1d0eaa4dbc59ab2b8c66eb2f133b57/Core.cpk/Scripts/StaticObjects/Loot/Base/ProtoObjectLoot.cs#L185).

For herbs, bushes, and other similar vegetationΓÇösource code (https://github.com/AtomicTorchStudio/CryoFall/blob/f656598b5a1d0eaa4dbc59ab2b8c66eb2f133b57/Core.cpk/Scripts/StaticObjects/Vegetation/Base/ProtoObjectGatherableVegetation.cs#L158)

Regards!