mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
Implemented Remote shop spawning.
This commit is contained in:
parent
96595a4c68
commit
9ad1ac0219
3 changed files with 13 additions and 2 deletions
|
@ -44,7 +44,8 @@ local function run_spawn_fn(fn_name, x, y, ...)
|
|||
local eid = ret
|
||||
ctx.cap.item_sync.globalize(eid, true, ctx.rpc_peer_id)
|
||||
local x, y = EntityGetTransform(eid)
|
||||
EntityLoad("mods/quant.ew/files/system/gen_sync/tmp_shop_area.xml", x, y)
|
||||
local minishop = EntityLoad("mods/quant.ew/files/system/gen_sync/tmp_shop_area.xml", x, y)
|
||||
EntityAddChild(eid, minishop)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
tags="shop" >
|
||||
|
||||
<HitboxComponent
|
||||
_tags="enabled_in_world"
|
||||
aabb_min_x="-5"
|
||||
aabb_min_y="-5"
|
||||
aabb_max_x="5"
|
||||
|
@ -11,5 +12,9 @@
|
|||
is_item="0"
|
||||
is_player="0"
|
||||
offset.x="0"
|
||||
offset.y="0" />
|
||||
offset.y="0"
|
||||
/>
|
||||
|
||||
<InheritTransformComponent _tags="enabled_in_world"/>
|
||||
<LuaComponent _tags="enabled_in_world" execute_every_n_frame="300" script_source_file="mods/quant.ew/files/system/gen_sync/tmp_shop_script.lua"/>
|
||||
</Entity>
|
5
quant.ew/files/system/gen_sync/tmp_shop_script.lua
Normal file
5
quant.ew/files/system/gen_sync/tmp_shop_script.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
local ent = GetUpdatedEntityID()
|
||||
local x, y = EntityGetTransform(ent)
|
||||
if DoesWorldExistAt(x-5, y-5, x+5, y+5) then
|
||||
EntityKill(ent)
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue