Jump to content

Coders; Is this possible?


jimmyThePipe

Recommended Posts

I'm making a new item that casts a constant Fortify spell and tweaks some of the Game Settings, for as long as the item is in the user's Inventory. That part is fine.

 

My problem is when I try to equip the item in the Inventory it says it's "Can't be Equipped". I want to trigger it to open one of the mini-game windows, like "Alchemy Mixer" or "Read Book". None of the other items (like Mortar & Pestle or random Book) appear to have a script triggering these actions, and I can't figure out how they do it. Is it possible to trigger those minigames?

Link to comment
Share on other sites

I think a lot of stuff is hard-coded into Oblivion itself and cannot be touched. I suspect there is not a "script" for doing alchemy or reading books. What type of item are you using? Is it something that can ordinarily be equipped? Or is it something like a fork or a plate that you cannot equip? I know that there are console codes to open the spellmaking and enchanting mini-games. I can open them, but then they don't work. It might be a Vista problem though. I doubt people would post console codes on the Internet that don't work.
Link to comment
Share on other sites

Ah, I was doing it wrong; I duplicated a Plate (from the Miscellaneous section), but I should've duplicated a Mortar (from the Alchemy section), because if it's in the wrong (Miscellaneous) section the game treats it like a Plate. I didn't think it mattered.

 

Now I'm 2 for 3: I can duplicate new Books and Alchemy objects, but not Repair Hammers because that's ONLY in the Miscellaneous section; any Hammer-duplicates are treated like Plates. There doesn't seem to be any Console command for the Repair minigame, or Script command to launch it either. I guess this is not doable.

Link to comment
Share on other sites

Ah, I was doing it wrong; I duplicated a Plate (from the Miscellaneous section), but I should've duplicated a Mortar (from the Alchemy section), because if it's in the wrong (Miscellaneous) section the game treats it like a Plate. I didn't think it mattered.

 

Now I'm 2 for 3: I can duplicate new Books and Alchemy objects, but not Repair Hammers because that's ONLY in the Miscellaneous section; any Hammer-duplicates are treated like Plates. There doesn't seem to be any Console command for the Repair minigame, or Script command to launch it either. I guess this is not doable.

Repair hammers, like lockpicks, are a hard coded item which is specifically designed to have a particular action tied with its usage.

 

The only way to simulate use of a repair hammer through another object is to use scripting that forces the player to equip a repair hammer in order to bring up the menu... In otherwords, something along the lines of;

 

scn MakesRepairMenuOpenFromAnythingSCRIPT001

short mnu
short hmcount
short hmcount2
short hmadd

begin onequip
set mnu to 1
set hmcount to player.getitemcount <realhammer id>
if hmcount < 1
Player.additem <realhammer id> 1
endif
player.equipitem <realhammer id>
end

Begin menumode
if mnu >= 1
if menumode == 1035
set mnu to 2
endif
elseif mnu == 2
set hmcount2 to player.getitemcount <realhammer id>
if hmcount2 < hmcount
set hmadd to (hmcount - hmcount2)
player.additem <realhammer id> hmadd
elseif hmcount2 > hmcount
set hmadd to (hmcount2 - hmcount)
player.removeitem <realhammer id> hmadd
endif
endif
end

 

Provided that you are trying to add a system where an item can be used that does not use up repair hammers. You will need to add in form IDs and make adjustments for how many hammers should be added within the onequip block if this is the case. You may also want to use a method of message supression to hide the adding/removing of items.

http://cs.elderscrolls.com/constwiki/index.php/Message_Spam

 

Unfortunately, there is nothing that can be done about the "you cannot equip this item" message since that appears before any script can run. The only way to get rid of that would be to alter the strings found in gamesettings, and that can cause some unwanted issues.

Link to comment
Share on other sites

Vagrant, the add-equip-remove method is what I ended up doing:

 

-In Game and Menumode it casts a "Fortify Armorer" spell while the item is in inventory.

-When the item is picked up it sets the Repair gamesettings to 0. This makes all hammers unbreakable ..

-.. and blanks the "You can't equip that" gamesetting.

-When the user tries to equip the item the message is quiet ..

-.. it adds a Repairhammer to the inventory and equips it.

-After the user leaves that menu the extra hammer is removed.

-When the item is dropped the game settings are restored to normal and the spell is unequipped.

-As long as this item is in inventory, all hammers are unbreakable; the game reasons that the user always uses the Skeleton Key for the Lockpick game, so I reason the user always uses this item for the Repair game.

 

It's still got a few hiccups but I'm happy with it sofar:

http://www.tesnexus.com/downloads/file.php?id=27706

Link to comment
Share on other sites

  • 14 years later...

Hi

I've managed to make an activator (anvil) with a script that opens the Repair menu (equipping a Repair hammer if there's some in inventory), 

now I need to know how to: disable the Repair menu by the Repair Hammer itself, but being still be able of call the menu on the activator.

I was thinking to attach a script to the Hammers , where if trying to equip it, inmediately close the menu, or that only works near of an anvil or something.

and include in the script of the activator a way to disable the script of the hammer.    Is it possible?   

Link to comment
Share on other sites

I changed it so you can exit the repair menu by pressing the tab key:

begin MenuMode 1035                            ; Repair / Ingredient Selection (Alchemy sub-menu)
    if IsKeyPressed3 15    ; TAB key
        ClickMenuButton "#2" 1035            ; Exit button
    endif
end

You could use that logic to just close the menu when you don't have a hammer.  It looks like it may also do that when you are in the alchemy sub-menu too.  I don't know if there is a way to tell the difference.

Edited by GamerRick
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...