crator Posted June 17, 2014 Share Posted June 17, 2014 ok so i have figured out how to create a working character and how to do all the rest of the stuff just by browsing forums but i cannot find the topic on making abilities either that or i have just overlooked it Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/ Share on other sites More sharing options...
Rosten Posted June 17, 2014 Share Posted June 17, 2014 (edited) There's no real "Add X to make character do Y" chart, if you're unfamiliar with Lua and coding in general, then your best bet is to look into other mods that do something similar to what you want, and base your code off of them. It'd also help if you'd tell us what you're trying to do. Edited June 17, 2014 by Blazingice26 Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501487 Share on other sites More sharing options...
crator Posted June 17, 2014 Author Share Posted June 17, 2014 i've skimmed through the .lua but i did not know that is how yo go about making abilities but what i am trying to do is use wigfrids ability where she gets a set amount of hp back in battle but i could not find her files in my game i have her unlocked but i dont see her files and i am also trying to do a resistance to cold Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501510 Share on other sites More sharing options...
debugman18 Posted June 17, 2014 Share Posted June 17, 2014 i've skimmed through the .lua but i did not know that is how yo go about making abilities but what i am trying to do is use wigfrids ability where she gets a set amount of hp back in battle but i could not find her files in my game i have her unlocked but i dont see her files and i am also trying to do a resistance to cold Her files are in the dlc folder. Cold resistance is easy.inst.components.freezable:SetResistance(resist) Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501512 Share on other sites More sharing options...
crator Posted June 17, 2014 Author Share Posted June 17, 2014 no wonder thanks man Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501513 Share on other sites More sharing options...
crator Posted June 17, 2014 Author Share Posted June 17, 2014 wait i only found her speech and why is her name wathgrither do you know the exact place it is located? Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501519 Share on other sites More sharing options...
debugman18 Posted June 17, 2014 Share Posted June 17, 2014 wait i only found her speech and why is her name wathgrither do you know the exact place it is located? data/DLC0001/scripts/prefabs/wathgrither.lua Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501521 Share on other sites More sharing options...
crator Posted June 17, 2014 Author Share Posted June 17, 2014 thanks again but this is all i could find i assume this is what i am looking for but i do not know what to do with it inst.components.health:SetAbsorptionAmount(TUNING.WATHGRITHR_ABSORPTION) Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501530 Share on other sites More sharing options...
debugman18 Posted June 17, 2014 Share Posted June 17, 2014 thanks again but this is all i could find i assume this is what i am looking for but i do not know what to do with it inst.components.health:SetAbsorptionAmount(TUNING.WATHGRITHR_ABSORPTION) Well, this is what you're interested in:local function onkill(inst, data) if data.cause == inst.prefab and not data.inst:HasTag("prey") and not data.inst:HasTag("veggie") and not data.inst:HasTag("structure") then local delta = (data.inst.components.combat.defaultdamage) * 0.25 inst.components.health:DoDelta(delta, false, "battleborn") inst.components.sanity:DoDelta(delta) if math.random() < .1 and not data.inst.components.health.nofadeout then local time = data.inst.components.health.destroytime or 2 inst:DoTaskInTime(time, function() local s = medScale if data.inst:HasTag("smallcreature") then s = smallScale elseif data.inst:HasTag("largecreature") then s = largeScale end local fx = SpawnPrefab("wathgrithr_spirit") fx.Transform:SetPosition(data.inst:GetPosition():Get()) fx.Transform:SetScale(s,s,s) end) end endendand this:inst:ListenForEvent("entity_death", function(wrld, data) onkill(inst, data) end, GetWorld()) Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501540 Share on other sites More sharing options...
crator Posted June 17, 2014 Author Share Posted June 17, 2014 so do i copy and paste and than change her name to my characters of no Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501547 Share on other sites More sharing options...
debugman18 Posted June 17, 2014 Share Posted June 17, 2014 so do i copy and paste and than change her name to my characters of no Well, a copy/paste isn't ideal for that. I highly suggest reading through her prefab and to try and understand as much as you can. For instance, the spirit prefab is spawned, and if you don't have it declared in your prefabs table in your character prefab, it won't spawn it. Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501550 Share on other sites More sharing options...
crator Posted June 17, 2014 Author Share Posted June 17, 2014 so this is what im looking for? local prefabs = {"spear_wathgrithr", "wathgrithrhat","wathgrithr_spirit",} Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501553 Share on other sites More sharing options...
debugman18 Posted June 17, 2014 Share Posted June 17, 2014 so this is what im looking for? local prefabs = {"spear_wathgrithr", "wathgrithrhat","wathgrithr_spirit",} Yes, but you don't need "spear_wathgrithr" or "wathgrithrhat". Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501560 Share on other sites More sharing options...
crator Posted June 17, 2014 Author Share Posted June 17, 2014 so i use that and the other thing do i change the name? Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501561 Share on other sites More sharing options...
debugman18 Posted June 17, 2014 Share Posted June 17, 2014 so i use that and the other thing do i change the name? The absorption? You could just replace that variable with the amount you want. Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501564 Share on other sites More sharing options...
crator Posted June 17, 2014 Author Share Posted June 17, 2014 no im sorry i was not specific i was talking about the prefab so i go into my prefab and type in wathgrithr_spirit then go to my local fn = function(inst) than type in local function onkill(inst, data)if data.cause == inst.prefab and not data.inst:HasTag("prey") and not data.inst:HasTag("veggie") and not data.inst:HasTag("structure") thenlocal delta = (data.inst.components.combat.defaultdamage) * 0.25 inst.components.health:DoDelta(delta, false, "battleborn") inst.components.sanity:DoDelta(delta) if math.random() < .1 and not data.inst.components.health.nofadeout then local time = data.inst.components.health.destroytime or 2 inst:DoTaskInTime(time, function() local s = medScale if data.inst:HasTag("smallcreature") then s = smallScale elseif data.inst:HasTag("largecreature") then s = largeScale end local fx = SpawnPrefab("wathgrithr_spirit") fx.Transform:SetPosition(data.inst:GetPosition():Get()) fx.Transform:SetScale(s,s,s) end) endand also type in inst.components.health:SetAbsorptionAmount(x= the amount i want?) this? do i have to change wathgrithr to my characters name? Link to comment https://forums.kleientertainment.com/forums/topic/37556-does-anyone-know-how-to-create-abilities-for-a-custom-character/#findComment-501571 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