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
Berkley
Journeyman
*

Posts: 54
Likes Given: 28
Likes Received: 2 in 2 posts
Joined: Jul 2015
Reputation: 0



Post: #1
Spawn in small crate possible?
Hello,

is there any known way to let a worldgem bit creating items inside a container or small crate?

Best regards, Lars
10-18-2015 12:14 AM
Find all posts by this user Like Post Quote this message in a reply
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
Berkley
Journeyman
*

Posts: 54
Likes Given: 28
Likes Received: 2 in 2 posts
Joined: Jul 2015
Reputation: 0



Post: #3
RE: Spawn in small crate possible?
Perfect! that's exactly the solution i was looking for. Many thanks pointhz. :-)
10-18-2015 08:08 PM
Find all posts by this user Like Post Quote this message in a reply
Diathim
Apprentice
*

Posts: 10
Likes Given: 13
Likes Received: 1 in 1 posts
Joined: Oct 2015
Reputation: -3



Post: #4
RE: Spawn in small crate possible?
Why not just spawn a template....

Code:
[template crate_of_meager_goods]
container=i_small_crate
item=i_gold,{1 100}
item=random_clothing
10-21-2015 04:24 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Diathim's post
Berkley
Journeyman
*

Posts: 54
Likes Given: 28
Likes Received: 2 in 2 posts
Joined: Jul 2015
Reputation: 0



Post: #5
RE: Spawn in small crate possible?
(10-21-2015 04:24 PM)Diathim Wrote:  Why not just spawn a template....

Code:
[template crate_of_meager_goods]
container=i_small_crate
item=i_gold,{1 100}
item=random_clothing


a good idea, too.

Thank you very much :-)
10-24-2015 09:38 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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