Re: uniqueness of objects

From: Erik (madison@nevada.edu)
Date: 10/12/95


On Thu, 12 Oct 1995, Wolfram Schroeder wrote:

> If Value 3 is unused, you can set it in your special procedure. These
> values are kept in the rentfiles for the real object, not in the
> prototype.
> 
> What you do is to save the time of the last use in some format in this
> value and use this (e.g. tick in the day of the last use/nr of day) value.
> 
> Good Luck,
> Wolfram
> 
> Karl@Realm of Magic          p106.informatik.uni-bremen.de 4000
> 
> 
  Well, I actually have the item working in that sense. Basically, via a 
coupla static ints, I've saved the last time it was used, check vs. time 
now, and if enough time has passed, set powered_up = TRUE. My problem is, 
that every copy of this sword in the game follows the leader. 
  Say every sword in game is powered_up = FALSE. One guy powers his up, 
they all power up.
  Okay, so I decided to check ownership. I did an along the lines of...
obj->value[0] = atoi(&ch->player.name), and placed it to be executed only 
upon cmd equaling CMD_WIELD. My logic was, that you first "claim" 
ownership of this item, and thereafter, any thing that is done, first 
checks whose weapon we are talking about.
  And that led to the problem. When I change obj->value[0] (not 3, my 
mistake), it changes it on every copy! So, obviously, the proc is not 
treating the item as unique, but altering the prototype of such. I 
suppose, if I delve into a few of the spells that alter items, I'll see 
why I'm not altering a single version of the item, but most likely that 
will simply lead to another headache. And then again, procs are treated a 
bit differently than other functions....



This archive was generated by hypermail 2b30 : 12/07/00 PST