Jump to content

ReelBigFan

Members
  • Posts

    5
  • Joined

  • Last visited

Nexus Mods Profile

About ReelBigFan

ReelBigFan's Achievements

Rookie

Rookie (2/14)

0

Reputation

  1. That worked like a charm! I feel silly now; that was like the one thing I didn't think to try . This is the second time you've come to the rescue and helped me with my amateur scripting, and I can't thank you enough. I greatly appreciate all your help!
  2. I've been in the process of making tweaks to my mod The Gharen Hammer (shameless plug, I know) but I'm having some trouble getting part of a script to work. It's an object script attached to an misc item that when activated moves a piece of furniture (an anvil) in front of the player and then removes itself from the players inventory. The actual script is pretty simple with two blocks; a Begin OnEquip and a Begin GameMode. The GameMode block simply calls the anvil moving function and then removes the item from the player's inventory and does the job. The problem is the OnEquip block which is supposed to check if the player is in the air/jumping, and display a message confirming/deny the anvil was placed depending on if the player is on the ground or not, then close the inventory and return to the game. The fall check works great, but I cannot figure out how to get both the MessageBox function and the CloseAllMenus function to work together. I've tried re-writing this block and experimenting with all sorts of things to try to get both to work, but I can either get the messages to display, but the inventory wont close, or no MessageBox appears but the inventory closes out correctly. I'm pretty stumped and I would love some input as to how I can get this working as intended. Here is a sample of my script: int iCanMove int iMenuOption int iButtonpressed Begin onEquip if (player.IsInAir == 0) && (player.IsJumping == 0) set iCanMove to 1 MessageBoxEx "You set the Mithas Anvil.|Okay" set iMenuOption to 1 if iMenuOption == 1 set iButtonpressed to getbuttonpressed if iButtonpressed > -1 if iButtonpressed == 0 set iMenuOption to 0 endif endif endif else MessageBoxEx "You cannot set the Mithas Anvil at this time.|Okay" set iMenuOption to 1 if iMenuOption == 1 set iButtonpressed to getbuttonpressed if iButtonpressed > -1 if iButtonpressed == 0 set iMenuOption to 0 endif endif endif endif CloseAllMenus End I've tried putting the CloseAllMenu function in an if statement like this and in its on MenuMode block, but it was a bust: ... if iButtonpressed == 0 set iMenuOption to 0 set iCanClose to 1 endif endif endif endif if iCanClose == 1 CloseAllMenus set iCanClose to 0 endif End If anyone has any ideas as to how to make this work or can explain what I'm doing wrong it would be greatly appreciated. Thanks in advance to anyone who takes the time to look at this!
  3. Actually figured it all out last night just a little after posting my comment. Turns out it was another simple error caused by my own carelessness. I needed to restructure my if/elseif order to make the checks. Its very inelegant right now, and I'll probably try to tweak it, but as of now I can say I have a fully functional mod! Working on a second version now to expand on it and integrate it into the game a little better. Trying to have the full version done in a few days and I'll share that and the simple versions together, hopefully can get some feedback then. Again, thanks for all the suggestions!
  4. I appreciate the advice! I figured out why onEquip wasn't working for me (embarrassing to say I had spent a whole day looking for solutions when all it was just some mixed up some variables that broke the whole code lol). I had not considered how making so many clones would be bloating the save though so thanks for the heads up on that RomanR! Now I've got most of the mod working in a way I'm pretty happy with. There's just two things I'm having trouble with figuring out; 1st is figuring out how to check that the player actually has a weapon equipped and isn't bare-fisted. Right now the misc item i have set will just be duplicated when you try to upgrade without a weapon in hand. 2nd is getting the isQuesttem function to work. For whatever reason I cannot get it to properly see if a weapon is a quest item or not to reject for upgrading. I appreciate any additional advice on how I might solve these two issues. If I can get these solved I think I'll have everything pretty solid.
  5. I've recently been dabbling with creating my own mods for Oblivion with the CSE, starting with real simple things like adding objects to the game words and fixing minor conflicts with my installed mods. I've done some coding (mostly Python) and built some decently complex stuff on my own so I figured I'd try my hand at some scripting and create a more functional mod. Unfortunately I'm running into a major road block with the mod I'm looking to create. Before I explain the problem, the basic idea behind the mod is to add an item that when activated from the inventory will take the players equipped weapon, make a copy of it, add some amount to the base damage of the copy, remove some amount of gold from the player, remove and replace the original weapon with the copy. I know that this will likely cause some issues with quest items if I can get this to even work, but thats all fine for now. I'm not worried about making the mod perfectly functional, just functional enough for now lol. At this point I can get this intended item to spawn in my inventory with a simple quest script, but I'm at a loss how to get my object script to work when I click the item in my menu. I know from other mods that there is definitely a way to add functionality to misc items, but even digging through mods I know do this and using google I can't seem to find anything that points me in the right direction. Any advice on how this is done would be greatly appreciated! Here is my object script incase this helps scriptName MithasHammerTest Ref equippedWeaponRef upgradedWeaponint currentDamageint upgradeDamage Begin onActivate let equippedWeapon := PlayerRef.GetEquippedObject 16 set equippedWeapon to CloneForm upgradedWeapon set currentDamage to upgradedWeapon.GetAttackDamage upgradedWeapon.SetAttackDamage currentDamage+1 player.UnequipItemSilent equippedWeapon player.removeitem equippedWeapon 1 player.additem upgradedWeapon 1 player.EquipItemSilent upgradedWeapon Message "Test:Activated", 5end
×
×
  • Create New...