The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Perishable food system
Author Message
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #1
Perishable food system
I have thinking a few different system to make the food perishable, but I don´t know if they are efficient or not.

a) Through f_onserver_timer
Launching a globar foritems searching fot type t_food, and aplying the food decay.
Very expensive in resources. Sad

b) Through container timer, and player timer. My players have already a permanent timer runing over them, so no problem to aplying the food decay over them every time the Timer fires.
Also, all containers would need to have a @TIMER event, which search food type, FORCONTTYPE, and aplying the food decay. Relatively fast.

I´d like the second option. Do you see any problems before script it? Or do you see a better option.

Thanks in advance. Smile
09-18-2012 06:38 AM
Find all posts by this user Like Post Quote this message in a reply
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #2
RE: Perishable food system
why you won't use timer on food items?
09-18-2012 06:43 AM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #3
RE: Perishable food system
Because timers of items inside a container doesn´t work, at least a long time ago didn´t worked. Tongue

PD: Confirmed, Timers inside a containers never fires.

Another options:

c) Use FORITEMS 9999 just after [FUNCTION f_onserver_save_ok].
If there is a pause for saving the server, there is no problem if there is a bit more delay for a slow script.

d) Other option is using FORINSTANCES i_metal_chest, FORINSTANCES every_container, FORINSTANCES etc..., just before a save. A bit more faster but more complex because you have to define every BASEID of container in your server.
(This post was last modified: 09-18-2012 07:55 AM by Gil Amarth.)
09-18-2012 07:24 AM
Find all posts by this user Like Post Quote this message in a reply
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #4
RE: Perishable food system
you can use something like this

Code:
ON=@CREATE
TAG.FRESH=<EVAL <SERV.TIME>+(10*60*60*3)> //3hour

AND check when player use it or picked up

Code:
IF <TAG0.FRESH> < <SERV.TIME>
SRC.SMSG It smells like shit.
REMOVE
ENDIF
(This post was last modified: 09-18-2012 08:10 AM by WRWR.)
09-18-2012 08:09 AM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #5
RE: Perishable food system
Yes, but then you can think you have a lot of food and really it´s all crap.

Or someone sells you a piece of food, and really is rotten. xD
But it´s a easy system, maybe with tooltips to describe the item, it would work.
09-18-2012 07:47 PM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #6
RE: Perishable food system
nice, lol

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
09-19-2012 06:28 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 3 Guest(s)