Thanks for being so brave PK17 ! Reading this three or four times, you must be an expert now !PK17 wrote: Also Zuk, as I was reading through this for the third or fourth time, I notice you said you couldn't think of any reasons to use the map.onENTER trigger for anything besides the map.
I always thought it would be cool if say you entered feygard territory and all (or some) feygard items recieved a boost, same for the blackwater items if you are in/near blackwater, and all (some) other faction related locations. Also, let's say in map 'elytharashrine5' there is a shrine that when upon entering the map it automaticly removes any kazual or shadow items equiped then forbids you from equipping them.
Actually, in your examples, I think it should still be the map that have the map.onEnter script. If it is an effect specific to 'elytharashrine5', it should not be part of the items definition. To be more clear, here's how I would do it (some functions do not exist yet) :
map 'elytharashrine5' has property 'scripts' with value 'remove_kaz_shad_items;prevent_kaz_shad_equip'
then, in a scripts definition file :
Code: Select all
"remove_kaz_shad_items" map.onEnter [
player.unequip("kazaul_item_1");
player.unequip("kazaul_item_2");
player.unequip("shadow_item_1");
player.unequip("shadow_item_2");
][Unequips all items imbued with the spirit of Kazaul or the Shadow]
"prevent_kaz_shad_equip" item.onEquip [
if (item.id == "kazaul_item_1") {
cancelAction();
} else if (item.id == "kazau_item_2") {
cancelAction();
}<...>
][Prevents equiping all items imbued with the spirit of Kazaul or the Shadow]
Or, you could also use a player.statsUpdated script that will nullify the effects of the equiped items.
Many possibilities with slightly different effects, but still no need to attach a map.onEnter script to anything else than a map.
One potential effect of attaching a map.onEnter script to a weapon for example, is that when this weapon is equipped, you gain 1HP each time you enter a new map... doesn't make sense to me, as the only game object who can have a notion of whether the map limits are indeed limits in the game world are the maps themselves ! Then again, it would still work, so if someone, someday, comes up with a good idea using this, it would work !