ID:137927
 
If you use spawn() on a player, and he logs out before the timer is done, and assuming the character is saved...

Does the spawn() timer pick up again when he logs back in? I'm assuming not, but was just wondering if anyone knew.
On 6/7/01 11:23 am Skysaw wrote:
If you use spawn() on a player, and he logs out before the timer is done, and assuming the character is saved...

Does the spawn() timer pick up again when he logs back in? I'm assuming not, but was just wondering if anyone knew.

No, it wouldn't start back up, assuming that the player's mob wasn't there any more.

If the player logged out but left an empty shell of a mob, the procs would continue.




I've also been thinking about that problem, actually... how to make it so that if someone has an ill effect coarsing through their veins, how to make it still coarsing through their veins with the same intensity when they log back in.

I can handle it with datums, of course. But I was wondering if it could be handled with the simplicity of a couple mob variables.

Dantom: datums can be saved too, right? Is there a default behaviour for saving them? If not, how would I go about doing it?

Oh well, I'll be looking into it!
In response to Spuzzum
The way I do it with LexyMUD is I handle effects (spells, poisons, and others) for each mob with a single associated list. The player's central code cycle checks for items in the list ("poison","regeneration"), decreases the amount of the number associated with the item, and applies any effect (damage from poison.) The list is stored along with the player's other variables, and so spell effects pick up right where they left off before.

In my rewrite of LexyMUD, I'm planning on expanding that system. Instead of a list of text strings associated with numbers, it's just going to be a list of /effect datums... so I can have several "poisons" of differing strengths coursing through the veins of a single player, for instance, or have an effect which has multiple variables (for instance, a poison could be strong but short-lived, or weak and drawn out, as opposed to now, where the only measure of a poison's strength is its duration.)

I believe this method should work, because the datums in the list will be saved when the player is saved and recalled when the player is recalled.

On 6/7/01 12:06 pm Spuzzum wrote:
On 6/7/01 11:23 am Skysaw wrote:
If you use spawn() on a player, and he logs out before the timer is done, and assuming the character is saved...

Does the spawn() timer pick up again when he logs back in? I'm assuming not, but was just wondering if anyone knew.

No, it wouldn't start back up, assuming that the player's mob wasn't there any more.

If the player logged out but left an empty shell of a mob, the procs would continue.



I've also been thinking about that problem, actually... how to make it so that if someone has an ill effect coarsing through their veins, how to make it still coarsing through their veins with the same intensity when they log back in.

I can handle it with datums, of course. But I was wondering if it could be handled with the simplicity of a couple mob variables.

Dantom: datums can be saved too, right? Is there a default behaviour for saving them? If not, how would I go about doing it?

Oh well, I'll be looking into it!
In response to LexyBitch
That's a clever idea! I'd love to see any code you came up with on this.

On 6/7/01 12:24 pm LexyBitch wrote:

In my rewrite of LexyMUD, I'm planning on expanding that system. Instead of a list of text strings associated with numbers, it's just going to be a list of /effect datums... so I can have several "poisons" of differing strengths coursing through the veins of a single player, for instance, or have an effect which has multiple variables (for instance, a poison could be strong but short-lived, or weak and drawn out, as opposed to now, where the only measure of a poison's strength is its duration.)

I believe this method should work, because the datums in the list will be saved when the player is saved and recalled when the player is recalled.
In response to LexyBitch
On 6/7/01 12:24 pm LexyBitch wrote:
In my rewrite of LexyMUD, I'm planning on expanding that system. Instead of a list of text strings associated with numbers, it's just going to be a list of /effect datums... so I can have several "poisons" of differing strengths coursing through the veins of a single player, for instance, or have an effect which has multiple variables (for instance, a poison could be strong but short-lived, or weak and drawn out, as opposed to now, where the only measure of a poison's strength is its duration.)

Lexy's approach is an excellent one.

Along these lines, in most cases time-based items should not be stored in terms of current time. They should always be stored in terms of "how long is left for this". That way if saved to a savefile, the information will still be valid on restoration.