SphereCommunity
Spawn in small crate possible? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Spawn in small crate possible? (/Thread-Spawn-in-small-crate-possible)



Spawn in small crate possible? - Berkley - 10-18-2015 12:14 AM

Hello,

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

Best regards, Lars


RE: Spawn in small crate possible? - pointhz - 10-18-2015 12:32 AM

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.


RE: Spawn in small crate possible? - Berkley - 10-18-2015 08:08 PM

Perfect! that's exactly the solution i was looking for. Many thanks pointhz. :-)


RE: Spawn in small crate possible? - Diathim - 10-21-2015 04:24 PM

Why not just spawn a template....

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



RE: Spawn in small crate possible? - Berkley - 10-24-2015 09:38 PM

(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 :-)