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-nmm6 (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-nmm6 (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-nmm6 (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
Trash
Author Message
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #1
Trash
A problem in the script - When I play the item in the trash as it does not add the script.

Can someone help me?

[ITEMDEF i_trash_can2]
ID = i_barrel_open
DefName = i_trash_can2
NAME = Trash
TYPE = T_CONTAINER
WEIGHT = 10
CATEGORY = Provisions - Miscellaneous
Subsection = Containers
DESCRIPTION = Trash Can
SKILLMAKE SKILL_TINKERING = 55.0, t_tinker_tools
RESOURCES = 10 i_log

ON = @ CREATE
COLOR = 600
ATTR = attr_static


On = @ ItemDropOn_Ground
src.sysmessage This item will decay in 20 seconds.
act.timerf 20 f_item_decay

On = @ ItemPickUp_Ground
act.timerf clear



[EOF]
01-26-2014 04:40 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Trash
A item can ONLY have actions related to it, if you want the items droped by players on the ground to be removed on 20 seconds, you'll have to add your code to any event for players, however act.timerf clear won't wont be a good idea since you can stop any other timerf on this item, use act.timerf STOP,f_item_decay
01-26-2014 05:16 AM
Find all posts by this user Like Post Quote this message in a reply
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #3
RE: Trash
doing so ??



On = @ ItemDropOn_Ground
src.sysmessage This item will decay in 20 seconds.
act.timerf STOP f_item_decay

On = @ ItemPickUp_Ground
act.timerf clear



[EOF]
01-26-2014 11:21 AM
Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Trash
This must be part of an event placed on players: http://wiki.sphere.torfo.org/index.php/EVENTS
01-26-2014 06:59 PM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: Trash
Placing that event on a player would be a HORRIBLE idea. Anything dropped in your house would also decay.

Instead of @ItemDropOn_Ground, which is a character trigger not an item trigger, use @DropOn_Self on the trash can item.
That way items dropped in the trash will decay rather than items just dropped anywhere.

To cancel the timer use @PickUp_Self

-1 Xun as a dev you should know better.

[Image: 2nis46r.jpg]
01-27-2014 01:02 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Mordaunt's post
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #6
RE: Trash
I told him what he asked about, nothing more, you should know about that!!! ^^ -1 Mordaunt for fast -1 without decent arguments!
01-27-2014 01:08 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: Trash
He asked why putting an item in the trash wasn't doing what he wanted.
The answer is because he is using the wrong triggers...

Go sit in the corner and think about your life

[Image: 2nis46r.jpg]
01-27-2014 01:14 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
victorstelzer
Journeyman
*

Posts: 80
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jun 2012
Reputation: 0



Post: #8
RE: Trash
[ITEMDEF i_trash_can2]
ID=i_barrel_open
DEFNAME=i_trash_can2
NAME=Lixeira
TYPE=T_CONTAINER
WEIGHT=10
CATEGORY=Provisions - Miscellaneous
SUBSECTION=Containers
DESCRIPTION=Trash Can
SKILLMAKE=SKILL_TINKERING 55.0,t_tinker_tools
RESOURCES=10 i_log

ON=@CREATE
COLOR=600
ATTR=attr_static

On= @DropOn_Self
src.sysmessage O item sumira em 20 seconds.
act.timerf 20 f_item_decay

------------------------------------------------------------
The timer does not work
-------------------------------------------------------------
error in the sphere

18:41:ERROR:(trashcan.scp,19)Undefined keyword 'act.timerf
01-27-2014 06:43 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #9
RE: Trash
Because the item is argo not act, which is why i linked the respective wiki pages....

[Image: 2nis46r.jpg]
01-27-2014 08:25 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #10
RE: Trash
On=@DropOn_Self
src.sysmessage O item sumira em 20 seconds.
argo.timerf 20,f_item_decay

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
01-27-2014 09:48 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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