Jump to content

[LE] Some scripting Tips? Making a auto sell stuff mod...


Recommended Posts

I asumme that this is for a player's spell, if so:


ObjectReference Property InigoHorseRef Auto
ObjectReference Property VanaHorseREF Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
InigoHorseRef.moveto(akCaster)
VanaHorseREF.moveto(akCaster)
EndEvent

Link to comment
Share on other sites

  • Replies 82
  • Created
  • Last Reply

Top Posters In This Topic

Every time I try to do the "more reply options" to check formatting I get sent to the main forum page... Weird. I'll keep it short then.

 

See maxarturo's post with regards to your horse script.

 

Your users are having issues with your update because the included PEX file for the spell does not contain much of anything. The source file does. When the one user recompiled the script(s) and it worked for them, this would be why. The source is correct but the PEX is not. File dates lend credence to that. The source has a date of the 12th of July while the PEX has a date of the 10th of July.

Link to comment
Share on other sites

Maxarturo: AHHH. Damn I still use Oblivion syntax, DAMN ME!!! When will I learn? Well Inigo still refuse to ride and it is more complicated than that. It has to do with his items inside his invenory, Items that setup faction. Well... I did not follow the intruction, as I did remove the bow and his stuff the first I did. I forgot to use th () in function but I do add it in If() and While(), not that it is necessary really, but it makes the code looks nicer. I will keep mixing this up I guess. Damn you Pekka... ;)

 

IsharaMeradin: Thanks a lot. I will look into ut right away. Thanks. I was gonna add more debug info the the file and make a new upload. I will correct it.

 

I also get the same issues, specially when I make new threads. It is a forum bug. So annoying. I should really send in a bug ticket to Nexus as I do not know if anyone else have done that or they have. It is that bloody human check that do it. Mostly it works great. I will see... First I need to solve my own bugs.

Edited by Pellape
Link to comment
Share on other sites

I updated the file to v0,03b now IsharaMeradin. Could you please take a look at it, to see that it is okay? What I think, does not matter at all in this case. I think it is okay now, but still, it does not count.

So you are expert in inventory and you do seems to have a lot of experience of inventories. Lets me describe my current issue and I have seen this in all TES games.

SO if we remove a mod from Oblivion ot Morrowind, and we have items from those mods in out inventory, the weight of the inventory will not update. I have not removed a single esp from this game, but still my empty total weight is increasing fast and I guess I can keep modding CarryWeight but I guess CarryWeight is a short, a 32-bit integer? It means that I cannot exceed 4096 right? This starts to worry me some.

So your mod, you did mention that you have a chest that removes all items from the inventory right? Does it also remove hidden forms? I do suspect I do have some hidden forms from iHarvest as it keeps adding Tokens to my inventory, Hare and Corpse Tokens and I honestly do suspect that they do not get removed. It can also be so that my mod is the cause, but I honstly do not think so as RemoveItem really updates the weight properly.

 

I can also be LOTD that causes it when it adds all resources to the player, and do not restore the inventory. I do have 60K Weight resources and it sure takes a long time to get them from the char, back to where them belongs when I use tools, like cooking, Smithing, building stuff. I will stop using it for now. It makes me so damn frustrated waiting for the items to return back anyway. It is also more immersive to only use the resources I need as noone can carry their whole inventory of resourvces in real life. If I am a carpenter, a cannot carry all my planks at the same time, can I, not when I build an altan at least. Or not if I make stuff in Steel either. I like to make stuff. I will make a guitar one day and some drums: https://pepromusdesign.blogspot.com/?zx=2b6e020e144bf8df but I must afford to buy my resources first. I am unemployed right now and have other isues to deal with. I do miss making stuff though in RL. Virtual stuff has to do for now I guess.... ;)

We also have the function RemoveAllItems() and that one should do the trick I guess.

So how bad is it right now? Well if I strip my char, it has a total weight of 2000 and it did had 1000 yesterday, so I modded it another 1000, and suddnly it went from 1000 to 2000 in total weight. It can now carry 4000 in total weight. Something is screwing up the inventory for sure. Maybe it is so that there is a bug preventing us to get to much inventory space? I will not mod it more now than I already did.

I did made a Google search now for Inventory Weight Bloating and I did find this page: https://gaming.stackexchange.com/questions/48939/what-can-i-do-to-minimize-my-skyrim-save-game-size and maybe it solve this issue? I will try it. Well lets take a peek at my files sizes:

Save 18Mb
SKSE 880Kb

