Lumina Posted September 16, 2016 Share Posted September 16, 2016 (edited) Hello, I want to add news hound to hound wawe, one for each season, but i'm still confused when it comes to component change. Should i replace the "local function SummonSpawn(pt)" and add a new table to define which hound is related to which season ? Also, is there a way to start an hound attack to test the mod ? Thanks a lot Edited September 16, 2016 by Lumina Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/ Share on other sites More sharing options...
Serpens Posted September 16, 2016 Share Posted September 16, 2016 (edited) I think this mod might be perfect: http://steamcommunity.com/sharedfiles/filedetails/?id=544126369 hmm.. I just saw this mod replaces the old hounded component, which is not a good idea...but the rest looks professional. if it is not possible to change stuff with normal modding functions, maybe try this: and also this mod adds new hounds to attack:http://steamcommunity.com/sharedfiles/filedetails/?id=591576144 Edited September 16, 2016 by Serpens Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-814429 Share on other sites More sharing options...
Lumina Posted September 16, 2016 Author Share Posted September 16, 2016 Thanks, but it seems that the other mod also change base file. I prefer to avoid it if possible. I dont understand the link you post, what it suppose to do ? Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-814490 Share on other sites More sharing options...
Serpens Posted September 16, 2016 Share Posted September 16, 2016 (edited) the stuff DarkXero posted there is a way to edit local game functions without the need to completely overwrite the scripts, like the mods above do. In case of teleportato I finally used another function where I was able to just use normal AddPrefabPostInit. So I did not test the code from DarkXero more than you can read in the thread. Maybe try reading some of the posts above to understand it better. Edited September 16, 2016 by Serpens Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-814501 Share on other sites More sharing options...
Serpens Posted September 17, 2016 Share Posted September 17, 2016 More examples how to use it you can see in the following post and in the modmain 2 posts later from DarkXero Especially the modmain should really help to understand how to use it. Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-814994 Share on other sites More sharing options...
Lumina Posted September 17, 2016 Author Share Posted September 17, 2016 Ok, thanks, i'll take a look I'm afraid it's beyond my understanding of coding, but i appreciate the help a lot. Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-815002 Share on other sites More sharing options...
Serpens Posted September 17, 2016 Share Posted September 17, 2016 (edited) I also don't understand what it does exactly (the "debug" stuff) But the only thing you need to know is how to use it And now we have ~ 4 examples on different things, so I think with some trial and error it should work Edited September 17, 2016 by Serpens Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-815004 Share on other sites More sharing options...
DarkXero Posted September 18, 2016 Share Posted September 18, 2016 Do you want to replace the winter/spring ice hounds for other type of hounds, or do you want to introduce new spawns on the wave? Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-815032 Share on other sites More sharing options...
Lumina Posted September 18, 2016 Author Share Posted September 18, 2016 @DarkXero I would like to add new spanws to the existing one. But i guess a replacing could still be better than nothing if it's easier/possible. Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-815192 Share on other sites More sharing options...
DarkXero Posted September 18, 2016 Share Posted September 18, 2016 Well, I assumed it would have been overkill to spawn extra stuff along with the hounds, so I did this local function GetUpvalue(func, name) local debug = GLOBAL.debug local i = 1 while true do local n, v = debug.getupvalue(func, i) if not n then return nil, nil end if n == name then return v, i end i = i + 1 end end local function SetUpvalue(func, ind, value) local debug = GLOBAL.debug debug.setupvalue(func, ind, value) end local function HackHounded(self) local summon_fn = self.SummonSpawn local SummonSpawn, SummonSpawn_index = GetUpvalue(summon_fn, "SummonSpawn") local GetSpawnPoint, GetSpawnPoint_index = GetUpvalue(SummonSpawn, "GetSpawnPoint") local old_SummonSpawn = SummonSpawn local new_SummonSpawn = function(pt) -- Chance for our prefab to replace a hound of the wave if pt and math.random() < 0.5 then local spawn_pt = GetSpawnPoint(pt) if spawn_pt then local prefab = "spider_warrior" -- Chance to get a special prefab of ours (like ice hound instead of hound) if math.random() < 0.33 then if GLOBAL.TheWorld.state.iswinter or GLOBAL.TheWorld.state.isspring then prefab = "krampus" else prefab = "warg" end end local spawn = GLOBAL.SpawnPrefab(prefab) if spawn then spawn.Physics:Teleport(spawn_pt:Get()) spawn:FacePoint(pt) if spawn.FadeIn ~= nil then spawn:FadeIn() end return spawn end end else return old_SummonSpawn(pt) end end SetUpvalue(summon_fn, SummonSpawn_index, new_SummonSpawn) end AddComponentPostInit("hounded", HackHounded) Now you can get normal hounds, season hounds, your stuff, and also your season stuff. To test hound waves, you can host a server WITHOUT caves, then input c_select(TheWorld) then press backspace to show debug info. Then on the items on the left, look for the hounded component. The string will say how much time is left until the next attack. Then you do LongUpdate(400) or whatever number in seconds is needed to reach the wave. If it says 500 until next attack, put 450 so you can hear the warning sounds before the wave spawns. 1 Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-815319 Share on other sites More sharing options...
Lumina Posted September 18, 2016 Author Share Posted September 18, 2016 Thanks a lot. All seems to work perfectly fine so far, the old classic hound spawn with the new prefab without any problem. Thanks also for the command, it's very useful to have access of this kind of debug info when trying some mods I'm grateful for the help. Link to comment https://forums.kleientertainment.com/forums/topic/70187-adding-new-hounds-to-hound-wawe/#findComment-815335 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