Language: 
To browser these website, it's necessary to store cookies on your computer.
The cookies contain no personal information, they are required for program control.
  the storage of cookies while browsing this website, on Login and Register.

Author Topic:  Egoitems  (Read 1992 times)

0 Members and 1 Guest are viewing this topic.

smacky

« on: 17, May 2020, 16:01:52 »
Currently egoitems are marked as such by having Ego's prefixed to the object name. All well and good but that system falls down a bit when logic says to prefix with NPC's as a possessive, nothing to do with ego.

Currently this does happen a bit, but not enough to have become an issue AFAIK.

Examples are Fanrir's sandals/lunch/ring, Cashin's old helm, Lor't'h'thoth's tooth, Rhun's cloak, no doubt others.

I am extending the artifacts list so there'll be lots of NPC's item random drops. Soon enough (seasoned) players will be able ti semi-identify a eg, Inchlong's weapon as likely to break on impact, or Trantor's potion of X as very high quality stuff, or exceptional if X=ice* but substandard if X=fire*, or whatever. Noobs get the thrill of finding more varied stuff.

But it becomes more important to clarify between NPC's and Ego's. The wAY TO do this I think is print Ego's in bold (currently yellow) (I've been -- still inconsistently -- doing this for player names in othter contexts for yeARS so it should feel natural). So: Smacky's cloak vs Rhun's cloak. Or even, Smacky's Rhun's cloak, when appropriate.

Longer term (ie, Unity) I'd prefer to have ego status and other item details in tooltips and just indicate the item is ego by printing the whole name in bold. But this is a start. Problems

Shroud

« Reply #1 on: 17, May 2020, 17:02:18 »
I'll note that Fanrir's ring is already an egobound item so Smacky's Fanrir's Ring already can exist. I generally don't use ego items when I can avoid it as you can't unEgo an item so it's locked to a character forever.

One thing I'll note is that currently when we try to give item stats in /shout with /channel g$ we end up in a situation where half the item stats are cut off for special drops as it exceeds the character limit.

I'm assuming main idea of this post is to get a standard nomenclature for items so they'll all be in the format of:
 [Ego][Item Variant/NPC modifier][Item Name][+modifier][Enchantment]

e.g. [Smacky's] [Eagle's] [Beak] [+1] [of medium damage]
Doesn't matter, you'd die anyway. ;D Shroud's a hacker. After many hours of deep thought I have came to that conclusion.

_people_

« Reply #2 on: 17, May 2020, 22:00:29 »
Longer term (ie, Unity) I'd prefer to have ego status and other item details in tooltips and just indicate the item is ego by printing the whole name in bold. But this is a start. Problems

Glad you've mentioned this, as just yesterday I implemented tooltips for item examines. ATM it's a bit wonky as very few stats are sent to the client using ITEMX/ITEMY cmd's., so it sends an EXAMINE command and, after the obvious c->s->c delay, shows the stats.

I'd like to eventually modify ITEMX/ITEMY/UPITEM commands to include ALL stats that are accessible to the player and are updated in the client when you, for example, buff an item.

This solves a few problems, namely inconsistent stat displays, cut-off stat displays, and ugly/hard to read displays. The layout will be a bit tricky as we have LOTS of stats (namely resists/attacks) but if worst comes to worst I can add tabs to the tooltip to categorize stats.
-- _people_ :)

smacky

« Reply #3 on: 18, May 2020, 10:59:17 »
@_people_: Absolutely. Nothing much to add. Possibly we'll need to refactor some types use of s[ecific attributes/ Can't think of an actual example right now but... errm... food is usually used as a tick-based timer so if some type used it to store damage info or such, this might need changing.

@Shroud: No particular point other than the time it takds me to type a post means I really focus on the ins and outs of the idea and can dev it as I write. And other people have smart ideas which I can steal so Dai dev doesn't just become The Smacky Show... although...

smacky

« Reply #4 on: 23, May 2020, 17:24:57 »
Just finalising the trunk commit. Here's the overview:

