Lice23 Posted January 2, 2016 Share Posted January 2, 2016 So, I'm making a skyproc patch that edits the damage, weight, speed, etc. of every weapon by weapon type, however, since warhammers and battleaxes share the same type, I've reached a bit of an impasse. I'd like to know how I can compare the keywords of a weapon to find out if it's a warhammer or battleaxe, and then make my changes accordingly.Thanks a lot in advance!-Lice23 P.S. In case anybody needs my code, here it is: Mod patch = SPGlobal.getGlobalPatch(); Mod merger = new Mod(getName() + "Merger", false); merger.addAsOverrides(SPGlobal.getDB()); for (WEAP allWeapons : merger.getWeapons()){ WEAP.WeaponType wepType = allWeapons.getWeaponType(); switch (wepType) { case OneHSword: allWeapons.setDamage(14); allWeapons.setCritDamage(14); allWeapons.setReach(1); allWeapons.setSpeed(1); allWeapons.setStagger((float) 0.25); allWeapons.setWeight(allWeapons.getWeight()/2); patch.addRecord(allWeapons); break; case TwoHSword: allWeapons.setDamage(24); allWeapons.setCritDamage(24); allWeapons.setReach((float) 1.2); allWeapons.setSpeed(1); allWeapons.setStagger((float) 0.5); allWeapons.setWeight(allWeapons.getWeight()/2); patch.addRecord(allWeapons); break; case Dagger: allWeapons.setDamage(11); allWeapons.setCritDamage(22); allWeapons.setReach((float) 0.7); allWeapons.setSpeed((float) 1.3); allWeapons.setStagger(0); allWeapons.setWeight((float)((float) allWeapons.getWeight()/1.5)); patch.addRecord(allWeapons); break; case OneHAxe: allWeapons.setDamage(13); allWeapons.setCritDamage(13); allWeapons.setReach((float) 0.9); allWeapons.setSpeed(1); allWeapons.setStagger((float) 0.75); allWeapons.setWeight(allWeapons.getWeight()/2); patch.addRecord(allWeapons); break; case OneHBlunt: allWeapons.setDamage(12); allWeapons.setCritDamage(10); allWeapons.setReach((float) 0.85); allWeapons.setSpeed(1); allWeapons.setStagger((float) 0.9); allWeapons.setWeight(allWeapons.getWeight()/2); patch.addRecord(allWeapons); break; case TwoHBluntAxe: KeywordSet warhammerKeys = allWeapons.getKeywordSet(); } Link to comment Share on other sites More sharing options...
MichikoUnknownFox Posted January 2, 2016 Share Posted January 2, 2016 Yeah I'm stuck with that too lol. I think you're better off just ignoring WeaponType altogether (that seems to go by animation type; compare the GetWeaponAnimType condition function in the CreationKit) and reading from the keywords entirely. I'm still relearning the Java syntax so you can probably figure the actual syntax out faster than me. But here's my train of thought. 06d932 is the FormID of the WeapTypeBattleaxe keyword. FormID weaponBattleAxe = new FormID("06d932", "Skyrim.esm"); Then magic it into some kind of conditional statement where if weaponBattleAxe exists from the weapon's keyword list, do stuff, etc. This is the part I don't get yet though. Link to comment Share on other sites More sharing options...
Lice23 Posted March 1, 2016 Author Share Posted March 1, 2016 Right, well, It's been a long time since I started this, but I've finally been able to separate the two. For some reason, SkyProc throws an "Error while editing records", but I've yet to find out what's wrong. Anyway, this is what I did for it to search for the battleaxe keyword: FormID battleAxeKey = new FormID("06d932", "Skyrim.esm"); KeywordSet currentKeys = allWeapons.getKeywordSet(); ArrayList<FormID> keylist = currentKeys.getKeywordRefs(); if (keylist.contains(battleAxeKey)){ (commands) } Link to comment Share on other sites More sharing options...
Recommended Posts