New member: who.minions

Archive of the older Feature Request Forum Posts
Locked
User avatar
Core Essence
Neophyte Poster
Posts: 38
Joined: Tue Feb 07, 2006 10:40 am

New member: who.minions

Post 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
MuadDib
Former Developer
Posts: 1091
Joined: Sun Feb 12, 2006 9:50 pm

Post 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.
User avatar
Core Essence
Neophyte Poster
Posts: 38
Joined: Tue Feb 07, 2006 10:40 am

Post by Core Essence »

Yes I know, but a member it's a little bit "clean" and faster for usage :P
User avatar
Austin
Former Developer
Posts: 621
Joined: Wed Jan 25, 2006 2:30 am

Post by Austin »

you're wrong, cprops are cleaner in this situation and just as fast.
User avatar
Core Essence
Neophyte Poster
Posts: 38
Joined: Tue Feb 07, 2006 10:40 am

Post 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?
Marilla

Post 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.
Lagoon
Grandmaster Poster
Posts: 118
Joined: Sun Mar 05, 2006 7:25 am

Post 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
Locked