Atena Posted May 17, 2015 Share Posted May 17, 2015 Hello! I make a mod to change "axe" item components. Let it have "fueled" component. I search this component and know must change "MkeHauntableLaunch" to "MakeHauntableLaunchAndPerish". The "fueled" component is work. But I code with "AddPrefabPostInit" and Add "MakeHauntableLaunchAndPerish". The mod running error, show message "MakeHauntableLaunchAndPerish(nill)", please tell me how to work.table.insert(TUNING, "MED_PERISHTIME")TUNING.MED_PERISHTIME = TUNING.TOTAL_DAY_TIME * 30local function MedPerish(prefab) if(prefab.components.fueled == nil) then prefab:AddComponent("fueled") -- prefab.components.fueled.fueltype = FUELTYPE.USAGE prefab.components.fueled:InitializeFuelLevel(TUNING.MED_PERISHTIME) prefab.components.fueled:SetDepletedFn(prefab.Remove) if prefab.components.fueled then prefab.components.fueled:StartConsuming() end MakeHauntableLaunchAndSmash(prefab) end endAddPrefabPostInit("axe", MedPerish) Link to comment https://forums.kleientertainment.com/forums/topic/54100-helphow-to-change-mkehauntablelaunch-to-makehauntablelaunchandperish-by-addprefabpostinit/ Share on other sites More sharing options...
DarkXero Posted May 17, 2015 Share Posted May 17, 2015 You needGLOBAL.MakeHauntableLaunchAndSmash(prefab)to access it from modmain. Link to comment https://forums.kleientertainment.com/forums/topic/54100-helphow-to-change-mkehauntablelaunch-to-makehauntablelaunchandperish-by-addprefabpostinit/#findComment-638347 Share on other sites More sharing options...
Atena Posted May 18, 2015 Author Share Posted May 18, 2015 You needGLOBAL.MakeHauntableLaunchAndSmash(prefab)to access it from modmain. Thanks, I try it. Link to comment https://forums.kleientertainment.com/forums/topic/54100-helphow-to-change-mkehauntablelaunch-to-makehauntablelaunchandperish-by-addprefabpostinit/#findComment-638440 Share on other sites More sharing options...
Atena Posted May 18, 2015 Author Share Posted May 18, 2015 Yes, It's working. Thanks a lot. Link to comment https://forums.kleientertainment.com/forums/topic/54100-helphow-to-change-mkehauntablelaunch-to-makehauntablelaunchandperish-by-addprefabpostinit/#findComment-638449 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