OvadWolfeye Posted January 18, 2021 Share Posted January 18, 2021 (edited) scn OvadBowScript short active short Igot short Iwant short Ineed Ref OvadArrow Begin OnEquip set active to 1 End Begin OnUnEquip set active to 0 End Begin GameMode If Active == 0 Endif If active == 1 If onkeydown 256 set Ovadarrow to player.getequippedobject 17 Else Return endif set Igot to Player.GetItemCount OvadArrow set Iwant to 2 If Igot == 1 || Igot < 1 set Ineed to Iwant - Igot player.additemNS OvadArrow Ineed endif endif end Begin MenuMode If Active == 0 Endif End So I am attempting to make a Bow that will have unlimited arrows. The arrows will be whatever arrows the player has equipped, allowing the bow to use any arrow in game. This portion works well and I was able to fix my original issue I had ( and posted in a wrong Forum ) of the script freezing when the bow was unequipped. Is there a variable that can be used to determine if the ammo slot is empty, like using the equipment slot bit assignments? Edited January 18, 2021 by CountryRoberts Link to comment Share on other sites More sharing options...
Pellape Posted January 18, 2021 Share Posted January 18, 2021 (edited) It is not working for the moment but maybe we should hint it to the xOBSE author that you need it?GetEquipmentSlot - The Elder Scrolls Construction Set Wiki Reserved values are currently nonfunctional and/or obsolete.reserved9 (weapon)10 (back weapon)11 (side weapon)12 (quiver) Edited January 18, 2021 by Pellape Link to comment Share on other sites More sharing options...
DrakeTheDragon Posted January 18, 2021 Share Posted January 18, 2021 Well, "GetEquipmentSlot" will only give the slot a specific object occupies, so that's not even what we need here. But "GetEquippedObject 17" should already return "0", if no ammo is equipped. This can very well be checked for. Link to comment Share on other sites More sharing options...
OvadWolfeye Posted January 18, 2021 Author Share Posted January 18, 2021 Thanks Guys. My thoughts were broadened and I changed the script to this: scn OvadBowScript short active short Igot short Iwant short Ineed Ref OvadArrow Ref HadArrow Begin OnEquip set Ovadarrow to player.getequippedobject 17 set active to 1 End Begin OnUnEquip set active to 0 End Begin GameMode If Active == 0 Endif If active == 1 If onkeydown 256 set Ovadarrow to player.getequippedobject 17 If OvadArrow == 0 If Player.getItemCount Arrow1Iron < 1 Player.additemNS Arrow1Iron 1 Endif Player.equipitemsilent Arrow1Iron set Ovadarrow to player.getequippedobject 17 Endif endif set Igot to Player.GetItemCount OvadArrow set Iwant to 2 If Igot == 1 || Igot < 1 set Ineed to Iwant - Igot player.additemNS OvadArrow Ineed endif endif end Begin MenuMode If Active == 0 Endif End I will be tweaking this script more for perfection but minus a small arrow count bug( which I will be working on repairing) we now have a working bow that can shoot unlimited arrows regardless if vanilla or from a custom mod. as soon as I perfect this bow the stealth boots, and learn the dialog stuff I will upload my mod upon completing it. Link to comment Share on other sites More sharing options...
Pellape Posted January 18, 2021 Share Posted January 18, 2021 Cool. :) One thought though... If Active == 0 Endif ...is unnecessary both in the GameMode and in the MenuMode. The only reason you would use that check is if you want to exit the script faster with: If Active == 0 return Endif Otherwise, I suggest you delete them and delete the MenuMode section completely as it should not be needed at all. Link to comment Share on other sites More sharing options...
OvadWolfeye Posted January 18, 2021 Author Share Posted January 18, 2021 Thanks Pellape :dance: I have done so, never stop helping folks like me, even if our questions seem dumb, for how else are we to learn. Link to comment Share on other sites More sharing options...
Pellape Posted January 18, 2021 Share Posted January 18, 2021 I am just happy that I am able to help, even if I do have a lot to learn myself and I do learn some really by trying to find solutions for others and sometimes I am all gone by the wind, out bicycling... It is also a good opportunity to get a break from tedious modding, that I am doing right now, editing 3D meshes. ;) Link to comment Share on other sites More sharing options...
OvadWolfeye Posted January 18, 2021 Author Share Posted January 18, 2021 The way you feel about your 3D meshes is how I feel with scripting at times( mostly when I think I have a great idea, but find out my knowledge base is insufficient for the set task, to the point that I have to search 6 hours worth of reading material because not knowing how to ask the question the correct way) but then I break down and post a question here and Pellape ( and others your not unloved, thats right DrakeThe Dragon, Mixxa77, and QQuiz I am calling yall out for the awesome help ya'll have been giving me) and I start to make progress again. CS gets more action on my PC then the actual game does right now lol. Link to comment Share on other sites More sharing options...
Pellape Posted January 18, 2021 Share Posted January 18, 2021 Same here. I try to divide it equal though, so I try to stop when the half evening has passed and then I go in game, which I will do right now. :) Just shut down Blender... Link to comment Share on other sites More sharing options...
OvadWolfeye Posted January 18, 2021 Author Share Posted January 18, 2021 and another 3 frustrating hours later..................... Blender Shutsdown and gaming can begin. ( if your like me anyway) Link to comment Share on other sites More sharing options...
Recommended Posts