If I compare this size with Oblivion, it seems normal. My OBSE saves are that size, if it now is a SKSE Bloat that is. We do have something called String Bloating in OBSE, caused if we do not destruct used OBSE Strings. This is something Idle is looking into as he fainted when he saw my bloated Oblbion OBSE files :D I DID NOT KNOW!!!!! More modders than me did not know. It is in the OBSE documentation but still, I have not read it all. I will never read it all. It is TMI. To Much Information.

So: If your mod cannot help me fix this, I must try to make a fix or at least, I must learn how to prevent this issue to go out of hand. I do think I need to make a script that scans the inventory to start with. Strip the char, check the inventory with both ItemCount and also get the IDs with GetNthForm but the question is, will it find hidden forms?

 

Is there another way I can reset the TotalWeight of my char?

We can also reweight every single item in the whole game. :D Everyone seems to like to reweight stuff :wink:

 

Weight limits is so bloody stupid :D Well and Integer is limited, nothing is unlimited.

 

And IsharaMeradin. If you make a longer post, copy your text/reply before posting it and if the bug occur, just paste back the lost text. I do this for every post I make as I do not trust this bugged forum at all.

Edited by Pellape
Link to comment
Share on other sites

My mod will not solve your issue. It does not use RemoveAllItems and so does not catch hidden objects in that way. If the user runs the compatibility patch in SSEEdit, it may include some hidden objects by accident but no one has reported such issues. If the user just uses it as is, the lists used to transfer items is built up as the user adds items to the containers. Hidden objects cannot be transferred manually as they cannot be seen.

 

Open the console and use the command to show the inventory. It will list all items that you are holding including the hidden ones. If you have duplicates of hidden token items, they will be displayed there.

 

If you remove a mod from the game and you are holding items belonging to that mod, they will be removed. The weight should change accordingly. But I only experienced that once and it was years ago and do not remember what exactly took place.

 

At one point there was a mod that would use a cloak spell to put token items in NPC inventories and then use those to signal changes in animations used for that NPC. Mannequins would get spammed with those items and the mannequin would send them back to the player causing the player's inventory to fill up with these token items. The more mannequins, the more tokens obtained. You could have a similar scenario going on. No idea. Looking at your inventory in the console is the only way to find "hidden items".

 

You could also have a mod that modifies your carry weight in some way. Perhaps a backpack mod that adjust capacity when equipped or carried? *shrug*

Link to comment
Share on other sites

I suspect the ResetInventory() SKSE call could help you. Move all apparent items to a temp container for a moment. ResetInventory() which would revert your main container to CK layout, then move those items from the temp container back. This is totally me winging it with a system I probably would implement differently, but that call should be helpful for you

 

On the Inigo horse thing, my page is being weird so in case that wasnt addressed, you could edit his esp by setting any follow AI pack he uses, with "Ride Horse As Possible" being set to true. He wont ride unless horses are allowed, and you have to set his ActorBase or a Faction hes in, as an Owner of the horse you want him to ride. I like to use an AI casted spell which handles all of it: Calling, set ownership, and sanitizing the horse when done. Last part there is potentially unimmersive :-P

Link to comment
Share on other sites

If you want to use a slightly similar syntax for old time sake, then try this:

 

ObjectReference Property InigoHorseRef  Auto  
ObjectReference Property VanaHorseREF  Auto  
Actor PlayerREF
 
Event OnEffectStart(Actor akTarget, Actor akCaster) 
     PlayerREF = akCaster
     InigoHorseRef.moveto(PlayerREF)
     VanaHorseREF.moveto(PlayerREF)
EndEvent
Link to comment
Share on other sites

Thanks for all advises. :smile:

 

IsharaMeridan: Do you remember the command to write in the console? You mean RemoveAllItems?

 

Shred: I will try that one if the Console command does not do the trick

 

If it now was so simple to just add "Ride Horse As Possible" it had been done. I do not find it in any of Inigos packages as I looked inside them and maybe there is a reason for it? In Oblivion, it is just a check box you tick but in Skyrim... I tried to add it to a package where Inigo follow te player and are supposed to Ride, but I couldn't figure out how to add it really. I saw it in another package. I gave it up and read about it here instead: https://www.nexusmods.com/skyrimspecialedition/mods/62868 to find out what he did tried to do. It seems more complicated then we really think, otherwise this was not an issue honestly.

 

