Author Topic: Longer Item Lifespan  (Read 1336 times)

Is there a way, whenever I drop an item, for it not to disappear after 5 seconds? Perhaps it could stay there until it is picked up?

$item::poptime = milliseconds;

Pretty sure that 30000 (30 seconds) is the maximum.

Can that function be overwritten?

Sure. You'll have to overwrite servercmddropitem, and fxdtsbrick::spawnitem so that they create an item with the correct .minigame .bl_id and .spawnbrick parameters.

Example implementation
Code: [Select]
%item = new Item()
{
datablock = %itemData;
position = %pos;
};

%itemVec = %vec;
%itemVec = vectorAdd(%itemVec,getRandom(-8,8) SPC getRandom(-8,8) SPC 10);
%item.BL_ID = %client.bl_id;
%item.minigame = %client.minigame;
%item.spawnBrick = -1;
%item.setVelocity(%itemVec);
missionCleanupGroup.add(%item);
And that's it. The item won't despawn unless schedulePop(); is called on it.

Just package schedulePop instead without calling the parent.

Could you please make that with a custom pref like $OverwritePopTime and make it called by slash command, because that script could be so goddamn useful with players dropping items on death.

Just package schedulePop instead without calling the parent.

but surely the parents will be very angry if they don't call?

but surely the parents will be very angry if they don't call?
lol

Could you please make that with a custom pref like $OverwritePopTime and make it called by slash command, because that script could be so goddamn useful with players dropping items on death.
Yeah, I'll use Port's suggestion since that's better than mine. I'll release this on my add-on topic later today.

Prerelease: http://pecon.us/projects/storage/extendedPopTime/beta/Server_ExtendedPopTime.zip

Probably doesn't work yet, haven't been able to test. Grab Greek2Me's Support_Updater from modification discussion and it'll auto-update as I fix everything and add things like resetting dropped items on minigame reset, ect.
« Last Edit: April 07, 2014, 12:40:12 PM by Pecon »


$Game::Item::PopTime = 10000;

That's it.
30000 (30 seconds) is the maximum.
He wants to make it even longer, or disable the despawning completely.

I swear, you must have not even read the second post.

I swear, you must have not even read the second post.
I swear, you must have not even tested it.

The variable is read, and put into the schedules. There is no maximum.

I have tested it before, it wouldn't go higher than 30 seconds. Plus, this accomplishes the purpose of saving the variable as a preference and allows the disabling of the item pop altogether. And the planned feature of removing items on minigame resets.

I don't get what it is with you and shooting down every idea out there. Is that just some part of your nature?

I don't see why you would write a script when you can just set a variable?
Plus, this accomplishes the purpose of saving the variable as a preference and allows the disabling of the item pop altogether. And the planned feature of removing items on minigame resets.
That's new.

I use this all the time, set to 5 minutes (although I have no idea why). There is no limit.