Jump to content

Recommended Posts

Hey guys I was wondering if there was a way to spawn a meteor? like just one meteor. And if possible could i add this effect to an item similar to how the bell summons the big foot? Please and thank you.

local function fn()
    local inst = CreateEntity()

    inst.entity:AddTransform()
    --[[Non-networked entity]]

    inst:AddTag("CLASSIFIED")

    inst:AddComponent("meteorshower")

    return inst
end

return Prefab("meteorspawner", fn)
 

i found this in the game's prefabs but i dont know how to use it 

Link to comment
https://forums.kleientertainment.com/forums/topic/69607-spawn-meteors/
Share on other sites

Thanks, DarkXero. 

I was trying to figure out from the Meteor Shower script how to do this, turn out that your way is more simple than i thought. 

Just one question, how can i set the size of the meteor? In the meteor shower i can use meteor:SetSize("small",mod)

 

2 hours ago, Arthur4718 said:

how can i set the size of the meteor? In the meteor shower i can use meteor:SetSize("small",mod)

The meteor prefab has attached the SetSize function to it.

So it is as simple as doing

local meteor = SpawnPrefab("shadowmeteor")
meteor.Transform:SetPosition(x, y, z)
meteor:SetSize("large", 1.5)

in my example.

You got "small", "medium", and "large". mod is a multiplier that affects the chances of getting special stuff.

32 minutes ago, Arthur4718 said:

Tks

you helped so much!

I could not figure out for myself why there was a mod variable, anyway, tks!

if mod is not defined, it is 1.
It is a multiplier for the chance to include minerals like flints and rocks or also moonrocks

Is it possible to change the animation of the character playing the flute to a much quicker and simplier one? I'm guessing that the line that makes the animation happends is this one:

	inst.components.tool:SetAction(ACTIONS.PLAY)

But i'm not sure though. I would rather the animation that happends when using an ítem, like the spider glant (is just an the first quick animation that came into my mind, not the best though)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...