About NPC Overlay
The NpcOverlay plugin provides functionality to display overlays (text) above NPCs in the Rust game. This can be particularly useful for developers or server administrators who wish to provide additional context or information about an NPC, such as their name, role, or any other relevant details.
Features
- Dynamic Overlays: Allows server administrators to set custom text overlays for NPCs.
- Event-Driven: The plugin responds to events when a player enters or exits the proximity of an NPC.
- Customizable Text: The text displayed can be customized for each NPC.
- Data Persistence: The plugin ensures that overlay settings for each NPC are saved and can be loaded across server restarts.
Adding Overlays to NPCs
1. Installation
- Ensure the NpcOverlay plugin is installed on your server.
2. Setting Up Overlays:
- Navigate to the data file associated with the plugin, located in oxide/data/NpcOverlay.json.
- The structure of the JSON file is as follows:
-
{ "Overlays": { "MyNpcId": { "LangKey": "MyLangKey", "Color" : { "r":202, "g":49, "b":0, "a":1 }, "LocalOffset" : { "x":0, "y":1, "z":0 } } } }
- Replace MyNpcId with the NPC's ID and MyLangKey with the key you will use in the language file to represent the text you want to display.
3. Configuring Overlay Text
- Navigate to the language file, oxide/data/lang/yourlang/NpcOverlay.json. If it doesn't exist, create it.
- Add a new key-value pair where the key is the MyLangKey you used in the NpcOverlay.json file and the value is the text you want to display.
- Example:
-
{ "MyLangKey": "Hello, I'm Bob the Builder!" }
4. Spawning NPCs
- Use the appropriate command or method to spawn an NPC in your Rust server.
- Note down the NPC's ID.
5. Linking NPC to Overlay
- Add the NPC's ID and desired overlay text key to the NpcOverlay.json file.
- Save the file.
6. Testing
- Approach the NPC in-game. As you get close, you should see the overlay text appear above the NPC.Move away from the NPC, and the overlay should disappear.
Usage Examples
- Quest Givers: Use overlays to identify NPCs that give out quests. E.g., "Quest Giver: Find the lost treasure!"
- Shopkeepers: Identify NPCs that sell items. E.g., "Shopkeeper: Buy rare items here!"
- Lore: Provide background information or lore about specific NPCs to enrich the game's story.
Conclusion
The NpcOverlay plugin is a simple yet powerful tool for server administrators and developers looking to enhance the player's experience in Rust.By providing contextual overlays above NPCs, players can have a clearer understanding of the role and significance of each NPC they encounter.Whether you're looking to guide players on their journey, provide lore, or simply add a touch of personality to your NPCs, NpcOverlay is a valuable addition to your server.
Support :
You can also contact me via discord : https://discord.gg/JJnxFgP27G