Craig_Perry Posted August 17, 2013 Share Posted August 17, 2013 (edited) I'm not sure if this is because I'm using the latest beta or if its been like this for a while. It seems all 3 types of the hounds are compressed into a single prefab file but in hounded.lua it mentions multiple prefabs including firehound and icehound, is it possible for any clarification on this? as I've been searching for a while but haven't turned much up all Ive found is that this is in hound.lua when I'd assume each would be separated from the normal hounds so to add another hound would I simply copy one of these and just tweak some of the statistics and lootdropper prefabs (after adding said prefabs to the associated prefabs part at the top of course) local function fnfire(Sim)local inst = fncommon(Sim)inst.AnimState:SetBuild("hound_red") inst.components.combat:SetDefaultDamage(TUNING.FIREHOUND_DAMAGE) inst.components.combat:SetAttackPeriod(TUNING.FIREHOUND_ATTACK_PERIOD) inst.components.locomotor.runspeed = TUNING.FIREHOUND_SPEED inst.components.health:SetMaxHealth(TUNING.FIREHOUND_HEALTH) inst.components.lootdropper:SetLoot({"monstermeat","houndstooth","houndfire","houndfire","houndfire"}) inst.components.lootdropper:AddChanceLoot("redgem", 0.2)inst:ListenForEvent("death", function(inst)inst.SoundEmitter:PlaySound("dontstarve/creatures/hound/firehound_explo", "explosion")end)return instendlocal function fncold(Sim)local inst = fncommon(Sim)inst.AnimState:SetBuild("hound_ice") inst.components.combat:SetDefaultDamage(TUNING.ICEHOUND_DAMAGE) inst.components.combat:SetAttackPeriod(TUNING.ICEHOUND_ATTACK_PERIOD) inst.components.locomotor.runspeed = TUNING.ICEHOUND_SPEED inst.components.health:SetMaxHealth(TUNING.ICEHOUND_HEALTH) inst.components.lootdropper:SetLoot({"monstermeat","houndstooth","houndstooth"}) inst.components.lootdropper:AddChanceLoot("bluegem", 0.2)inst:ListenForEvent("death", function(inst)inst.SoundEmitter:PlaySound("dontstarve/creatures/hound/icehound_explo", "explosion")end)return instendlocal function fnfiredrop(Sim)local inst = CreateEntity()inst.entity:AddTransform() MakeInventoryPhysics(inst) MakeLargeBurnable(inst, 6+ math.random()*6) MakeLargePropagator(inst) inst.components.burnable:Ignite() return instendreturn Prefab( "monsters/hound", fndefault, assets, prefabs),Prefab( "monsters/firehound", fnfire, assets, prefabs),Prefab( "monsters/icehound", fncold, assets, prefabs),Prefab( "monsters/houndfire", fnfiredrop, assets, prefabs) and of course sorry to bother you all after some additional searching I have found out icehound and firehound seem to be set_builds but this file compression still has me a little confused on how to add more Edited August 17, 2013 by Craig_Perry Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/ Share on other sites More sharing options...
Heavenfall Posted August 17, 2013 Share Posted August 17, 2013 At the end of hound.lua you see thisreturn Prefab( "monsters/hound", fndefault, assets, prefabs), Prefab( "monsters/firehound", fnfire, assets, prefabs), Prefab( "monsters/icehound", fncold, assets, prefabs),which tells you the prefabs and their respective functions - fndefault() fnfire() fncold() And if you go to those functions in hound.lua you'll see code like this, example fndefault()local function fndefault() local inst = fncommon(Sim) MakeMediumFreezableCharacter(inst, "hound_body") MakeMediumBurnableCharacter(inst, "hound_body") return instend or fncold()local function fncold(Sim) local inst = fncommon(Sim) inst.AnimState:SetBuild("hound_ice") inst.components.combat:SetDefaultDamage(TUNING.ICEHOUND_DAMAGE) inst.components.combat:SetAttackPeriod(TUNING.ICEHOUND_ATTACK_PERIOD) inst.components.locomotor.runspeed = TUNING.ICEHOUND_SPEED inst.components.health:SetMaxHealth(TUNING.ICEHOUND_HEALTH) inst.components.lootdropper:SetLoot({"monstermeat","houndstooth","houndstooth"}) inst.components.lootdropper:AddChanceLoot("bluegem", 0.2) inst:ListenForEvent("death", function(inst) inst.SoundEmitter:PlaySound("dontstarve/creatures/hound/icehound_explo", "explosion") end) return instend In other words the file is defining variations of hounds, drawn from the fncommon(). Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/#findComment-293894 Share on other sites More sharing options...
Craig_Perry Posted August 17, 2013 Author Share Posted August 17, 2013 (edited) At the end of hound.lua you see thisreturn Prefab( "monsters/hound", fndefault, assets, prefabs), Prefab( "monsters/firehound", fnfire, assets, prefabs), Prefab( "monsters/icehound", fncold, assets, prefabs),which tells you the prefabs and their respective functions - fndefault() fnfire() fncold() And if you go to those functions in hound.lua you'll see code like this, example fndefault()local function fndefault() local inst = fncommon(Sim) MakeMediumFreezableCharacter(inst, "hound_body") MakeMediumBurnableCharacter(inst, "hound_body") return instendor fncold()local function fncold(Sim) local inst = fncommon(Sim) inst.AnimState:SetBuild("hound_ice") inst.components.combat:SetDefaultDamage(TUNING.ICEHOUND_DAMAGE) inst.components.combat:SetAttackPeriod(TUNING.ICEHOUND_ATTACK_PERIOD) inst.components.locomotor.runspeed = TUNING.ICEHOUND_SPEED inst.components.health:SetMaxHealth(TUNING.ICEHOUND_HEALTH) inst.components.lootdropper:SetLoot({"monstermeat","houndstooth","houndstooth"}) inst.components.lootdropper:AddChanceLoot("bluegem", 0.2) inst:ListenForEvent("death", function(inst) inst.SoundEmitter:PlaySound("dontstarve/creatures/hound/icehound_explo", "explosion") end) return instendIn other words the file is defining variations of hounds, drawn from the fncommon().I see, Im trying to add a new hound to the mix (Ive got hounded.lua complete) but Im just suprised and a little confused as to how Im going to add a new hound edit: do I have to look into fncommon()? Edited August 17, 2013 by Craig_Perry Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/#findComment-293937 Share on other sites More sharing options...
Heavenfall Posted August 17, 2013 Share Posted August 17, 2013 Yes, it functions like any other prefab. Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/#findComment-293971 Share on other sites More sharing options...
Craig_Perry Posted August 17, 2013 Author Share Posted August 17, 2013 Yes, it functions like any other prefab.ok thanks Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/#findComment-293975 Share on other sites More sharing options...
simplex Posted August 17, 2013 Share Posted August 17, 2013 (edited) I think you could dolocal function fn() local inst = SpawnPrefab("hound") inst.prefab, inst.name = nil --[[/* customize prefab here */]]-- return instendwhere SpawnPrefab is replacing CreateEntity. Edited August 17, 2013 by simplex Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/#findComment-294146 Share on other sites More sharing options...
Craig_Perry Posted August 18, 2013 Author Share Posted August 18, 2013 (edited) I think you could dolocal function fn() local inst = SpawnPrefab("hound") inst.prefab, inst.name = nil --[[/* customize prefab here */]]-- return instendwhere SpawnPrefab is replacing CreateEntity. I'll give it a shot edit: Ive added it to hound.lua is this placement appropriate for these lineslocal function fncommon()local inst = CreateEntity() local inst = SpawnPrefab ("hound") --[[/Yellow_Hound/]]-- return instendlocal trans = inst.entity:AddTransform()local anim = inst.entity:AddAnimState() local physics = inst.entity:AddPhysics()local sound = inst.entity:AddSoundEmitter()local shadow = inst.entity:AddDynamicShadow()shadow:SetSize( 2.5, 1.5 ) inst.Transform:SetFourFaced() Edited August 18, 2013 by Craig_Perry Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/#findComment-294360 Share on other sites More sharing options...
simplex Posted August 18, 2013 Share Posted August 18, 2013 I'll give it a shot edit: Ive added it to hound.lua is this placement appropriate for these lineslocal function fncommon()local inst = CreateEntity() local inst = SpawnPrefab ("hound") --[[/Yellow_Hound/]]-- return instendlocal trans = inst.entity:AddTransform()local anim = inst.entity:AddAnimState() local physics = inst.entity:AddPhysics()local sound = inst.entity:AddSoundEmitter()local shadow = inst.entity:AddDynamicShadow()shadow:SetSize( 2.5, 1.5 ) inst.Transform:SetFourFaced() No, they should be inside their "fn", which you will give to the Prefab(). Also, if you're going to stick it directly into hound.lua, SpawnPrefab("hound") is pointless. Just call fncommon(). Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/#findComment-294400 Share on other sites More sharing options...
Craig_Perry Posted August 18, 2013 Author Share Posted August 18, 2013 No, they should be inside their "fn", which you will give to the Prefab(). Also, if you're going to stick it directly into hound.lua, SpawnPrefab("hound") is pointless. Just call fncommon().yeah, I've been experimenting for a long while with the code and decided not to continue as I'm not experienced enough I need to study lua more. But thanks for the help Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/#findComment-294408 Share on other sites More sharing options...
simplex Posted August 18, 2013 Share Posted August 18, 2013 yeah, I've been experimenting for a long while with the code and decided not to continue as I'm not experienced enough I need to study lua more. But thanks for the helpIt's your call. But I think that if you pushed a bit more you'd get at least a basic version working. Link to comment https://forums.kleientertainment.com/forums/topic/26350-houndlua-but-where-is-firehoundlua-and-icehoundlua/#findComment-294414 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