cfh85 Posted June 1, 2016 Share Posted June 1, 2016 Couple of thoughts Firstly, if you don't want to change the weapon for every instance (which is why NPCs using the same weapon change when you do) you need to have a separate weapon. I would create 4 weapons (just copy any generic weapon) 1 of each blade/blunt 1h/2h. Use the script to add and equip the weapons, then modify their nif file, damage, speed etc to match what was equipped Secondly, modify the speed and damage of the weapons. 1h converted to 2h, increase speed and damage, to increase the maximum rate of damage. Opposite with 2h converted to 1h Use your script to remove any equipped shield. 1h to 2h remove it when you initially cast, 2h to 1h remove the shield when return it to it's original form. Also, have a second think about using a set key. You're opening yourself up to conflicts. I would probably use a spell.Work it something like this. Cast the spell > get message box > add the ability/ set key /remove ability > set the key will allow users to chose the key they want to use. Adding and removing the ability will change when you can use it - and stops scripts from running when not needed. Though you would want to return the weapon to normal before you remove the ability Link to comment Share on other sites More sharing options...
Manus812 Posted June 2, 2016 Author Share Posted June 2, 2016 (edited) I've decided that it is ok that NPC's changing grip when PC does if they are both using same weapon. It isnt a big issue. I dont want to make separate weapons in CS because I want this mod to work with any weapon from and mod. The first alpha of the script works via a spell. You cast the spell and it works, but spell casting is rather slow. (in combat) Which is why I opted to (for testing) bind the script to be activated with the arrow keys. For final release I will either implement an in-game way to bind the keys, or through an INI file (IDK how to make one though). If you want, I can upload the [working] alpha release if you want to see how it works currently. instructions will be on the mod page If you want me to upload it. EDIT: Also in regards to a shield. I dont exactly know how to have the script: Unequipped shield if one is equipped & re-equip shield if one was present. Edited June 2, 2016 by Manus812 Link to comment Share on other sites More sharing options...
Manus812 Posted June 3, 2016 Author Share Posted June 3, 2016 Secondly, modify the speed and damage of the weapons. 1h converted to 2h, increase speed and damage, to increase the maximum rate of damage. Opposite with 2h converted to 1h Use your script to remove any equipped shield. 1h to 2h remove it when you initially cast, 2h to 1h remove the shield when return it to it's original form. I already want to implement these features, I specifically said that this is what I wanted to accomplish. No offense, you telling me this won't help. I want to have these features, but have no idea how, hence me asking for help. No offense Link to comment Share on other sites More sharing options...
cfh85 Posted June 3, 2016 Share Posted June 3, 2016 to be honest, I think it would be just as easy to create the basic mod and let you make the changes you want. Link to comment Share on other sites More sharing options...
Manus812 Posted June 3, 2016 Author Share Posted June 3, 2016 (edited) That's what I'm trying to do!!! But I want to take it one step at a time. First I made it work via a spell --> next I want to make it work via a hotkey, --> then I want it to have extra features (removing shield / + or - Dam) Right now I'm focusing on making the script be activated via a hotkey. It is in its most basic form as of right now. So do yo have any scripting advice, or are you just going to keep telling me what I am already trying to do? Edited June 3, 2016 by Manus812 Link to comment Share on other sites More sharing options...
cfh85 Posted June 4, 2016 Share Posted June 4, 2016 okay, so when you say the script doesn't work, what exactly do you mean? Will it not compile? Which would make sense as you haven't set how it will start - probably want something along the lines of Begin GameMode, though I'm a little rusty. Also, what have you attached the script to?Still think you're making a mistake by editing the original weapon. It's ridiculous that everyone else using the weapon will change when you do, then you have the shield issue. It's easy enough to set the weapon to 1 hand or 2 hand, but removing shields for everyone using the weapon is more work. Also, you're possibly asking for problems if you start editing the speed, damage etc of the original weapon. If something goes wrong it's simple enough to change it back to either 1 or 2 handed, but restoring the original stats if they get messed up could pose a problem. Also, some things are not stored in the save data, other things are... If you post a script that works with key pressed, I can help you to make the mod into something that would be compatible with pretty much everything and do what you're asking - if you're willing to stop editing the base weapon Link to comment Share on other sites More sharing options...
Manus812 Posted June 5, 2016 Author Share Posted June 5, 2016 (edited) Here is the script that changes a 1hand blade to a 2hand blade. It works via a spell (lesser power) that is for now added via player.addspell [id] .You cast the spell and the grip changes. So how would I, instead of casting a spell, have it bound to a key. Scn GripChangerBladeOne begin ScriptEffectStart ref weapon short weapontype set weapon to player.GetEquippedObject 16 SetWeaponType 1 weapon end Edited June 5, 2016 by Manus812 Link to comment Share on other sites More sharing options...
cfh85 Posted June 5, 2016 Share Posted June 5, 2016 use begin Gamemode and attach the script to a quest. use iskeypressed... Link to comment Share on other sites More sharing options...
Manus812 Posted June 5, 2016 Author Share Posted June 5, 2016 (edited) So you are saying like this (208 is the DX scancode for the down arrow): If it is a quest script that activates on gamestartup, wouldn't it then be running always in the background causing lag? I already have one mod that someone helped me create that uses a quest script to uncapp the armor rating. It sometimes give low fps. Scn GripChangerBladeOne begin Gamemode iskeypressed2 208 ref weaponshort weapontypeset weapon to player.GetEquippedObject 16SetWeaponType 1 weapon end Edited June 6, 2016 by Manus812 Link to comment Share on other sites More sharing options...
cfh85 Posted June 6, 2016 Share Posted June 6, 2016 (edited) don't put your refs and shorts inside of begin/end blocks.Also, what checks do you have to decide if the weapon is currently 1h or 2h, and then change it as required.Is this the full script that you posted? I've created a script that should work as I described before. It doesn't change the speed or damage yet - easy part. For some reason my CS won't save it, though it isn't showing any errors. IF it is working all it needs is four new weapons and a questIt doesn't remove the original from the player, it just makes it non playable and weightless. The weapons that get added SHOULD be exact copies except for the value and I need to add in to copy over any scripts Important note with gamemode blocktypes, use return often. Also structure your scripts to keep the heaviest part at the end, hopefully after several returns, to stop it from being read when not needed. Those reducing lag. The Script below has four conditions1 - Key is pressed, but this is the first time the script has registered it in this instance - register that the key has been pressed - return2 - Key isn't pressed and has not been registered - do nothing - return3 - Key is pressed and has been registered - do nothing - return4 - Key is no longer being pressed but has been registered - now we do stuff. REMEMBER to unregister the keypress under the first three conditions we do very little other than returning, to stop the game from reading the rest. I probably should change it to put the most common of those conditions first, so it should be 2, 1, 3, 41 always has to come before 3 or we would never register the key being pressed Scriptname CFHCGQuestScript Short DoOnceShort KeyDownShort MyKeyShort WeaponTypeShort HealthShort EnchChargeShort SpeedShort ResistanceShort DamageShort ReachShort Weight Ref WeaponRef OriginalWeaponRef PoisonRef SheildRef Ench Begin GameModeSet MyKey to 208If (IsKeyPressed3 MyKey) && (Keydown == 0) Set KeyDown to 1ReturnElseIf (IsKeyPressed3 MyKey == 0) && (Keydown == 0)ReturnElseIf (IsKeyPressed3 MyKey) && (Keydown == 1)ReturnElseIf (IsKeyPressed3 MyKey == 0) && (Keydown == 1) && (DoOnce == 1)Player.RemoveItemNS CFHCG1hBlade, 99Player.RemoveItemNS CFHCG1hBlade, 99Player.RemoveItemNS CFHCG1hBlade, 99Player.RemoveItemNS CFHCG1hBlade, 99Set Health to (Player.GetEquippedCurrentHealth 16)Set Poison to Player.GetEquippedWeaponPoison)Set EnchCharge to Weapon.GetEnchantmentChargeOriginalWeapon.SetIsPlayable 1Set Sheild to (Player.GetEquippedObject 13)Player.UnequipItemNS SheildPlayer.EquipItemNS OriginalWeaponOriginalWeapon.SetWeight WeightPlayer.SetEquippedCurrentHealth Health, 16Player.SetEquippedWeaponPoison PoisonOriginalWeapon.SetEnchantmentCharge to ChargeSet DoOnce to 0Set KeyDown to 0ReturnElseIf (IsKeyPressed3 MyKey == 0) && (Keydown == 1) && (DoOnce == 0) Set OriginalWeapon to (Player.GetEquippedObject 16)Set WeaponType to (GetWeaponType OriginalWeapon)If (WeaponType == 4) || (WeaponType ==5) || (OriginalWeapon.IsWeapon == 0)ReturnElseSet Health to (Player.GetEquippedCurrentHealth 16)Set Poison to Player.GetEquippedCurrentPoisonSet EnchCharge to OriginalWeapon.GetEnchantmentChargeSet Speed to OriginalWeapon.GetWeaponSpeedSet Ench to OriginalWeaon.GetEnchantmentSet Resistance to OriginalWeapon.GetIgnoresResistanceSet Damage to OriginalWeapon.GetAttackDamageSet Reach to OriginalWeapon.GetWeaponReachSet Weight to OriginalWeapon.GetWeightSet Sheild to (Player.GetEquippedObject 13)Player.UnequipItemNS SheildIf (WeaponType == 1) ;If 1hBlade add 2hBladePlayer.AddItemNS CFHCG2hBlade, 1Player.EquipItemNS CFH2hBladeElseIf (WeaponType == 2) ;If 2hBlade add 1hBladePlayer.AddItemNS CFHCG1hBlade, 1Player.EquipItemNS CFH1hBladeElseIf (WeaponType == 3) ;If 1hBlunt add 2hBluntPlayer.AddItemNS CFHCG2hBlunt, 1Player.EquipItemNS CFH2hBluntElseIf (WeaponType == 4) ;If 2hBlunt add1hBluntPlayer.AddItemNS CFHCG1hBlunt, 1Player.EquipItemNS CFH1hBluntEndIfOriginalWeapon.SetIsPlayable 0OriginalWeapon.SetWeight 0Set Weapon to (Player.GetEquippedObject 16)Player.SetEquippedCurrentHealth Health, 16Player.SetEquippedWeaponPoison PoisonWeapon.SetWeaponSpeed SpeedWeapon.SetEnchantment EnchWeapon.SetIgnoresResistance ResistanceWeapon.SetAttackDamage DamageWeapon.SetWeaponReach ReachWeapon.SetWeight WeightWeapon.SetModelPath (OriginalWeapon.GetModelPath)EndIfSet DoOnce to 1Set KeyDown to 0EndIfEnd Even if you don't like the way I've done it, you should find several answers on how to do what you want in there. If you don't hear from me for a while it's because I'm on holiday. Keep trying and post your progress - Edited June 6, 2016 by cfh85 Link to comment Share on other sites More sharing options...
Recommended Posts