Nice!, a solution to an issue I've been having: Tried putting something similar together, but kept getting syntax errors. With this string of code working, I simply adapted it to my needs. I wanted to switch between 2 backpack (basic vs balanced boost, using 2 different packs - mantis and a mod), and ended up with this (code is based on asuming I have both items in inventory, thus no inventory check) If player.getequipped 16640b> 0; player.equipitem 8000804; Else; player.equipitem 16640b; Endif; EndIf
thank you for fixing my dumb error, turns out a single space can ruin the whole ting (had a space before > in the if statement)
PS. is there a way to not having the console spit out a wall of text whenever equipitem is used?
TBH, the if statement works with these spaces, so your error might have stemmed from smth else. But there are no "dumb" errors when we're learning and I think it's awesome when people are not afraid to tinker with the code a little bit. :)
Regarding your PS, I don't know if you can, but I do know that the console won't print these if you set up this command as a proper script (batch will still have printouts, I think), which I plan to do for all my shortcuts when CK comes out (and I'll have time to try and make the glorious StarCellPhones mod :)). For now, it just seems easier to hotkey reload console and keep the StarfieldConsole.ini open to change the FORMID on the fly regardless of the printouts.
I think I found the problem in my original attempts - got to love invisible characters in code examples lesson learned: clean all text copied from websites before using it (notepad++ with show all chars is great for this) Tinkering is what I do, probably more so than actually playing the game :) *edit - removed wrong info* The script idea sounds good to me, now we just need the proper tools :)
9 comments
I've been using starfield hotkeys for a long time and just today I had a need to unequip.
This came in perfectly.
With this string of code working, I simply adapted it to my needs.
I wanted to switch between 2 backpack (basic vs balanced boost, using 2 different packs - mantis and a mod), and ended up with this (code is based on asuming I have both items in inventory, thus no inventory check)
If player.getequipped 16640b> 0; player.equipitem 8000804; Else; player.equipitem 16640b; Endif; EndIf
thank you for fixing my dumb error, turns out a single space can ruin the whole ting (had a space before > in the if statement)
PS. is there a way to not having the console spit out a wall of text whenever equipitem is used?
Regarding your PS, I don't know if you can, but I do know that the console won't print these if you set up this command as a proper script (batch will still have printouts, I think), which I plan to do for all my shortcuts when CK comes out (and I'll have time to try and make the glorious StarCellPhones mod :)). For now, it just seems easier to hotkey reload console and keep the StarfieldConsole.ini open to change the FORMID on the fly regardless of the printouts.
lesson learned: clean all text copied from websites before using it (notepad++ with show all chars is great for this)
Tinkering is what I do, probably more so than actually playing the game :)
*edit - removed wrong info*
The script idea sounds good to me, now we just need the proper tools :)
Cheers.