Code: [Select]
/* An egoitem is any object which is not an entity which is, actually or
 * potentially, bound to the 'ego' of a player, guild, or clan.
 *
 * This is represented by two attributes.
 *
 * ->egomode is the mode of the egoitem where:
 *
 * -1 (EGOITEM_MODE_UNBOUND) (or lower) means the object may be bound but
 * isn't (yet).
 *
 * 1 (EGOITEM_MODE_PLAYER), 2 (EGOITEM_MODE_GUILD), and 3 (EGOITEM_MODE_CLAN)
 * mean the object is bound to a particular ego.
 *
 * 0 means the object is not and can not be bound to an ego, ie, is not an
 * egoitem (but see scripts below).
 *
 * ->egoname is the ego (name, obviously) to which the egoitem is bound.
 *
 * A player cannot pick up, apply, or otherwise use an egoitem bound to an ego
 * which he does not share. However, he can drop or unapply such an egoitem
 * already in his inv -- so no guild ego manacles when you leave the guild.
 *
 * Monsters are similarly restricted but can not directly be the subject ego.
 * However, they can have their own ->egoname which allows access to matching
 * egoitems -- or all if "*".
 *
 * Players can bind an unbound egoitem to themselves only, and once only, with
 * the /egobind command. They can not unbind.
 *
 * Maps and arches and code can obviously fiddle about with the attributes as
 * they please.
 *
 * Scripts can use the object:MakeEgo() method. */

/*****************************************************************************/
/* Name   : GameObject_MakeEgo                                               */
/* Lua    : object:MakeEgo(mode[, name[, lock]])                             */
/* Info   : Sets an object's ->egomode, ->egoname, and egolock flag according*/
/*          to the arguments (or as appropriate where daft values are used). */
/* Args   : mode should be one of the game.EGOITEM_MODE_* constants or 0.    */
/*          name should be an appropriate string when mode > 0 or nil (or    */
/*          unspecified) otherwise.                                          */
/*          lock should be boolean (or unspecified).                         */
/* Return : Boolean.                                                         */
/* Error  : object must not be a player.                                     */
/* Note   : This method allows scripts to unbind/rebind previously bound     */
/*          egoitems or make a previously unbindable object bindable/bound.  */
/*          This may have non-obvious consequences, so use with caution.     */
/*          However, if the object has the egolock flag set, it cannot be    */
/*          (un/re)bound unless ->egomode is already < 0.                    */
/*          Also, although this method can set an object's egolock flag (even*/
/*          when mode = 0, meaning the object can never be bound, even by a  */
/*          subsequent call to this method), there is then no way for the    */
/*          flag to be cleared.                                              */
/*****************************************************************************/
« Last Edit: 23, May 2020, 17:32:06 by smacky »

_people_

« Reply #5 on: 27, August 2020, 04:48:59 »
Code: [Select]
==21861== Invalid read of size 1
==21861==    at 0x5519D70: __strcmp_sse2_unaligned (strcmp-sse2-unaligned.S:22)
==21861==    by 0x9A59827: GameObject_MakeEgo (daimonin_object.c:4316)
==21861==    by 0x9A63D64: luaD_precall (ldo.c:259)
==21861==    by 0x9A7083C: luaV_execute (lvm.c:624)
==21861==    by 0x9A64100: resume (ldo.c:343)
==21861==    by 0x9A631A9: luaD_rawrunprotected (ldo.c:87)
==21861==    by 0x9A64283: lua_resume (ldo.c:370)
==21861==    by 0x9A60E51: lua_coroutine (lapi.c:662)
==21861==    by 0x9A4CEC1: RunLuaScript (plugin_lua.c:662)
==21861==    by 0x9A4D6F6: HandleEvent (plugin_lua.c:769)
==21861==    by 0x9A4CBD3: triggerEvent (plugin_lua.c:509)
==21861==    by 0x4B2A8F: trigger_object_plugin_event (plugins.c:307)
==21861==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==21861==

SIGSEGV received.

I changed Fanrir's script from "ring.egomode = 1" to "ring:MakeEgo(game.EGOITEM_MODE_UNBOUND)"
-- _people_ :)

smacky

« Reply #6 on: 27, August 2020, 12:03:59 »
8640 fixes A bug in trunk. Not sure it is THE bug.

EDIT: SSure it's '= 1'? My daiserv is '  ring.egomode = game.EGOITEM_MODE_UNBOUND ' (which means '= -1').
« Last Edit: 27, August 2020, 12:57:51 by smacky »

_people_

« Reply #7 on: 27, August 2020, 14:23:37 »
that's probably what I meant, not sure how I mixed that up
-- _people_ :)

Tags: