diovbc Posted January 19, 2017 Share Posted January 19, 2017 (edited) Being straightforward, i'm trying to always spawn a Varg when a hunt is completed. The command lines i tried are: Quote local hunt_varg = inst.components.hunter.self:OnDirtInvestigated -- Varg hunt test. inst.components.hunter.self:OnDirtInvestigated = function (self, inst, pt, doer) if hunt.trackspawned == hunt.numtrackstospawn then SpawnPrefab("warg") hunt.activeplayer:PushEvent("huntbeastnearby") StopHunt(hunt) else --print("SpawnHuntedBeast FAILED! RESETTING") ResetHunt(hunt) end return hunt_varg (self, inst, pt, doer) end And the error is: Quote [string "scripts/mainfunctions.lua"]:90: Error loading file prefabs/yukihime [string "../mods/Yukihime - Art/scripts/prefabs/yukihime.lua"]:112: function arguments expected near 'inst' LUA ERROR stack traceback: =[C] in function 'assert' scripts/mainfunctions.lua(90,1) =(tail call) ? =[C] in function 'xpcall' scripts/mods.lua(131,1) scripts/mods.lua(570,1) in function 'RegisterPrefabs' scripts/gamelogic.lua(216,1) in function 'LoadAssets' scripts/gamelogic.lua(802,1) =[C] in function 'SetPersistentString' scripts/saveindex.lua(176,1) in function 'Save' scripts/saveindex.lua(362,1) =[C] in function 'SerializeWorldSession' scripts/networking.lua(275,1) in function 'SerializeWorldSession' scripts/saveindex.lua(365,1) in function 'OnGenerateNewWorld' scripts/gamelogic.lua(813,1) in function 'cb' scripts/screens/worldgenscreen.lua(144,1) in function 'OnUpdate' scripts/frontend.lua(587,1) in function 'Update' scripts/update.lua(94,1) [00:01:51]: Disabling Yukihime - Art (Yukihime) because it had an error. Any ideas? Any help is appreciated. Also, uploaded the file if anyone wants to take a deeper look. I'm pretty desperate to make it work. Everything i've tried is failing. yukihime.lua Edited January 19, 2017 by diovbc Retried everything with different code. Updated the post. Link to comment https://forums.kleientertainment.com/forums/topic/73463-help-special-hunting-or-something/ Share on other sites More sharing options...
zUsername Posted January 19, 2017 Share Posted January 19, 2017 @diovbc You can't override SpawnHuntedBeast because it's local function. Link to comment https://forums.kleientertainment.com/forums/topic/73463-help-special-hunting-or-something/#findComment-859594 Share on other sites More sharing options...
diovbc Posted January 19, 2017 Author Share Posted January 19, 2017 Got it. Thanks. Then what should i do to make the varg spawn work? Link to comment https://forums.kleientertainment.com/forums/topic/73463-help-special-hunting-or-something/#findComment-859644 Share on other sites More sharing options...
diovbc Posted January 19, 2017 Author Share Posted January 19, 2017 Reconfigured everything. Post edited with the new (still wrong) code. Link to comment https://forums.kleientertainment.com/forums/topic/73463-help-special-hunting-or-something/#findComment-859714 Share on other sites More sharing options...
zUsername Posted January 20, 2017 Share Posted January 20, 2017 Same thing you did before. "hunt" is local variable you can't use it. Easy way to make those works is copy hunter.lua and edit it as you want then create scripts/components folder and put hunter.lua (edition) into. Link to comment https://forums.kleientertainment.com/forums/topic/73463-help-special-hunting-or-something/#findComment-859917 Share on other sites More sharing options...
diovbc Posted February 5, 2017 Author Share Posted February 5, 2017 Tried that. No bugs or crashes, but the Varg doesn't spawn anyway. May i upload the character? Link to comment https://forums.kleientertainment.com/forums/topic/73463-help-special-hunting-or-something/#findComment-863930 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