Author Topic: Two modding questions  (Read 1880 times)

Zangulus

  • Newbie
  • *
  • Posts: 3
    • View Profile
Two modding questions
« 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.

ai_enabled

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 2052
    • View Profile
Re: Two modding questions
« Reply #1 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.

For herbs, bushes, and other similar vegetation—source code

Regards!