Feture Added to Item object - Elevate "area" events to UObject.
Posted: Wed Apr 25, 2018 12:11 am
Elevate SYSEVENT_ENTEREDAREA and SYSEVENT_LEFTAREA to UObject or if not that add them laterally to item objects.
For years I have wondered why this is restricted to only NPCs. I cannot see any disadvantage to giving these events to all UObjects or at the very least adding them to the item object. I have spoken to Nando about this and he thinks maybe it was to avoid server load. That may be true but, if I understand how these things work, any additional load would only be for objects that have enabled events. We can already enable items for speech events. That seems to me to be more of a potential for server load than "area" events.
Reason for this request: Currently there are two ways to determine if a character has entered an area near an item.
One is to have a control script that from time to time scans a ranged area around the item for mobiles. This method can add considerable overhead depending on the size of the area to be scanned, how long the control script sleeps between scans, and the number of items that need to scan areas for mobiles.
The other way is to use an NPC to detect entered area. This requires the following steps in your CreateScript for the item:
1. Create an NPC on top of the item.
2. Make it invisible (concealed)
3. Freeze or paralyze the NPC.
4. Enable events for that NPC.
5. When a mobile enters the area the NPC "notifies" the item that a mobile has entered the area in question.
This method is a kluge at best. It also requires at least one custom NPC just for "item entered event" handling. It also adds to the mobile count one (1) NPC for each item you want to be able to detect "area" events.
As you know I do not speak C++ but this does not sound like something too difficult to do.
Just imagine something as simple as an item you want to remain hidden until a player with the correct CProp enters a certain range where the item reveals itself. Now imagine you have say, 50 of that item placed around the world. If items had the "area" events it would simplify the task of scripting those items and reduce script overhead.
For years I have wondered why this is restricted to only NPCs. I cannot see any disadvantage to giving these events to all UObjects or at the very least adding them to the item object. I have spoken to Nando about this and he thinks maybe it was to avoid server load. That may be true but, if I understand how these things work, any additional load would only be for objects that have enabled events. We can already enable items for speech events. That seems to me to be more of a potential for server load than "area" events.
Reason for this request: Currently there are two ways to determine if a character has entered an area near an item.
One is to have a control script that from time to time scans a ranged area around the item for mobiles. This method can add considerable overhead depending on the size of the area to be scanned, how long the control script sleeps between scans, and the number of items that need to scan areas for mobiles.
The other way is to use an NPC to detect entered area. This requires the following steps in your CreateScript for the item:
1. Create an NPC on top of the item.
2. Make it invisible (concealed)
3. Freeze or paralyze the NPC.
4. Enable events for that NPC.
5. When a mobile enters the area the NPC "notifies" the item that a mobile has entered the area in question.
This method is a kluge at best. It also requires at least one custom NPC just for "item entered event" handling. It also adds to the mobile count one (1) NPC for each item you want to be able to detect "area" events.
As you know I do not speak C++ but this does not sound like something too difficult to do.
Just imagine something as simple as an item you want to remain hidden until a player with the correct CProp enters a certain range where the item reveals itself. Now imagine you have say, 50 of that item placed around the world. If items had the "area" events it would simplify the task of scripting those items and reduce script overhead.