tModLoader / tModLoader/tModLoader
Request to add EditActiveRange to tmodloader GlobalNPC.cs
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 5.7k
- Forks
- 2.2k
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 33
Description
Description
Since I'm not yet skilled enough to implement it myself, would it be possible to add EditActiveRange to the GlobalNPC.cs?
I've noticed when increasing spawn range, enemy npcs are still subject to despawning when out of range, even if that range is within the spawn range. And i believe that activeRangeX&Y and activeTime are what govern this.
Im currently working on a mod that relies on being able to see and interact with mobs at a distance, but atm mobs that are too far away despawn.
Following your example in the GlobalNPC.cs, I believe it would look like this?:
public virtual void EditActiveRange(Player player, ref int activeRangeX, ref int activeRangeY, ref int activeTime)
Steps to Reproduce
copypasta?
Expected behavior
Give mobs more range and time to be active before despawning. Or possibly keep them from despawning at all within the activeRange.
Actual behavior
???
Reproduction frequency
n/a
Versions
recent and future versions maybe?
Mods
n/a
Additional Information
n/a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with GlobalNPC.cs and the existing examples there, then trace how activeRangeX, activeRangeY, and activeTime affect NPC despawning. Confirm the requested EditActiveRange hook fits the API and define completion as allowing mods to control those values for distant NPCs; the issue provides no reproduction test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100