Jump to content

Mornedil

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by Mornedil

  1. How do you properly add items to a merchant's container using papyrus scripts? What I've tried so far: I've made a script to add items to the vendor's container (and they show up when searching the chest), but as soon as I ask the vendor what's for sale, his inventory updates and the vendor's chest respawns without the added items. I've seen posts where people say you can add items to vendors like that, but it doesn't seem to work as expected. I've also read about the method to add items to LeveledItem lists with the AddForm function. However, it's hard to fully control the odds of the item appearing in the vendors stock like that, and not to mention this will add items to ALL vendors using that LeveledItem list.
  2. I'm using it together with this code example to display a notification when the mod version updates, so I think a message might annoy the player I decided to multiply the decimal by 100 and turn it into an int, and it worked :smile: I might as well share the code, since it could be useful for any mod displaying the version number: Function ShowVersion(float fVersion) int whole = Math.Floor(fVersion) int decimal = Math.Floor((fVersion - whole) * 100) If( decimal < 10 ) Debug.Notification("MOD NAME version " + whole+".0"+decimal + " installed") Else Debug.Notification("MOD NAME version " + whole+"."+decimal + " installed") EndIf EndFunctionEDIT: Sorry cdcooley, I didn't see your anwer before I experimented it out myself, I was updating the previous page for replies. thanks though! I learned a lot from your post, it's a more versatile way of doing it that can be re-used for different things as well :>
  3. I've made tons of textures for the Source engine, and I highly recommend this page for reference on different texture formats. I'm not sure if Skyrim supports all of those formats since I've never made a Skyrim texture, but that page is still useful for better understanding the difference. For example: DXT1: use this format for typical textures with no alpha channel.DXT3: use this format for typical textures with an alpha channel with sharp gradients.DXT5: use this format for typical textures with an alpha channel with smooth gradients. Then there are the BGR888 and BGRA8888 formats, which produce high-quality textures, but with huge file size. If they are even available for Skyrim, they should probably rarely (to never) be used on regular textures considering the game's medieval setting (meaning that irregularities in DXT textures caused by compression can easily be mistaken by the player as natural dirt, or not be noticed at all)
  4. How do I concatenate a float into a string and only displaying 2 decimal points? For example: float pi = 3.14 Debug.Notification("Pi is equal to " + pi)And then rather than the string outputting "Pi is equal to 3.1400000" it would only be "Pi is equal to 3.14"
  5. hmm, I think it's the follower who gets into the favor state, and there's no similar "isAskingForFavor" Only place I can think to look now is if there's maybe an actor value controlling it? Gonna search through it and hope for the best Edit: Well there's a "FavorActive" actor value listed under unused/obsolete, but I tried it anyway without luck
  6. I have googled like crazy and haven't found anything pointing towards that either, so I'll stick to using a property. Kinda ironic though - Object oriented programming without being able to reference the object the script is placed on :laugh:
  7. It does not seem to prevent it, I have "GetIsID Actor: Player == 1.00" as a conditional function for the perk owner on both perk entries.
  8. Thanks! I'll probably go with the TES5Edit method. Should be easy to lookup the correct path by searching in the creation kit. copy-pasting file paths does not seem to work, the box which displays a model's file path is grayed out in the editor. In the conditional function of a perk entry point, attached to the player. If you remember the 2 choice menu you helped me set up when activating an enchantment table :> I need to also to add conditional statements to those "activate" entry points. I found out that if you are in the "follower command mode", you can actually activate the choice popup menu from a distance when telling the follower to use the enchanting table (which makes you teleport to it instead). So I figured I'd have to add a conditional function to the entry points to prevent that.
  9. Thanks! I thought I had caused some error, did not expect to have to edit an ini file to load an official game expansion Isn't there a way to reference the item running the script somehow? The removed item will always be the item the script is attached to. So I thought adding a property would be an extra unnecessary step when making more duplicates of the object, if it was somehow possible to look up the item the code is running on.
  10. For some reason Creation Kit crashes while loading the Hearthfire master file, so can't take a look at that drafting table. But somehow using the GetItemCount condition solved it! Thanks mate Haha but the temporary item running the script is stuck in the inventory now. I've tried self.Delete() and Game.GetPlayer().RemoveItem(Self, 1, true), but the temporary item is still in the inventory.
  11. I have one more question related to this: I have "fake disenchanting" recipes (basically a recipe which sets a global variable to 1). And I have conditional statements to only allow another recipe if the global variable has been set to 1. However, in order for the new recipe to appear on the workbench, I have to press Tab to exit and then press E on the workbench again. Is there a way to "refresh" the recipes that appear on the crafting menu while you're in it? Or maybe closing then quickly re-opening the menu? (which might refresh it)
  12. What conditional statement should I use to detect if a player is currently giving commands to their follower? (the "command mode" you enter after you hold E on them or tell them "I need you to do something"). And anothe question: How the heck do you change the model for an item (in this case a misc item) into another default model. This bugs me to no end, the "model" field is grayed out and the only way seem to be to browse for a custom model. What bugs me even more is that when googling about it, all the results are asking about custom models rather than changing to another default model.
  13. Sorry my bad, I didn't fully understand what you meant then,, it took some experimenting to figure it out. Now I finally have 2 options, one of them starts the vanilla enchantment feature, and the other activates a custom event that for now only shows a test notification. I think I'll be able to figure out the rest, but otherwise I will update this thread. Thanks for all the help :>
  14. Thanks, that's a start. Found the right section in the script while searching for "PlaceAtMe"! I think I found something interesting related to the activation choice. In the perk itself (searching "glittering" in the creation kit), it has an Entry Point with the settings "Activate" and "Add activate choice". Hopefully it will lead me towards adding a new option to the enchant table
  15. Found the script sources, but to be honest SPERG is way too heavyweight to find the functions I'm looking for. It feels like finding a needle in a haystack. And this is all the code for the crafting station in the Throwing Weapons Lite mod: Scriptname PRKF_000_JZBai_CraftingPerk_030FA3FA Extends Perk Hidden Function Fragment_0(ObjectReference akTargetRef, Actor akActor) CraftingStation.Activate(Game.GetPlayer()) EndFunction ObjectReference Property CraftingStation Auto But since that mod instantly crashes the creation kit, I can't see how it's used.
  16. Thank you, I will check it out Edit: Well.. Throwing Weapons Lite crashes the Creation Kit, and the "edit script source" button is grayed out for the SPERG scripts. Edit2: Found script sources, they were placed in a different location
  17. I've figured out where to place the script now, so the big problem now is how to change the "Bench Type" of the enchanting table depending on a popup message with 2 choices. The Furniture Script section of the wiki is completely empty of functions.
  18. I'm trying to use the existing enchanting table and turn it into an item crafting station. But I obviously don't want to mess with the enchanting feature, so my idea is that when the player presses E on the enchanting table, they're given a choice to either enchant normally or craft items. I figure the steps of achieving this would be something like: 1. check if player activates an enchanting workbench 2. cancel the enchantment workshop/crafting menu so it doesn't appear 3. Display a simple message with 2 options to choose from 4. depending on choice, either re-activate the normal enchantment menu or activate a custom crafting station menu But I have no idea which events and functions to use, or where to place the script. Any ideas where to start? I've tried using the OnPlayerUseWorkBench event to check if a player uses the workbench, but it doesn't seem to work Edit: scratch that, that was the wrong event. The OnSit event worked. But I still need to figure out how to cancel the furniture's default workbench type and give the choice to the player to use a different one.
  19. Is it possible to add something other than weapons and armor to an enchanting table? Like charging a roll of paper (misc item) with a soul gem to make a scroll. I realize this can be done at other crafting tables with crafting recipes, but I want the feature where you can use different sized soul gems to adjust power/charges or the created item.
  20. I must be on a different Magic Effect page, because it's not here. This (Category:Papyrus) is the page I use for script reference (and when clicking "next page" at the bottom) and it's not there either. As he said it is listed on the Magic Effect page. More specifically, the Magic Effect Script page. There has not been a page set up for the specific function as of yet, but it is listed on the script that SKSE added the function to. Wow, that page is extremely useful and is going to solve some other problems I've had with spell effects as well. There are a lot of functions in there which I couldn't find on the papyrus category page.. Actually, I can't even figure out how to navigate to that specific page by just browsing the wiki. Is it listed on some parent page or something? I'm wondering what other pages of functions I might be missing out on.
  21. I must be on a different Magic Effect page, because it's not here. This (Category:Papyrus) is the page I use for script reference (and when clicking "next page" at the bottom) and it's not there either.
  22. How you can look at some of the utterly game-changing mods out there and declare modding limited because a single form value can't be changed on the fly without SKSE is simply bewildering to me. Sorry, my mistake, I simply meant that the creation kit as a tool is more limited than I expected in certain areas. But hey, with enough effort most games can be modded even without a creation kit. Thank you by the way! But where did you find that function? I'm using ctrl+F to search for script functions on the creation kit wiki (which seems to lists SKSE funcitons as well) but was unable to find that one.
  23. The only time I've encountered it in vanilla skyrim was with the vampire skills, and it was confusing and annoying. Point of modding is to make the game better, so if something is bad in vanilla we should aim to fix it! And 4 times per spell is way too often, you'll get to 100 resets like that with 25 different spells. I only started with modding a few days ago, and so far it seems more limited than I expected.. Like with this thing. I mean it's just one variable that can be between 0 and 100, there should be some way to alter it during gameplay.
  24. didn't seem to work. To be honest, I'm having trouble with conditional magic effects overall. The effect they have on enemies seem to work fine depending on conditions, but other things like what graphical effects are applied don't seem to care whether a condition is true or false. I can think of a few problems that would arise with that.. Like if the player have favorited or hotkeyed the previous spell, or even has it equipped.. It would be annoying if spells randomly "reset" like that and got removed from your favorites
  25. Any reason you can't just edit the perk directly? No no I'm talking about spells, not a perk. For example the vanilla spell Frostbite is displayed in-game as a "novice" skill level perk, which in the CK is determined by the "minimal skill level" value in the Magic Effect editor. I'm looking to modify that variable for a spell instead of creating multiple different spells with a different skill level value. It's always bothered me in the vanilla game that there are so many different spells that do pretty much the same thing (like calm and it's more powerful versions). My intention is to use only one spell and increase it's power as the player levels up. So a spell may start with 10 magnitude but eventually get a magnitude of 100. At that point it would look silly if the spell still says "novice" in-game.
×
×
  • Create New...