Maybe add a new const to determine if it's a PC or not.
POLCLASS_MOBILE - Returns true if object is a PC/NPC.
POLCLASS_NPC - Returns true if object is a NPC.
POLCLASS_PC - Returns true if object is a PC.
Just a suggestion, lol.
Object.IsA( POLCLASS_* )
Moderator: POL Developer
Why not:
Code: Select all
If ((object.IsA(POLCLASS_MOBILE)) && (!object.IsA(POLCLASS_NPC)))
..
why not script a own function is_pc(), is_npc or is_mobile()?
if there are changes (e.g. npcs get a ip / acct-prop :p . don't know why) you could easy modify that.
No need for a new constant, in my opinion.
Edit:
oops
already exists in uo.em. how unnecessary :lol:
if there are changes (e.g. npcs get a ip / acct-prop :p . don't know why) you could easy modify that.
No need for a new constant, in my opinion.
Edit:
oops
Code: Select all
// POLCLASS_* constants - use with obj.isa(POLCLASS_*)
const POLCLASS_UOBJECT := 1;
const POLCLASS_ITEM := 2;
const POLCLASS_MOBILE := 3;
const POLCLASS_NPC := 4;
const POLCLASS_LOCKABLE := 5;
const POLCLASS_CONTAINER := 6;
const POLCLASS_CORPSE := 7;
const POLCLASS_DOOR := 8;
const POLCLASS_SPELLBOOK := 9;
const POLCLASS_MAP := 10;
const POLCLASS_MULTI := 11;
const POLCLASS_BOAT := 12;
const POLCLASS_HOUSE := 13;
const POLCLASS_EQUIPMENT := 14;
const POLCLASS_ARMOR := 15;
const POLCLASS_WEAPON := 16;
- MontuZ
- Forum Regular
- Posts: 338
- Joined: Fri Feb 10, 2006 8:08 am
- Location: Myrtle Beach, South Carolina
My point exactly. But you never know, there could be a valid reason why it was never added. When a dev gets a chance they'll give us an answer, maybe.tekproxy wrote:There are many properties that a character has that a NPC doesn't have and I think everyone knows them... Why have POLCLASS_NPC when you have object.npctemplate ? Haha.
-
- Grandmaster Poster
- Posts: 104
- Joined: Tue Feb 07, 2006 3:32 pm
- Location: Pittsburgh, Pennsylvania
I think this is one of those requests where, "Yes, there are ways to do it, but why not simplify it by adding this flag?"
Kinda like how you could use pc.ip to test for connection, but we got pc.connected anyway.
These kind of features are really useful to those new to escript (and especially programming in general) and do not know all the work-around methods posted here.
Kinda like how you could use pc.ip to test for connection, but we got pc.connected anyway.
These kind of features are really useful to those new to escript (and especially programming in general) and do not know all the work-around methods posted here.
Think of the class heirarchy.. then look at the POLCLASS_* flags
http://wiki.polserver.com/index.php/POL ... _Reference
http://wiki.polserver.com/index.php/POL ... _Reference