I'm attempting and failing miserably at converting my amulet script:
http://www.uox3.org/forum/viewtopic.php?t=1724
from being targetted to automatically detecting the corpses when they are in range. I can't seem to get anything to work at all. I've messed with Areafunction and Inrange without success.
Anyone have any scripting examples where an equipped item detects an object when passing by it?
Thanks!
AreaFunction or Inrange?
-
Mindless Automaton
- UOX3 Apprentice
- Posts: 189
- Joined: Wed May 10, 2006 3:48 am
- Has thanked: 0
- Been thanked: 1 time
- Contact:
AreaFunction or Inrange?
Mindless Automaton
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
Linux - UOX3 - 0.99.5 dev branch
Win10Pro 19042.572 - UOX3 0.99.3a; Razor 1.0.14; Client 7.0.87.11 or 4.0.11c (Patch 0)
-
Maarc
- Developer
- Posts: 576
- Joined: Sat Mar 27, 2004 6:22 am
- Location: Fleet, UK
- Has thanked: 0
- Been thanked: 0
- Contact:
InRange and AreaFunction are conceptually quite different. One's an event and another a function, to start with 
AreaFunction will enable you to iterate over all top level objects.
What do I mean by top level? For chars/npcs, its all of them. For items, they are only the ones on the ground. If its a sword inside a pack, you're not going to see it (unless you iterate the pack's contents direct).
InRange is an event, which can only be attached to a character, not an item. So if Person A walks into range of object B (where B can be a char or item), it will trigger on person A. Now imagine ... hmm, I want to say box, around a person. InRange only triggers on their visibility range (which defaults off screen).
So inrange won't work if you want it to occur on the amulet, instead of the person.
Hope this helps
AreaFunction will enable you to iterate over all top level objects.
What do I mean by top level? For chars/npcs, its all of them. For items, they are only the ones on the ground. If its a sword inside a pack, you're not going to see it (unless you iterate the pack's contents direct).
InRange is an event, which can only be attached to a character, not an item. So if Person A walks into range of object B (where B can be a char or item), it will trigger on person A. Now imagine ... hmm, I want to say box, around a person. InRange only triggers on their visibility range (which defaults off screen).
So inrange won't work if you want it to occur on the amulet, instead of the person.
Hope this helps