Jump to content

[Custom Character] Kerrigan, The Queen of Blades


Seiai

Recommended Posts

local function onequip_red(inst, owner)     print("equipred")    owner.AnimState:OverrideSymbol("swap_body", "torso_amulets", "redamulet")    inst.task = inst:DoPeriodicTask(30, function() healowner(inst, owner) end)end
in dont_starve\data\DLC0001\scripts\prefabs\amulet.lua and dont_starve\data\scripts\prefabs\amulet.lua

i spawn it on the group, pickup/equip it, unequip it into the inventory, equip it again, nothing in the console and the log.txt... and i had that problem before with the combat.lua. so far i was able to get the information i needed in other ways, but still... is there maybe a option to turn off nonmod output?(and i accidently activated that?)

Link to comment
Share on other sites

@Seiai,

 

As a test, try printing something easily searchable right before the DLC version of the amulet file returns, eg:

print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")return Prefab( "common/inventory/amulet", red, assets),Prefab("common/inventory/blueamulet", blue, assets),Prefab("common/inventory/purpleamulet", purple, assets),Prefab("common/inventory/orangeamulet", orange, assets),Prefab("common/inventory/greenamulet", green, assets),Prefab("common/inventory/yellowamulet", yellow, assets)

Then check your Documents\Klei\donotstarve\log.txt after the game fully loads (no need to exit).  It should end up getting printed just after the "Load scripts" message:

 

 

scripts/dlcsupport.lua(24,1) Load scripts/DLC001_prefab_files    
scripts/prefabs/amulet.lua(342,1) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!    
scripts/prefabs/amulet.lua(342,1) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!  

<mod loading messages here>

 

 

btw, if you don't tag me in a reply there's a good chance I'll miss it for a day or two ;)

Link to comment
Share on other sites

@Corrosive

reinstalling fixed it, i guess i screwed something up at some point, ty for the help.

and another question^^

i was experimenting around with overriding functions(and still haveing problems understanding how lua handles all this) and wanted to ask, if u know, if theres a way to override a function of a component with a modified version of itsself with just referencing it.

i tried it with local overriding from the prefab:

 

inst:AddComponent("Temperature")local Temperature=inst.components.temperaturefunction Temperature:OnUpdate(dt, applyhealthdelta) inst.components.Temperature:OnUpdate(dt*4, applyhealthdelta)  return end
this is just supposed to make time pass faster for this component, making u freeze/overheat faster.(iam trying to help http://forums.kleientertainment.com/topic/52924-wyvard-the-cold-blooded-cavalier/)

this works and triggers all the effects from the function, but it seems this makes the component in a way private, so the OnUpdate function made me overheat near a fire, which means it obviously changed my temperature, but when accessing inst.components.temperature.current or inst.temperature.current the temperature never changed from the startingvalue(and my ui-mod that showed temperature didnt work anymore either).

especially that inst.temperature.current(which should be a reference to the version of the component that the updatefunction runs on) didnt work either, seems strange to me.

And yes, i could workaround that with a DoPeriodicTask or OnUpdate in the character, to just save the temperaturedifference from the last check till now and just add that difference again, but i have real problems understanding how lua handles overriding and puting components in local variables... (which really bugs me since i also work as a programer) and i wasnt able to find a good luatutorial, that clearly explains that.

Link to comment
Share on other sites

@Seiai,

inst:AddComponent("Temperature")local temperature=inst.components.temperaturelocal onupdate_old = temperature.onupdatefunction temperature:OnUpdate(dt, applyhealthdelta)    onupdate_old(self, dt*4, applyhealthdelta)end

You want to pass self to onupdate_old is because it expects that to be the first parameter, but you aren't calling it via colon syntax.  The reason you don't want to attach the old function to the component is for compatibility with other mods that might do the same thing.  You could give it a very unique name, but then you're just cluttering up the component for no reason.

Link to comment
Share on other sites

@Corrosive

is there an easy way to override the punch animation of a my character with an animation that i made in spriter?

i guess i would have override the attack State from SGwilson and right before it plays the "punch" anim, i would have to change the bank and build to my punchanimation and then play it and then change the bank and build back to standart.

is there a way to just overwrite the attack state?

Link to comment
Share on other sites

@Seiai,

 

This is very easy to do, but you should be wary of using custom player animations.  Animations you create in Spriter are missing a lot of important data.  For example, Spriter doesn't have a feature that directly maps to the "layername" property of symbols in Klei's formats, so when the autocompiler builds your animations, it just inserts a new, automatically named layer for each Spriter timeline.  If you pop open a generated .zip file located in your Exported folder(this zip contains the intermediate files used to convert spriter animations), you can take a look at animation.xml to see this for yourself.  You'll notice something like the following:

<element name="megaplanter" layername="timeline_0" frame="0" z_index="2" m_a="1.000000" m_b="0.000000" m_c="0.000000" m_d="1.000000" m_tx="5.830780" m_ty="4.556400"/>

 

This causes anything using AnimState:Hide and AnimState:Show to not function while a custom animation is being played(specifically, everything will always be visible, since those layers aren't there to be hidden).  This affects ARM_carry/HAT/HAIR/HEAD/etc.

 

I'm almost done working on a tool that lets you get around this limitation, but I need a bit longer before I can release it.

 

If you aren't concerned with the limitations for now, then you can easily override part of the stategraph using AddStategraphPostInit("wilson")

 

Link to comment
Share on other sites

@Corrosive,

in pigbrain.lua there is the actionhandler

ActionHandler(ACTIONS.CHOP, "chop"),
but also the eventhandler

    EventHandler("doaction",         function(inst, data)             if not inst.components.health:IsDead() and not inst.sg:HasStateTag("busy") then                if data.action == ACTIONS.CHOP then                    inst.sg:GoToState("chop", data.target)                end            end        end),
when does this eventhandler come into play? i put a print in it, and it didnt seem to trigger.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...