Objects should have an equivalent to actor's die() function
Moderator: Moderator
Objects should have an equivalent to actor's die() function
... so that they can be destroyed more easily. Instead of iterating over the whole map, I'm counting down torches' light and corpses' freshness in the item's act function. Now the only thing left is to remove them. Currently doing it from the Object class requires hacky solutions (see Zizzo's tome2 port).
Re: Objects should have an equivalent to actor's die() funct
Hey, Zireael. Yours and Zizzo's modules both require this feature, and those are pretty much the two coolest modules out there. So it seems this is an essential feature for module creators, even if it's not needed by ToME!
I shall do what I can do to try and get this feature cooked into the engine.
(Can you or Zizzo create a nice object die() function yourselves to be uploaded into the engine repository - or at least to share with other module creators? I haven't looked at the code yet so I don't know how feasible this is without fuckery.)
I shall do what I can do to try and get this feature cooked into the engine.
(Can you or Zizzo create a nice object die() function yourselves to be uploaded into the engine repository - or at least to share with other module creators? I haven't looked at the code yet so I don't know how feasible this is without fuckery.)
Re: Objects should have an equivalent to actor's die() funct
I can't and Zizzo's code seems to involve "fuckery".
Also apologies for not noticing sooner - Real Life snuck up on me
Also apologies for not noticing sooner - Real Life snuck up on me

Re: Objects should have an equivalent to actor's die() funct
/me uses a scroll of save from real life on Zireael !
On a more serious note, what exactly would :die do exactly in your mind?
On a more serious note, what exactly would :die do exactly in your mind?
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

-
- Sher'Tul Godslayer
- Posts: 2521
- Joined: Thu Jan 23, 2003 8:13 pm
- Location: A shallow water area south of Bree
- Contact:
Re: Objects should have an equivalent to actor's die() funct
Zireael wrote:I can't and Zizzo's code seems to involve "fuckery".


"Blessed are the yeeks, for they shall inherit Arda..."
Re: Objects should have an equivalent to actor's die() funct
Well, it would remove the objects from the map without moving them anywhere. Sorta like picking up, but without placing the item in the actor's inventory. And most importantly, it would be called by the object itself and not the actor. (Actors picking up and/or destroying items can already be done - what I have in mind is objects being removed on a one-by-one scale - for instance, by a targeted talent or upon cooldown expiring).darkgod wrote:On a more serious note, what exactly would :die do exactly in your mind?
...
I've just imagined ToME 4 wands or inscriptions (epic/legendary) exploding/disintegrating after a random number of uses

Re: Objects should have an equivalent to actor's die() funct
Ah I see, but then it wouldnt be logical to have it only work for map; :die on an item worn by an actor would need to remove it too.
But objects dont know where they are; for map they could store the map coords, but for actors it would create nasty circular references.
Not a very easy thing really :/
But objects dont know where they are; for map they could store the map coords, but for actors it would create nasty circular references.
Not a very easy thing really :/
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: Objects should have an equivalent to actor's die() funct
Putting it somewhere in map works, too. As I said, we can already add/remove objects worn by actors without fuss. It's the unworn objects that are difficult to remove 

Re: Objects should have an equivalent to actor's die() funct
Removing from an actor is not a method of he object it's a method of the actor though.
Removing from the map is the same:
map:removeObject(x, y, map:findObject(x, y, o))
only works in 1.4 though, in 1.3 you need to iterate over the items in that spot to emualte findObject
Removing from the map is the same:
map:removeObject(x, y, map:findObject(x, y, o))
only works in 1.4 though, in 1.3 you need to iterate over the items in that spot to emualte findObject

[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
