Jump to content

Search the Community

Showing results for tags 'coding'.

Found 24 results

  1. I know this is not the ideal place to post this, but I cannot find it anywhere else. Stackoverflow literally blocked the question because of its content, and it further punished me by NOT LETTING ME SEARCH FOR IT. Worthless garbage website. Now, when I was getting my programming degree, the professor did NOT talk efficiency with us. You've noticed all the complaints about people making highly inefficient spaghetti code? The reason for that is so that if an employer needs your code tweaked, they'll probably have to call you to do it rather than hiring someone else. Seriously. Because of this, our professor literally encouraged us to make spaghetti code, and even screw around making programs to come up with our own distinct style to further ensure our codes would be impossible for another to decipher. Point is, I know nothing about what makes code efficient. I've heard you should minimize if-then statements, but I've found them hard to avoid. Even if I do find an alternative, I have no clue if its actually better or not. Just for an example, let's say you're making a card game, where the cards can have all manner of effects. I've come up with two different ways to handle this. One is to use a chain of if-then statements (no else statements since cards can have more than one effect), that check to see which ability a played card has one by one and executes the appropriate lines of code. Another way would be to just have cards have variables indicating such things like how many cards you should draw or how much damage the card deals, among many other things. When a card is played, the program then goes through every possible affect executing them one by one with few if any if-then statements (I figured some things may still require an if-then statement; why have the player chose a target when the card has no ability that needs a target?). Here, literally every line will execute, while with the solution that involves if-then statements, every if-then statement will be tested by only one or two of them will have their conditions meant. So, which would be better? I have no idea. I do not know the execution time of any command. I can often come up with half a dozen different ways of doing things but I have no clue which is better. What I need is a list that orders all the possible commands in every language I know based on efficiency. I thought about making this myself, but I can't find anyway to assign the system clock to a variable so I could make such a test program. What constitutes 'better'? I know I can minimize the number of lines, but I've found that often makes highly convoluted code. Besides, is it really better? If you have 100 print statements, would it be more efficient or not to just have a for-loop iterate 100 times? That would reduce the lines, but would that really be more efficient? I have no clue. I know nothing about this. The internet doesn't seem to want you to know this either. Wtf? If I could only pull the system clock, I could find this on my own. I could do something like a=system clock line of code b=system clock print(type of code, b-a) That's all I want, but I cannot get that. I think I could do this in c++, but that obviously won't help me with pygame. Why am I not allowed to know this? Why? How can I possibly find it? Is it just forbidden to make efficient code? Why then do you get trolled all the time for it? What types of commands are more efficient than others? I have absolutely no idea.
  2. So im fairly new to coding in general, basically just dabbled in it if i needed something done via googling, but not really profficient in any sense like i understand some terms and lines depending on the program, just not how to put them together to make anything useful atm xD So i have a couple of questions, 1.Where would i look if i was after guides on how to specifically make scripthooks for games? becuase googling basically just comes up with GTA stuff and "guide"just sends me to installing a script hook someone else made :/ and coding is a vast plethora of languages and i am one confused cookie. 2. for anyone whos made one, if im fresh to coding would it even be feasable or likley that ide be able to make or even update an existing script hook? without learning a ton of extra things about coding (like i just want to specialise in this one thing atm for what i want to get done) Any help would be super appreciated! :D
  3. I have an npc mod that I am interested in but it conflicts with another mod because of the npc house location. Is there anywhere in Nexus I can go to for help coding the house elsewhere to work with the other mod? Like hiring them to change the location. ONLY FOR PERSONAL USE! I just personally would love to have both if that is at all possible. The ones in question are SVE with the Eugene (translated English) mods. I know very little about coding and have no idea how to do it myself and would appreciate any help. Thank you
  4. Hello all my first time posting on forums I think probably every, but I am currently trying to better understand coding I had tinkering with it when I was younger then never came back to it, my question is does any one have any advice I am wanting to start getting familiar with papyrus any tips would be greatly appreciated I am also doing the free cs50x course thing online its a bit overwhelming so any advice would be
  5. Is there a way to change how many bolts can be fired from the crossbow before reloading (Like I want to change from 1 or 2 to 5) Can it be done by editing vanilla scripts or can it be changed in the Combat Skills script which I use? ( https://www.nexusmods.com/witcher3/mods/5312) I've seen mods for fully auto or infinite shots but I wanted something a little more grounded (And similar to the repeating crossbow Guts from Berserk carries) Would greatly appreciate any help with this! Thanks!
  6. Coming to the forums after two days of failed attempts. *sigh* Can anyone tell me how to change the default unarmed attack damage? Preferrably without using a "spell". Would prefer a passive or status. BIIIIIG Hiccup when trying to code a monk....lolz
  7. Hey hey everyone, I'm new to the BG3 modding scene and have been tirelessly experimenting and testing for the last two days. I have some background in blender and managed to make small edits in faces, like noses, eyes, shape of chin or cheeks etc. I've also managed (after a long time trying) to integrate them in the game and they're working fine. However when I tried to, let's say, edit a vanilla hairstyle to give it bigger curls, I always end up in trouble. Be it messed up textures or a bald head. I tried using existing hair mods and to compare and edit all the different lsx files in notepad++. But I can't get it working. Since the full release is not that long ago I didn't find many tutorials yet. I was wondering if any of you more experienced modders have any tips and tricks for me, or would be so lovely to make a custom hairstyle template so I could tinker some more? I'm a bit stuck now. Thanks! :)
  8. I want a gameplay mechanic mod that is sorely overdue: restricting the use of certain weapons whether you're in or out of power armor. Weapons that you could only use while in power armor would obviously be heavy weaponry: minigun, Gatling laser, broadsider, etc. (Missile launcher would have to be the exception). This would also include the "assault rifle" , since it was created for the purpose of being a weapon solely used with power armor, but that idea was scrapped. The concept of other weapons (specifically pistol-and-rifle-sized firearms) not usable while IN power armor would also apply, since power armor fingers would be too big to access the trigger. Laser/Plasma weapons might be exempt from this, but you'd just have to shrink the viewmodels down while in power armor so it doesn't look weird. This could be applied to weapons by either their weight, if they're over 25 wg, or weapon class (if the latter even exists in the game's code). It could also just be a simple checkmark system; anything that could be applied to modded weapons. And maybe extend this idea to small and large melee weapons, idk. This is optional, but you could make the Gatling laser equipable . It just needs to inflict more recoil. As for making small arms equipable, I'd add a weapon attachment that removes the trigger guard, but it's preferable to have that coincide with another mod idea I have, which is essentially a more in-depth version of durability. Although that might suit Hardcore playthroughs more than normal ones. This idea has been overdue for a LONG while, and imo it should have been a mechanic in the game to begin with.
  9. I made an NPC with the following script: Begin DisabledNPCScript short done if (done==0) disable set done to 1 endif End DisabledNPCScriptThen I made a door, which, once activated, will enable the NPC. I gave it the following script: Begin EnableDisabledNPC short done if (done==1) return endif if ( OnActivate == 1 ) DisabledNPC->Enable Activate endif End EnableDisabledNPCThe game complains about the "EXPRESSION" and "Right Eval" which means that "OnActivate" is an incorrect expression and that it's also not defined in the script. What am I supposed to define it as? It's neither a short, nor a float. Or is OnActivate simply just broken? Help!
  10. As part of trying to create the mod idea I posted here, I need to replace armors with better versions as they are improved, and at different rates than the default improvement. How does Skyrim handle the armor you improve at the workbench? Does it modify the armor you have? Or replace it with a new set with better stats? In other words, could the FormID of the armor that you receive be different from the FormID of the armor you input?
  11. The intention is to have the script detect if the weapon has a scope, then set the mouse sensitivity to a preset amount if == 1. Now, this does work, HOWEVER, it also returns items that do not have scopes but COULD have scopes ie the Varmint Rifle. Code follows: if getweaponhasscope MyWeap == 1 ;Check if weapon has scope if iscontrolpressed 6 == 1 ;Check if zooming if SetMS == 0 set BaseMS to getnumericinisetting "fMouseSensitivity:Controls" ;Store base mouse sensitivity setnumericinisetting "fMouseSensitivity:Controls" ScopeMS set SetMS to 1 endif else if SetMS == 1 setnumericinisetting "fMouseSensitivity:Controls" BaseMS set SetMS to 0 endif endif endif If anyone could let me know how I can detect if an item currently has a scope, that would be much appreciated.
  12. Okay, I tried doing this before for Oblivion. Unfortunately, I lost interest since I already had a working glow mod out, it wasn't working real well, and it just wasn't worth it with Skyrim coming out. Well, now Skyrim is out! Now I'm vying to make this mod a reality. What is it I want to do: I need a code that checks the weapon/armor to see if it has an enchantment. If it does, the code would tell the game to add text to the end of the mesh file "_glow." It will check to make sure the file actually exists, and if it does, it will switch what nif mesh the weapon/armor will use to the one with _glow at the end of it. Such mesh will have it's Alpha Channel all the way up. If it doesn't have an enchantment, or if the mesh with _glow at the end of it doesn't exist, it will use the default mesh without the Alpha channel all the way up so the glow map does not show up. The effect: All enchanted equipment will have a dynamic glow that will enhance the look of enchanted equipment, while keeping non enchanted equipment looking pretty average. It will help improve immersion by making you actualy feel like you've infused your equipment with magic. I've done glow maps before. I have this mod called "Vibrant Glowing Armor" for Oblivion. It replaces stock equipment textures with new glow maps that give them a unique glow style depending on their importance. http://www.nexusmods.com/oblivion/mods/33951/?tab=1&navtag=http%3A%2F%2Fwww.nexusmods.com%2Foblivion%2Fajax%2Fmoddescription%2F%3Fid%3D33951%26preview%3D&pUp=1 It's not all that involved, there's no coding or dynamics with it. This time around, I really want the glow maps to have a purpose and really improve your skyrim experience. Edit: Alright, I've clarified exacly how I'd like to see this code work. Check the "What is it I want to do" line for the clarification.
  13. I didn't explain this the best in the title, but basically what I want to do is make is so that there is an enemy you have to defeat which is essential, and after "killing" them which is when they go into that kneeling sort of position that they will become unaggressive, talk-able to, and be able to talk to them and ask them questions, before eventually saying "Time for you to die" and then being able to kill them, all while having the NPC stay on the ground. This is what I have been trying to do: I have added a script to the NPC which is as follows: Event OnDying(Actor akKiller) rsbioreeseproperty.SetObjectiveDisplayed(40)rsbioreeseproperty.SetStage(40)EndEvent I used OnDying in place of OnDeath, but it seems to work identical to OnDeath, and doesn't trigger when you defeat an essential NPC. (rsbioreeseproperty is the name of the property which is linking to the quest) The reason I did this is that so for stage 40 I could make it so that the NPC would be set to stop attacking (not sure how I would do that, I did experiment with making them an ally by adding them to a faction, but got nowhere), and stop the NPC from regenerating health and getting back up, allowing the player to talk to them and initiate the dialogue which would allow the player to kill the npc. (I've considered using "NPCNAME.SetNoBleedoutRecovery(true)" as a way to stop them from not getting up, I'm not sure if this works or not, or if it's even remotely correct). Using "akspeaker.GetActorBase().SetEssential(false)" to make them unessential after saying a piece of dialogue, which is working. I'm not sure if I'm going about this the right way, am I pretty new to the creation kit and papyrus coding, and most of this is just me guessing and trying to use and piece together other parts of the code to create a working code that does what I need it to. I don't mind how I can get this to work, as long as I get the end result that I want then I am satisfied, so if I am going about this the completely wrong way, please tell me a completely different method of completing what I am attempting to do here if it is necessary to do so. One more thing to note, not sure if this matters or not, but before he attacks you there is a forcegreeting dialogue which leads to the player saying something making him attack you. This works perfectly fine and does not run more than once, so it shouldn't be an issue, but in case that in some way would be I figured to mention it.
  14. I'm making a companion that can cut the player's hair at any time and the coding is being fussy. I placed the script to run fragment on end. http://www.creationkit.com/fallout4/index.php?title=ShowRaceMenu_-_Game Game.ShowRaceMenu() DOES work but not exactly what I want. I need just the barber / haircut menu, not the whole menu. It says I need to use Game.ShowRaceMenu(uiMode = 2) but nothing happens in game with that code. The dialogue just ends. I've been messing around with it for a while and not sure why it's not working. I even tried Game.ShowRaceMenu(akMenuTarget = PlayerRef, uiMode = 2) and nothing happened. Also using just Game.ShowRaceMenu() doesn't change the camera at all which makes it so you can't see the front of the player, which I figure is going to be a problem either way. Is there a code that can make the camera face the front of the player until they are done changing their character?
  15. Is there a workaround to use scripts to say Shared Dialogue? or another way to have an NPC say a shared dialogue response at will?. *Edit* Nm, figured out somthing that works for me
  16. Hello! Im making a mod, (or at least trying to) And I would like the mod to turn the player into a Wraith (using Ethereal FX) when crouched. I know I need to write a script for this, But I have no idea what I'm doing. Here's what I have so far Event OnInit() If Game.Getplayer().IsSneaking() WraithBind.Cast(Game.GetPlayer()) endIf EndEvent "Wraith Bind" Is the name of the spell I created with the effects. yet, The magic effect itself still needs the code so this only happens while sneaking. I have it so when I equip the ring It turns me Ethereal ALLL the time. Not only when I'm sneaking. Thanks so much for any help. And keep in note, I'm a beginner. Thanks again!!! (Yes I did post the same thing on reddit, I nEeD sOmE hElP)
  17. I am a little rusty on my coding language, but I have to ask. What is the code language to the scripts in Fallout New Vegas?
  18. I'm trying to simulate a 1st person view in 3rd person and to be able to avoid clipping I have to script a different camera position for the sighted aiming animation, I figured out that SetINIFloat doesn't work when continuously being called by the script, it just makes it default to a certain position other than the one I set it to, it only applies when I release the aiming button so I had to make a discrete execution of the function, I found the GetINIFloat function in the ck wiki but it gives me and error when compiles, I'm no papyrus expert so bear with me, here is my code: Scriptname aim_script extends Quest Event OnQuestInit() RegisterForAnimationEvent(game.GetPlayer(), "sightedStateEnter") endEvent Event OnAnimationEvent(ObjectReference akSource, string asEventName) if(Utility.GetINIFloat("fOverShoulderCombatPosZ:Camera") != 30 && Utility.GetINIFloat("fOverShoulderCombatPosY:Camera") != 30) if (asEventName == "sightedStateEnter") Utility.SetINIFloat("fOverShoulderCombatPosZ:Camera", 30.0) Utility.SetINIFloat("fOverShoulderCombatPosY:Camera", 30.0) endif endif endEvent the compiler returns these errors: GetINIFloat is not a function or does not existcannot call the member function GetINIFloat alone or on a type, must call it on a variablecannot compare a void to a int (cast missing or types unrelated)
  19. I'd like to have a program that will preform the identical functions of the creation kit but without any of the Bethesda copyrights attached. A creation kit made completely from scratch, which edits the files of a different program other then skyrim. A program with no bethesda copyrights that is nothing but an opening menu, and whatever is the minimum number of cells needed to be rendered at the start of the game. No objects, no actors, no NPC's just the player, a single flat landscape covering a single cell that the player is occupying or the minimum amount of landscape needed and the load and start menu to reach that point plus the "creation kit" program that then edits that program so I can build the map, the world spaces, interiors, and import the npc's objects actors myself. Is there a GNU licenced open source user frendly 3d rendering game engine that exists already that someone can recommend that might fit this description, one which is similiar to the fallout geck/skyrim creation kit? How difficult, costly and how much time would it take to build such a program?
  20. So I've been trying to port a helmet into bannerlord the last couple days, I got it into the editor and I've made the necessary files for it, but whenever I load up the game to try and see if I got it in there it crashes. Not sure if I got the code wrong or what, but here's the file; http://www.mediafire.com/file/di0pjyqf0iz6icy/LorItems.rar/file
  21. Hey clutter aficionados! Skyblivion's Interior Department is undertaking a major push on the claim sheet, and are seeking to max out their numbers! Their mission is to gentrify the Oblivion interiors, updating these familiar decade-old settings. They must provide a wonderlust environment for caves, fortresses, and ruins, while making houses, shops, and castles feel used and lived in. Their department works with a familial attitude, closely working with each other to provide a seamless experience between interiors. Applicates should also have an open mind and take constructive criticism. Ideally, anyone with proof of Creation Kit skill (any type of interior saved to an esp, shared on any free filesharing site), basic Xedit cleaning knowledge, and friendly attidute. Alternatively, Skyblivion's Coding Department has partnered with TriWizard in order to develop a program that can automatically generate large portions of navmesh that is superior to Creation Kit's generator. For those who have used it, you know that autogen navmesh isn't . . . great. Even Bethesda suggests doing navmesh by hand rather than use the generator. The more complex the land, the worse it is, and with +10,000 cells to navmesh, well, a reliable automated process would greatly spead up the work. Ideally, we're looking for those w/ general knowledge of OOP principles and understanding of C# and C++. If interested or have questions, please reach out on our Discord, website, or reddit page. https://skyblivion.com/volunteer/ https://discord.gg/tfQHSHNc6d https://www.reddit.com/r/skyblivion/
  22. TLDR: Where is a good starting off point, in learning to mod games, specifically CyberPunk here? For someone who has a base knowledge of coding, understanding how syntax and code structure generally works, but still likely considered a relative noob, or at least noob-ish. So, I am by no means a great or even good coder. I do a bit with Arduinos and Rasberry Pis using Python and C++ish. More important than the specific language though, I've (as all coders have) learned how to generally code, problem solve and work with syntax. So I have a small question, and a more open ended question here: 1. With this general knowledge base, would learning to mod still be very hard, or is this base knowledge usable in a meaningful way? (Is this dumb to pursue unless you are already knee deep in video game coding know how already)? 2. And more to the point, where is a good starting off point, to learn how to mod CyberPunk? I have gotten pretty good at editing and Frankenstein-ing other peoples code together into working applications, (regardless of language generally). If there is a file to parse though, I can generally navigate it and figure out how it works, at least enough to take it apart and rearrange its variables and call outs and fill in the small gaps you create in patching it all together. But I've never taken apart video game code. And most of my code effects hardware not software, making robots move and interact, and very little on screen interaction (but I have done some). What a good step one to start off on? For a bit more context, if it helps. I'm very interesting in some of these body tattoo mods coming out and I want to look more into working on removing head slot items appearances, or understanding why it is hard if not impossible to do right now. I know a few items in game that don't have an appearance and I thought I could possibly move their "invisible" appearance to a normally visible item. (Making a working head slot item with a mod socket or 3 take on an invisible appearance). This may be harder than it seems to me, but not knowing how to get to this discovery and understanding stage, I crave being able to explore this myself. The second thing I want to do at the moment also "seems" easy compared to my normal shallow programming work. Some of the NPCs in game have some bad ass body tattoos. (I saw some koi fish tattoo or something along those lines that I loved a ton). It seems from my surface level programming that this could likely be easily copied over to our main character models variable options outside of not knowing how visuals are applied to models. Like, replace "Body tattoo 2" with "NPC body tattoo 7" or simply saving over the model for V's tattoos with the NPCs tattoo, like a copy and replace. Both of these seem so simple though, that I assume they would have already been done if they were as simple as I'm thinking they are in my head. So I am either stuck till we get better tools or explore more of what is left to uncover from CDPR, or the amount of mod creators here is well below demand, and it would actually be great to get more people into the mod creation side of things here. With this game being so new, it would be a great time to get into modding with so much green pasture left to explore and contribute to. But me, and likely others, could use being pointed in the right direction here. Or maybe there are plenty of people screaming, "So many of us are pointing already stupid"! And in that case, I'm sorry. But help a well intended fool out here please. And thank you <3 Some hopefully helpful questions people might have: How do we open and edit files? (Notepad opens the text as symbols and some of my other programs like Code Blocks give me like one line of code. Are there a few general folders we will be working under specifically for the most part? Where do I even find where appearances would be saved assuming they aren't in some proprietary editor. Do any specific languages help to be proficient in here? Is it that hard to do edits to the game? Not looking to add anything fancy like an interface or new feature to the game, just edit over existing models in my cases here. Hope this is worded well enough. Kind of in "no mans land" here knowing some terminology, but maybe not enough to understand how complicated of a question I am possibly asking in reality here. Either way, thanks for reading! <3
  23. the issues are different in the two different psc files one i have slightly edited and the other is unmodified the mod did come with another file. the code to the main file (al_playeraliasscript) is Scriptname AL_PlayerAliasScript extends ReferenceAlias Import Debug Import Game Import JsonUtil Import Utility Actor Property PlayerREF Auto GlobalVariable Property AL_LifeCounter Auto Spell Property AL_DragonLifeSpell Auto string CONFIG_PATH = "../AlmostPermadeathData/" Event OnInit() SetIntValue(CONFIG_PATH + "AL_LifeCounterStorage", "life_counter", 3) Save(CONFIG_PATH + "AL_LifeCounterStorage") EndEvent Event OnDeath(Actor akKiller) AL_LifeCounter.SetValueInt(AL_LifeCounter.GetValueInt() - 1) SetIntValue(CONFIG_PATH + "AL_LifeCounterStorage", "life_counter", AL_LifeCounter.GetValueInt()) Save(CONFIG_PATH + "AL_LifeCounterStorage") Wait(2.0) If AL_LifeCounter.GetValueInt() == 0 FadeOutGame(true, true, 0.0, 0.0) PlayBink("permadeathvideo.bik", false, true, true) game.QuitToMainMenu() EndIf EndEvent Event OnPlayerLoadGame() int LifeUpdate = GetIntValue(CONFIG_PATH + "AL_LifeCounterStorage", "life_counter", 0) AL_LifeCounter.SetValueInt(LifeUpdate) Wait(1) Notification("You have " + AL_LifeCounter.GetValue() as int + " lifes left...") If AL_LifeCounter.GetValueInt() == 0 FadeOutGame(true, true, 0.0, 0.0) PlayBink("permadeathvideo.bik", false, true, true) game.QuitToMainMenu() EndIf If !PlayerREF.HasSpell(AL_DragonLifeSpell) PlayerREF.Addspell(AL_DragonLifeSpell, false) EndIf EndEventthe code for the other, unmodified, file (al_dragonlifescript) is Scriptname AL_DragonLifeScript extends activemagiceffect Import Debug Import JsonUtil Actor Property PlayerREF Auto GlobalVariable Property AL_LifeCounter Auto Message Property AL_DragonLifeMSG Auto string CONFIG_PATH = "../AlmostPermadeathData/" Event OnEffectStart(Actor akTarget, Actor akCaster) Int aiButton = AL_DragonLifeMSG.Show() If aiButton == 0 If PlayerREF.GetActorValue("DragonSouls") >= 1 PlayerREF.SetActorValue("DragonSouls", -1) AL_LifeCounter.SetValueInt(AL_LifeCounter.GetValueInt() + 1) SetIntValue(CONFIG_PATH + "AL_LifeCounterStorage", "life_counter", AL_LifeCounter.GetValueInt()) Save(CONFIG_PATH + "AL_LifeCounterStorage") Notification("You've gained one additional life!") Else Messagebox("You do not possess any Dragon Soul!") Endif ElseIf aiButton == 1 return ElseIf aiButton == 2 Messagebox("You have " + AL_LifeCounter.GetValueInt() + " lifes left...") EndIf EndEventthe code to the file (JsonUtil.psc) the file that is causing the error is scriptname JsonUtil Hidden ;/ MOD AUTHORS, READ! These functions all work in exactly the same way as their StorageUtil.psc equivalents. See them for usage docs. The important difference between these functions and the ones on StorageUtil.psc, is that instead of giving "Form obj" argument for the location to save the data, you give it a "string FileName" argument, pointing to an external JSON formatted file. These files will be saved/loaded in JSON format, and the starting location for the files to save/load from is as follows: data/skse/plugins/StorageUtilData/ Some important notes on usage to keep in mind: - You may specific a folder path in the filename, i.e. "../MyData/config" will save to data/skse/plugins/MyData/config.json - If not given in the filename argument, the filename will have the extension .json appended to it automatically when used. - You do not need to call Load() or Save() manually unless you have a specific need to. - When the player saves their game any modified file will be automatically saved, written to, or created if it does not exist. - When the player loads another save without saving themselves or the Save() function having been manually called by a script, the loaded data will be discarded and revert back to whatever the contents of the current saved file are. /; bool function Load(string FileName) global native bool function Save(string FileName, bool minify = false) global native bool function Unload(string FileName, bool saveChanges = true, bool minify = false) global native ; Check if given file has had any changes to it that haven't yet been saved bool function IsPendingSave(string FileName) global native ; Check if the given file was succesfully loaded and has no json parser errors bool function IsGood(string FileName) global native ; Get a formatted error string of any json parser errors on a file, returns as empty string if no errors. string function GetErrors(string FileName) global native ; Returns a list of all filenames in a given folder that end in .json string[] function JsonInFolder(string folderPath) global native ; Check if a json file exists or not bool function JsonExists(string FileName) global if !FileName return false elseIf StringUtil.Find(FileName, ".json") == -1 FileName += ".json" endIf return MiscUtil.FileExists("data/skse/plugins/StorageUtilData/"+FileName) endFunction ; See StorageUtil.psc for equivalent function usage instructions int function SetIntValue(string FileName, string KeyName, int value) global native float function SetFloatValue(string FileName, string KeyName, float value) global native string function SetStringValue(string FileName, string KeyName, string value) global native form function SetFormValue(string FileName, string KeyName, form value) global native int function GetIntValue(string FileName, string KeyName, int missing = 0) global native float function GetFloatValue(string FileName, string KeyName, float missing = 0.0) global native string function GetStringValue(string FileName, string KeyName, string missing = "") global native form function GetFormValue(string FileName, string KeyName, form missing = none) global native bool function UnsetIntValue(string FileName, string KeyName) global native bool function UnsetFloatValue(string FileName, string KeyName) global native bool function UnsetStringValue(string FileName, string KeyName) global native bool function UnsetFormValue(string FileName, string KeyName) global native bool function HasIntValue(string FileName, string KeyName) global native bool function HasFloatValue(string FileName, string KeyName) global native bool function HasStringValue(string FileName, string KeyName) global native bool function HasFormValue(string FileName, string KeyName) global native int function IntListAdd(string FileName, string KeyName, int value, bool allowDuplicate = true) global native int function FloatListAdd(string FileName, string KeyName, float value, bool allowDuplicate = true) global native int function StringListAdd(string FileName, string KeyName, String value, bool allowDuplicate = true) global native int function FormListAdd(string FileName, string KeyName, Form value, bool allowDuplicate = true) global native Int function IntListGet(string FileName, string KeyName, int index) global native Float function FloatListGet(string FileName, string KeyName, int index) global native String function StringListGet(string FileName, string KeyName, int index) global native Form function FormListGet(string FileName, string KeyName, int index) global native Int function IntListSet(string FileName, string KeyName, int index, int value) global native Float function FloatListSet(string FileName, string KeyName, int index, float value) global native String function StringListSet(string FileName, string KeyName, int index, String value) global native Form function FormListSet(string FileName, string KeyName, int index, Form value) global native int function IntListRemove(string FileName, string KeyName, int value, bool allInstances = true) global native int function FloatListRemove(string FileName, string KeyName, float value, bool allInstances = true) global native int function StringListRemove(string FileName, string KeyName, String value, bool allInstances = true) global native int function FormListRemove(string FileName, string KeyName, Form value, bool allInstances = true) global native bool function IntListInsertAt(string FileName, string KeyName, int index, int value) global native bool function FloatListInsertAt(string FileName, string KeyName, int index, float value) global native bool function StringListInsertAt(string FileName, string KeyName, int index, String value) global native bool function FormListInsertAt(string FileName, string KeyName, int index, Form value) global native bool function IntListRemoveAt(string FileName, string KeyName, int index) global native bool function FloatListRemoveAt(string FileName, string KeyName, int index) global native bool function StringListRemoveAt(string FileName, string KeyName, int index) global native bool function FormListRemoveAt(string FileName, string KeyName, int index) global native int function IntListClear(string FileName, string KeyName) global native int function FloatListClear(string FileName, string KeyName) global native int function StringListClear(string FileName, string KeyName) global native int function FormListClear(string FileName, string KeyName) global native int function IntListCount(string FileName, string KeyName) global native int function FloatListCount(string FileName, string KeyName) global native int function StringListCount(string FileName, string KeyName) global native int function FormListCount(string FileName, string KeyName) global native int function IntListCountValue(string FileName, string KeyName, int value, bool exclude = false) global native int function FloatListCountValue(string FileName, string KeyName, float value, bool exclude = false) global native int function StringListCountValue(string FileName, string KeyName, String value, bool exclude = false) global native int function FormListCountValue(string FileName, string KeyName, Form value, bool exclude = false) global native int function IntListFind(string FileName, string KeyName, int value) global native int function FloatListFind(string FileName, string KeyName, float value) global native int function StringListFind(string FileName, string KeyName, String value) global native int function FormListFind(string FileName, string KeyName, Form value) global native bool function IntListHas(string FileName, string KeyName, int value) global native bool function FloatListHas(string FileName, string KeyName, float value) global native bool function StringListHas(string FileName, string KeyName, String value) global native bool function FormListHas(string FileName, string KeyName, Form value) global native function IntListSlice(string FileName, string KeyName, int[] slice, int startIndex = 0) global native function FloatListSlice(string FileName, string KeyName, float[] slice, int startIndex = 0) global native function StringListSlice(string FileName, string KeyName, string[] slice, int startIndex = 0) global native function FormListSlice(string FileName, string KeyName, Form[] slice, int startIndex = 0) global native int function IntListResize(string FileName, string KeyName, int toLength, int filler = 0) global native int function FloatListResize(string FileName, string KeyName, int toLength, float filler = 0.0) global native int function StringListResize(string FileName, string KeyName, int toLength, string filler = "") global native int function FormListResize(string FileName, string KeyName, int toLength, Form filler = none) global native bool function IntListCopy(string FileName, string KeyName, int[] copy) global native bool function FloatListCopy(string FileName, string KeyName, float[] copy) global native bool function StringListCopy(string FileName, string KeyName, string[] copy) global native bool function FormListCopy(string FileName, string KeyName, Form[] copy) global native int[] function IntListToArray(string FileName, string KeyName) global native float[] function FloatListToArray(string FileName, string KeyName) global native string[] function StringListToArray(string FileName, string KeyName) global native Form[] function FormListToArray(string FileName, string KeyName) global native int function AdjustIntValue(string FileName, string KeyName, int amount) global native float function AdjustFloatValue(string FileName, string KeyName, float amount) global native Int function IntListAdjust(string FileName, string KeyName, int index, Int amount) global native float function FloatListAdjust(string FileName, string KeyName, int index, float amount) global native int function CountIntValuePrefix(string FileName, string PrefixKey) global native int function CountFloatValuePrefix(string FileName, string PrefixKey) global native int function CountStringValuePrefix(string FileName, string PrefixKey) global native int function CountFormValuePrefix(string FileName, string PrefixKey) global native int function CountIntListPrefix(string FileName, string PrefixKey) global native int function CountFloatListPrefix(string FileName, string PrefixKey) global native int function CountStringListPrefix(string FileName, string PrefixKey) global native int function CountFormListPrefix(string FileName, string PrefixKey) global native int function CountAllPrefix(string FileName, string PrefixKey) global native ; Experimental custom json formatting handlers. Paths are resolved using typical json syntax. ; The path will be created as necessary when setting data and the path does not yet exists. ; examples: ; JSON File: { "foo": { "bar": [3, 10, 7] } } ; Function: GetPathIntValue("filename.json", ".foo.bar[1]") ; Return: 10 function SetPathIntValue(string FileName, string Path, int value) global native function SetPathFloatValue(string FileName, string Path, float value) global native function SetPathStringValue(string FileName, string Path, string value) global native function SetPathFormValue(string FileName, string Path, form value) global native bool function SetRawPathValue(string FileName, string Path, string RawJSON) global native int function GetPathIntValue(string FileName, string Path, int missing = 0) global native float function GetPathFloatValue(string FileName, string Path, float missing = 0.0) global native string function GetPathStringValue(string FileName, string Path, string missing = "") global native form function GetPathFormValue(string FileName, string Path, form missing = none) global native bool function GetPathBoolValue(string FileName, string Path, bool missing = false) global return GetPathIntValue(FileName, Path, (missing as int)) != 0 endFunction int[] function PathIntElements(string FileName, string Path, int invalidType = 0) global native float[] function PathFloatElements(string FileName, string Path, float invalidType = 0.0) global native string[] function PathStringElements(string FileName, string Path, string invalidType = "") global native form[] function PathFormElements(string FileName, string Path, form invalidType = none) global native int function FindPathIntElement(string FileName, string Path, int toFind) global native int function FindPathFloatElement(string FileName, string Path, float toFind) global native int function FindPathStringElement(string FileName, string Path, string toFind) global native int function FindPathFormElement(string FileName, string Path, form toFind) global native int function PathCount(string FileName, string Path) global native string[] function PathMembers(string FileName, string Path) global native bool function CanResolvePath(string FileName, string Path) global native bool function IsPathString(string FileName, string Path) global native bool function IsPathNumber(string FileName, string Path) global native bool function IsPathForm(string FileName, string Path) global native bool function IsPathBool(string FileName, string Path) global native bool function IsPathArray(string FileName, string Path) global native bool function IsPathObject(string FileName, string Path) global native function SetPathIntArray(string FileName, string Path, int[] arr, bool append = false) global native function SetPathFloatArray(string FileName, string Path, float[] arr, bool append = false) global native function SetPathStringArray(string FileName, string Path, string[] arr, bool append = false) global native function SetPathFormArray(string FileName, string Path, form[] arr, bool append = false) global native function ClearPath(string FileName, string Path) global native ; Debug use function ClearAll(string FileName) global native i have gotten both files to say the same error after fixing the code for the first file, the picture is the error code (the reason this is edited is the fixing of the first files code, the update of pictures, to add tags, and fixing mispelling errors.)
×
×
  • Create New...