JaccK1618 Posted September 6, 2024 Share Posted September 6, 2024 How exactly do you make configuration options for damage sources? What do I fill in here in modmain at the ??? (I already set config name to "damage") local ??? = GetModConfigData("damage") And then what kind of function would I put in the actual script for the damage? Link to comment https://forums.kleientertainment.com/forums/topic/159548-want-to-make-a-damage-configuration/ Share on other sites More sharing options...
Haruhi Kawaii Posted September 7, 2024 Share Posted September 7, 2024 8 hours ago, JaccK1618 said: How exactly do you make configuration options for damage sources? What do I fill in here in modmain at the ??? (I already set config name to "damage") local ??? = GetModConfigData("damage") And then what kind of function would I put in the actual script for the damage? You can use TUNING In modmain TUNING.WP_DAMAGE = GetModConfigData("damage") In Weapon inst.components.weapon:SetDamage(TUNING.WP_DAMAGE ) Link to comment https://forums.kleientertainment.com/forums/topic/159548-want-to-make-a-damage-configuration/#findComment-1746310 Share on other sites More sharing options...
JaccK1618 Posted September 7, 2024 Author Share Posted September 7, 2024 10 hours ago, Haruhi Kawaii said: You can use TUNING In modmain TUNING.WP_DAMAGE = GetModConfigData("damage") In Weapon inst.components.weapon:SetDamage(TUNING.WP_DAMAGE ) Alright it looks like when I try in game it says the "SetDamage" is a "nil value" I'm using this script for the damage inst:AddComponent("combat") inst.components.combat:SetDamage(TUNING.WP_DAMAGE) 1 Link to comment https://forums.kleientertainment.com/forums/topic/159548-want-to-make-a-damage-configuration/#findComment-1746429 Share on other sites More sharing options...
Baguettes Posted September 7, 2024 Share Posted September 7, 2024 (edited) I've gotta ask a little: Are you doing this for an item's damage, or a character's damage? Combat component is for characters, Weapon component is, well, for weapons. also, that function does not exist; use ...combat:SetDefaultDamage(number) instead of ...combat:SetDamage(). (edit: it exists on weapon, but not combat component.) Edited September 7, 2024 by Baguettes Link to comment https://forums.kleientertainment.com/forums/topic/159548-want-to-make-a-damage-configuration/#findComment-1746453 Share on other sites More sharing options...
yanecc Posted September 8, 2024 Share Posted September 8, 2024 For the combat component, you need to use: inst:AddComponent("combat") inst.components.combat:SetDefaultDamage(TUNING.WP_DAMAGE) Alternatively, you could also set it using a multiplier: inst:AddComponent("combat") inst.components.combat:SetDefaultDamage(1000) inst.components.combat.damagemultiplier = TUNING.WP_DAMAGEMULTIPLIER Furthermore, you might want it not to be lethal to players: inst:AddComponent("combat") inst.components.combat:SetDefaultDamage(TUNING.WP_DAMAGE) inst.components.combat.playerdamagepercent = 0.1 Link to comment https://forums.kleientertainment.com/forums/topic/159548-want-to-make-a-damage-configuration/#findComment-1746521 Share on other sites More sharing options...
JaccK1618 Posted September 8, 2024 Author Share Posted September 8, 2024 20 hours ago, Baguettes said: I've gotta ask a little: Are you doing this for an item's damage, or a character's damage? Combat component is for characters, Weapon component is, well, for weapons. also, that function does not exist; use ...combat:SetDefaultDamage(number) instead of ...combat:SetDamage(). (edit: it exists on weapon, but not combat component.) I'm not actually sure if it's either, but the original script used "combat" so I'm assuming its for character. If that's the case, is "WP_DAMAGE" correct if it's not a weapon? Ok so it's not crashing anymore but now it does not deal any damage. The script doesn't indicate it's for a weapon so is "WP_DAMAGE" even right for this? Link to comment https://forums.kleientertainment.com/forums/topic/159548-want-to-make-a-damage-configuration/#findComment-1746576 Share on other sites More sharing options...
Haruhi Kawaii Posted September 10, 2024 Share Posted September 10, 2024 On 9/9/2024 at 1:15 AM, JaccK1618 said: I'm not actually sure if it's either, but the original script used "combat" so I'm assuming its for character. If that's the case, is "WP_DAMAGE" correct if it's not a weapon? Ok so it's not crashing anymore but now it does not deal any damage. The script doesn't indicate it's for a weapon so is "WP_DAMAGE" even right for this? WP_DAMAGE is just an example, you can use another name, it must be unique, avoid overlapping with other names If you use TUNING.WP_DAMAGE, try the in-game console and paste this print(TUNING.WP_DAMAGE) if your configuration is correct you will see the value of TUNING.WP_DAMAGE, attach your code here if it still doesn't work Link to comment https://forums.kleientertainment.com/forums/topic/159548-want-to-make-a-damage-configuration/#findComment-1746860 Share on other sites More sharing options...
JaccK1618 Posted September 10, 2024 Author Share Posted September 10, 2024 Alright I figured it out. I had the variable in the configuration set to "Damage" but the MODMAIN one "damage" Link to comment https://forums.kleientertainment.com/forums/topic/159548-want-to-make-a-damage-configuration/#findComment-1746992 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