Feanara

  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Feanara

  • Rank
    Junior Member
...
  1. I want my custom character to lose sanity every time they light a fire (excluding adding fuel to a firepit or crafting a torch). But the fire mechanic is confusing me. I thought it would be simple, just adding the line inst.components.lighter:SetOnLightFn(firefn). But I guess characters don't have the 'lighter' component, instead that goes into the torch itself. How do I detect when my character lights something on fire using a torch?
  2. I was over-complicating it...I scrapped all that and decided to make the drink action redirect to Eat, which worked beautifully. So I no longer need help on this one
  3. So I'm trying to create a new action for 'DRINK'...it's very similar to eat, but doesn't rot or get removed after use. I've attached both component files, and here's the action code in ModMain: -- ACTIONS GLOBAL.ACTIONS.DRINK = GLOBAL.Action({mount_enabled=true}) GLOBAL.ACTIONS.DRINK.id = "DRINK" GLOBAL.ACTIONS.DRINK.str = "Drink" GLOBAL.ACTIONS.DRINK.fn = function(act) local obj = act.target or act.invobject if act.doer.components.drinker and obj and obj.components.drinkable then print("doing drink action") return act.doer.components.drinker:Drink(obj) end end AddAction(GLOBAL.ACTIONS.DRINK) When I start up with my custom character (who is a drinker and starts with a flask in her inventory), the flask's action does show 'drink' like it should. But when I click it, nothing happens. Here's a snippet for the log file when I only clicked the flask twice: [00:01:07]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:07]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:07]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:07]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:15]: cSoundEmitterComponent::PlaySound() already playing sound named [flyin] [00:01:15]: cSoundEmitterComponent::PlaySound() already playing sound named [flyin] [00:01:15]: cSoundEmitterComponent::PlaySound() already playing sound named [flyin] [00:01:15]: cSoundEmitterComponent::PlaySound() already playing sound named [flyin] [00:01:16]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:17]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:17]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:17]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:17]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:18]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:18]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:18]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:27]: cSoundEmitterComponent::PlaySound() already playing sound named [flyin] [00:01:27]: cSoundEmitterComponent::PlaySound() already playing sound named [flyin] [00:01:27]: cSoundEmitterComponent::PlaySound() already playing sound named [flyin] [00:01:27]: cSoundEmitterComponent::PlaySound() already playing sound named [flyin] [00:01:28]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:30]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:30]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action [00:01:30]: ../mods/MightyNein/scripts/components/drinkable.lua(41,1) inserting drink action none of my other print statements are firing, which means it's calling Drinkable:CollectInventoryActions but nothing else? I've tried to hunt down other mods with custom actions to try and understand this, but I'm pretty stuck at this point. drinker.lua drinkable.lua