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
Spawn in small crate possible?
Author Message
pointhz
Journeyman
*

Posts: 148
Likes Given: 1
Likes Received: 55 in 28 posts
Joined: Oct 2013
Reputation: 1



Post: #2
RE: Spawn in small crate possible?
Force the worldgem bit to spawn a custom crate instead of an item.

The custom crate can be something like:

[ITEMDEF i_crate_custom_spawn]
ID=i_crate_small

ON=@CREATE
NEWITEM=I_BAG, 1, <UID> // List of items you want inside it. NEWITEM="ITEM ID", "ITEM AMOUNT", "CONTAINER"

You can test it by using this: (It will create a spawn at your feet)

[FUNCTION f_crate_custom]
SERV.NEWITEM i_worldgem_bit
NEW.P=<SRC.P>
NEW.AMOUNT=1
NEW.TYPE=t_spawn_item
NEW.MORE1=i_crate_custom_spawn
NEW.MOREP=5,10,0 // "Min spawn time in minutes","Max spawn time in minutes","Spawn distance in tiles"
NEW.DCLICK


I probably misunderstood what you asked for xD

If you want items to be spawned/restocked on a certain container every X time, instead of spawning a whole new container, then you won't be using worldgem bits but timerf function instead perhaps:

[ITEMDEF i_crate_custom_spawn]
ID=i_crate_small

ON=@CREATE
TIMERF 1, f_crate_custom_spawn

[FUNCTION f_crate_custom_spawn]
IF (<COUNT> > 0)
FORCONT <UID> 0
REMOVE
ENDFOR
ENDIF
NEWITEM=I_BAG, 1, <UID> // List of items you want inside it. NEWITEM="ITEM ID", "ITEM AMOUNT", "CONTAINER"
NEWITEM=I_BACKPACK, 1, <UID> // List of items you want inside it. NEWITEM="ITEM ID", "ITEM AMOUNT", "CONTAINER"
NEWITEM=I_SPELLBOOK, 1, <UID> // List of items you want inside it. NEWITEM="ITEM ID", "ITEM AMOUNT", "CONTAINER"
TIMERF 10, f_crate_custom_spawn // Time you want it to restock in seconds. At the moment is 10 seconds just for test.
(This post was last modified: 10-18-2015 12:58 AM by pointhz.)
10-18-2015 12:32 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes pointhz's post
Post Reply 


Messages In This Thread
Spawn in small crate possible? - Berkley - 10-18-2015, 12:14 AM
RE: Spawn in small crate possible? - pointhz - 10-18-2015 12:32 AM

Forum Jump:


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