JaccK1618 Posted September 13, 2024 Share Posted September 13, 2024 Is there any sort of line of code where someone on the surface could cause an earthquake for players in the caves at the same time? Link to comment https://forums.kleientertainment.com/forums/topic/159676-cause-earthquake-from-surface/ Share on other sites More sharing options...
yanecc Posted September 13, 2024 Share Posted September 13, 2024 -- In the prefab function StartQuake(inst) for _, player in ipairs(AllPlayers) do player:PushEvent("manmadequake", { causer = inst }) end end -- modmain AddPlayerPostInit(function(inst) inst:ListenForEvent("manmadequake", function(inst, data) if GLOBAL.TheWorld:HasTag("cave") then GLOBAL.TheWorld:PushEvent("ms_miniquake", { rad = 10, num = 15, duration = 5, target = inst }) end end) end) The code has not been tested, good luck! Link to comment https://forums.kleientertainment.com/forums/topic/159676-cause-earthquake-from-surface/#findComment-1747673 Share on other sites More sharing options...
LeafyFly Posted September 14, 2024 Share Posted September 14, 2024 Use shard RPC. -- define the RPC AddShardModRPCHandler(YOUR_MOD_NAME, "cause_earthquake", function() GLOBAL.TheWorld:PushEvent("ms_forcequake") end) -- call the RPC SendModRPCToShard(GetShardModRPC(YOUR_MOD_NAME, "cause_earthquake")) Link to comment https://forums.kleientertainment.com/forums/topic/159676-cause-earthquake-from-surface/#findComment-1748060 Share on other sites More sharing options...
JaccK1618 Posted September 14, 2024 Author Share Posted September 14, 2024 1 hour ago, LeafyFly said: Use shard RPC. -- define the RPC AddShardModRPCHandler(YOUR_MOD_NAME, "cause_earthquake", function() GLOBAL.TheWorld:PushEvent("ms_forcequake") end) -- call the RPC SendModRPCToShard(GetShardModRPC(YOUR_MOD_NAME, "cause_earthquake")) Where do I put these? Link to comment https://forums.kleientertainment.com/forums/topic/159676-cause-earthquake-from-surface/#findComment-1748084 Share on other sites More sharing options...
Baguettes Posted September 14, 2024 Share Posted September 14, 2024 6 hours ago, JaccK1618 said: Where do I put these? The first one possibly in modmain, the second one where you want the quake trigger to be called from (e.g. put in a function that triggers the RPC on item use) Not sure if that'll work, I have to learn more of the RPCs myself. 1 Link to comment https://forums.kleientertainment.com/forums/topic/159676-cause-earthquake-from-surface/#findComment-1748208 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now