AtomicTorch Studio Forums

CryoFall => Modding info => Topic started by: Zangulus on May 10, 2021, 09:42:48 pm

Title: Two modding questions
Post by: Zangulus on May 10, 2021, 09:42:48 pm
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.
Title: Re: Two modding questions
Post by: ai_enabled on May 15, 2021, 10:39:38 am
Hello!

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

Quote
2) 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!