Jump to content

Recommended Posts

Hello, I'm making a photographer character that uses a camera that makes pictures depending on his sanity, depending on the sanity threshold.

"Passionate Picture" high sanity

"Bland Picture" medium sanity

"Horrible Picture" low sanity

My problem is:
I have no idea how to make this, any help would be appreciated, and thanks in advance.

local assets = {
    Asset("ANIM", "anim/camera.zip")
}

local prefabs = {
    "picture_good",
    "picture_meh",
    "picture_bad",
}

local function fn()
    local inst = CreateEntity()

    inst.entity:AddTransform()
    inst.entity:AddAnimState()
    inst.entity:AddNetwork()

    MakeInventoryPhysics(inst)

    inst.AnimState:SetBank("camera")
    inst.AnimState:SetBuild("camera")
    inst.AnimState:PlayAnimation("idle")

    inst:AddTag("picturetaker")

    MakeInventoryFloatable(inst, "med", nil, 0.88)

    inst.entity:SetPristine()

    if not TheWorld.ismastersim then
        return inst
    end

    inst:AddComponent("inspectable")
    inst:AddComponent("inventoryitem")

    MakeHauntableLaunch(inst)

    return inst
end

This is what I have btw

I feel like you simply need to make a new componentaction to take a picture, and poop out the corresponding picture prefab based on your sanity.
I would research how to create a add a new componentaction, and make a component just for this item. For more information I would start by looking at similar existing items that can be right clicked in the inventory to do something such as the pan flute or healing items.

  • Like 1

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...