Page 1 of 1

New member: who.minions

Posted: Fri Nov 17, 2006 2:13 pm
by Core Essence
A member wich returns a list of all the creatures tamed by characters [creature.setmaster(who)];

It would be usefull when characters lose their creatures and we need to give them a reference for release them or whatever

Posted: Fri Nov 17, 2006 3:38 pm
by MuadDib
That's what OSI has the "ball of pet summoning" that is special loot you can find and charge for. Nice idea without having server support directly (script based).

Aside from that you can also use cprops of them in the taming system and tamed ai's to handle that effectively enough.

Posted: Fri Nov 17, 2006 4:01 pm
by Core Essence
Yes I know, but a member it's a little bit "clean" and faster for usage :P

Posted: Fri Nov 17, 2006 4:13 pm
by Austin
you're wrong, cprops are cleaner in this situation and just as fast.

Posted: Fri Nov 17, 2006 4:55 pm
by Core Essence
Mmmh.. Why?
A cprop should be cleaned when a mob die and references should be loaded through SystemFindObjectBySerial() in a member it's all done server side

Or I'm wrong?

Posted: Sat Nov 18, 2006 10:18 am
by Marilla
Why is it 'cleaner'? A dozen reasons:

First, is this: Who is to say that anyone really wants -all- NPCs that have had npc.SetMaster(who); called to show up on who.minions? I know I use .SetMaster() on NPCs that I would never want to show up in my lists of pets or other such NPCs. I also have NPCs that have NOT had .SetMaster() called show up on some such lists. A scripted system lets me control exactly how and what shows up on what lists - and lets me easily create separate lists with separate criteria for inclusion, in fact.. making the scripted system much 'cleaner'.

Oh.. and the other thing that makes the scripted system 'clean' is that I have a single include file that handles all of the registering, unregistering and listing of NPCs, for all the various groups.

Code: Select all

function RegisterNPC(npc, master, type)
    var npcs := GetObjProperty(master, "#npcs_"+type);
    ...etc... add/verify the NPC on the list...
endfunction

function UnRegisterNPC(npc, master, type)
    var npcs := GetObjProperty(master, "#npcs_"+type);
    ...etc... Remove the NPC from the list...
endfunction

function ListRegisteredNPCs(master, type)
    var npcs := GetObjProperty(master, "#npcs_"+type);
    ...etc... verify each NPC still exists, then list it...
endfunction

This, incidentally, was one reason I had recently requested method scripts for mobiles, including PCs; So that a custom implementation of adding, removing and listing NPCs could be tied directly to the PC instance, rather than in an include file. But in the meantime, the include works fine, too.

Posted: Sun Nov 19, 2006 4:12 am
by Lagoon
I agree with marilla, no need for such a hardcoded method, cprops and scripts con do it quite well and hopefully scripted mobiles methods will do it even better