maxturo, it is not that easy really as the spell does not use the script at all and I know how to fix it, well know? I do want it to be a summon spell but the Summon spells seems to want to target a location and that is really not needed. I could use a similar spell I already got working in my sell stuff mod. Lets me explain the current situation with some screenshots. If you cant figure this out, I will skip the Conjuration school and go Alteration as it does not matter which honestly.

  1. The mount is moved. It is Altered
  2. The mount does get summoned

Conjuration seems to only want to ad dead stuff anyway... :wink: It is a Necromance skill after all...

 

Anyway lets peak at what I tried to make and I sure pushed some wrong checkboxes somewhere or used the wrong effects. Honestly, I do not really know what I am doing as there is so many stuff to change inside a magic effect and I know half of it.

 

77985963-1657904248.png

 

77985963-1657904315.png

 

The Script right now, including the debug info. It does not write any messages nor anything in the console, which means that the script does NOT run at all. It does not matter what I am targeting, the Script does not run. It is a fake summoning anyway but still... Summons do want to have a duration after all and I have none set... :wink: I can make a Alteration spell instead, that will work. Target Self.

Scriptname PekSummonUpgradedHorseSCR extends ActiveMagicEffect  

ObjectReference Property PlayerHorseUpgrREF Auto  
 
Event OnEffectStart(Actor akTarget, Actor akCaster) 

     PlayerHorseUpgrREF.moveto(akCaster)
	MiscUtil.PrintConsole("Caster is " + akCaster as string)
	MiscUtil.PrintConsole("Reference is " + PlayerHorseUpgrREF as string)
;	MiscUtil.PrintConsole("Player is " + akCaster as string)

	Debug.Notification ("Hello World")
	

EndEvent

The Caster is the player. The bloody horse reference is named PlayerHorseUpgrREF and I also pointed out the PROPERTY in CK, with the Pointing tool so this should really work, but what did I do wrong this time?

Edited by Pellape
Link to comment
Share on other sites

I suspect LOTD more than Iharvest. I do have a theory how my inventory got bloated. I did mention I did add over 60k in weight right?

 

Lets say 60k is the max number the int CarryWeight can have? Just see the max number of Septims a Vendor can have without making it into a 32-bit value? Well it is not exact 32-bit, as it is 32000. That is 31-bits. Or... It is 32-bits, if it can have a negative value, as the diff between -32 and 32 is 64k.

 

I guess Bethesda made all Actor Values into 32-bit and the decimal max of 32-bit is 65535, so if I now added more stuff in the inventory than that, the game could not return the total weight to its original state as I do guess, it can only subtract with that value. Not more. I do think I had 67000 in weight at some point, and that did gave me this conclusion what has happening. Maybe I do have hidden items, I suspect that too really. But I really need to have this fixed. :D It worries me.

 

So what I have done so far to test to get all straight is to add this inside my SKSE64.ini file

[General]
ClearInvalidRegistrations=1

Not that it helped any... :wink: So what is an Invalid Registration? Well Never mind now. I do have so many questions... :wink:

Lets focus at the inventory for now and we see if I can reset it.

 

Oblivion is better this way. All Ints are actually floats, truncated floats. The computer handle a float completely different than an Int. I have learned how the FPU really handle the calculations and it is magic. Do not ask me how it works. All I know if I try to use a bloody float on a 386 without a FPU, it CTD. :D Well I had no desktop as it was MS-DOS after all, it crashed never the less. Borland C++

 

So the CPU is doing all Integer math, the FPU do all floats. Today the FPU is inside the CPU on all comps and Intel separated them, as Intel are so stupid and lazy. Motorola always had the FPU inside their CPU's, so if I wanted to use float, then I compiled my C code on my Atari. The CPU can only do add, so everything else is fake, the way it do subtraction is so awkward. I did learn how to use bits and how to make a vice versed calculation. Well lets skip this no sense for now. This is irrelevant. :wink: I babble... I do hate this math, calculating 0 and 1 but it is cool anyway. It was a girl really that invented it and her name was Ada and she did that around 1850. Some are just geniouses. Without her logic math, we would not had any computers at all. I bet she did not knew the concequenses of the math she invented would be in the future really. But it is also very simple, well the principe is very very simple. She added these:

 

AND &&

OR ||

NAND !=

NOR != ||

 

And that is what logic is about. That is all the CPU is doing. Fences. Pekka stop now... Go and play the game will ye? YES!!! Finally!!!! :D

Edited by Pellape
Link to comment
Share on other sites

I was talking about ShowInventory to get the console to list all the contents in the target's inventory. Do player.showinventory to list out all the items currently in the player inventory. It will display any hidden items. You can then track down the source of the hidden items (if any) and hopefully resolve your issue.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...