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 Share on other sites More sharing options...
Rosten Posted June 17, 2014 Share Posted June 17, 2014 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. Link to comment 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 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 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 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 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 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 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 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 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 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 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 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 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 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 Share on other sites More sharing options...
Recommended Posts
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.