Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

I will look deeper into EDE as soon as I am done with current tasks, poke me if I forget, it might be a few days.

 

NX_IsUsingSkeleton might be able to tell the difference between _male and _1stperson, but that isn't the problem. IsPC1stPerson works fine for that, and is what sexout currently uses. The problem is in knowing if tfc (The 'ufo' cam) is currently enabled or not.

 

If it's not -- it must be, to start animations on the player with pickidle.

If it is -- it has to be disabled before the knockdown, or the knockdown doesn't work.

 

Wouldn't the easiest solution be to have the NVSE guys add a referenceable boolean like IsTfcOn that is set True when tfc called via the console? As far as I know it intercepts all console entries and passes them back to the engine if they use internal handlers instead of nvse handlers.

Link to comment

TFC persists in the game state regardless of save chosen. If while playing you turn TFC On, remember it's a debug tool so it persists in the engine as being "on" regardless of save. All saves you load during the same game session will have it on. Now, all debug tools are turned off when a new play session is launched, which includes TFC. So, even if you save a game with TFC on, it will be turned back off when you load that game during a play session that's brand new (loaded your game from main menu) or a play session where TFC is off (loaded your game while playing another save with tfc off).

 

It basically follows the rule of never load a save while playing another save, always exit the game.

Link to comment

That makes sense. I don't follow the no-load rule, but I do follow the "I don't need 100-200 mods loaded rule" and I've never had an issue loading or saving during play. The check jaam suggested from within NVSE would definitely work with TFC working the way you describe though.

Link to comment

Actually .nam files are empty. So you can delete everyone of them you don't want and create your own, if you want the GECK to automatically select your plugin at startup. Just create an empty text file, name it "yourexactpluginname.nam" and put it in your data folder. I did this for my plugins, for instance if you want the GECK to automatically load SexoutWillow, you need a "SexoutWillow.nam" file.

 

Just a little titbit of info I thought may be handy for many people.

 

And deleting all the DLC.NAM files stops them auto loading in GECK

 

Link to comment

3rd person isn't the problem... TFC (UFO cam / free cam) is. ;) IsPC1stPerson() already works for 1st/3rd person checking.

Yes, sorry about that. I don't know how I confused those Saturday. Two many lines browsed all day long most likely :)

Link to comment
  • 3 weeks later...

I need help with the script im making atm.

 

ScriptName 01Melee9mm

Short sToggle

Begin GameMode
if IsKeyPressed 25 != sToggle
set sToggle to IsKeyPressed 25
if sToggle ;Button pressed
;Do things when button 'p' is pressed, in this case, decrease karma
player.unequipitem WeapNV9mmPistol
player.additem 01MeleeWeapNV9mmPistol 1
player.equipitem 01MeleeWeapNV9mmPistol
else ;Button released
;Do things when button 'p' is released, in this case, increase karma
player.unequipitem 01MeleeWeapNV9mmPistol
player.removeitem 01MeleeWeapNV9mmPistol
player.equipitem WeapNV9mmPistol
endif
endif
End

 

 

Line 6 error unknown command iskeypressed.

Also anyone have any idea on how do i make the item ("01MeleeWeapNV9mmPistol) invisible in my inventory.

and any script ideas so that when i press the key i will equip ("WeapNV9mmPistol"), because if i have 3 9mm pistols that means my script will equip a random pistol, im trying to find out if it is possible to equip the previous weapon before it got swapped for a melee version.

 

Thanks

Link to comment

 

 

I need help with the script im making atm.

 

 

 

 

ScriptName 01Melee9mm

 

Short sToggle

 

Begin GameMode

if IsKeyPressed 25 != sToggle

set sToggle to IsKeyPressed 25

if sToggle ;Button pressed

;Do things when button 'p' is pressed, in this case, decrease karma

player.unequipitem WeapNV9mmPistol

player.additem 01MeleeWeapNV9mmPistol 1

player.equipitem 01MeleeWeapNV9mmPistol

else ;Button released

;Do things when button 'p' is released, in this case, increase karma

player.unequipitem 01MeleeWeapNV9mmPistol

player.removeitem 01MeleeWeapNV9mmPistol

player.equipitem WeapNV9mmPistol

endif

endif

End

 

 

 

 

Line 6 error unknown command iskeypressed.

Also anyone have any idea on how do i make the item ("01MeleeWeapNV9mmPistol) invisible in my inventory.

and any script ideas so that when i press the key i will equip ("WeapNV9mmPistol"), because if i have 3 9mm pistols that means my script will equip a random pistol, im trying to find out if it is possible to equip the previous weapon before it got swapped for a melee version.

 

Thanks

 

Line 6 error unknown command iskeypressed.

If the GECK is not recognising the iskeypressed command then it means that NVSE has not been loaded correctly. Make sure that you have edited the shortcut to GECK so that it read something like the following. The bit in orange must be exact.

 

In my case it's "D:\Steam\steamapps\common\Fallout New Vegas\nvse_loader.exe" -editor

 

I copied your script into my GECK and it saved first time with no error. Used the normal GECK install path without enabling nvse and bam instant error.

 

Also anyone have any idea on how do i make the item ("01MeleeWeapNV9mmPistol) invisible in my inventory.

You can make the item 01MeleeWeapNV9mmPistol invisible in your inventory by having the playable flag turned of in the items editing menu. Like what you would in Oblivion or Skyrim. This mean the weapons can still be used by NPCs and companions just not by you.

 

and any script ideas so that when i press the key i will equip ("WeapNV9mmPistol"), because if i have 3 9mm pistols that means my script will equip a random pistol, im trying to find out if it is possible to equip the previous weapon before it got swapped for a melee version.

Your best bet is to duplicate the weapon in the GECK and then name it something else, for example "aaaMhiaSummersWeapNV9mmPistol" or "111MhiaSummersWeapNV9mmPistol". That way the script will equip that pistol instead of one of the random "WeapNV9mmPistol" you looted from a dead body. If you want it so the player can only use it then make sure you add the "Player Only" flag in GECK.

 

im trying to find out if it is possible to equip the previous weapon before it got swapped for a melee version.

It's possible. You will need to get the script to store the ID of the weapon you have equipped before the script starts. The script would then switch to a melee weapon and when triggered would look up and switch back to the previous weapon you had on. Sadly I have never experimented with this so I'm going to be no help there :/

Link to comment

Yet she is getting an error so it's either Fallout3 or she has GeckPU running !

 

Mailamea, are you using the exe version of GeckPU ? I did not think anybody used it anymore.

 

I think she knows the difference between Fallout 3 and New Vegas :P

 

I have the exe version of GeckPU installed and it still saves fine and recompiles fine.

Link to comment

Ok, first i am using geckpu, with the command line -editor, like what the readme says, or PU is just outdated this days?

Should i only use the default geck with the command line -editor?

-

Like the pipboy glove? so when the console command equipitem is used even if the item is non playable i will be able to equip it right?

-

Well if theres no way to call back the previous weapon that was equipped then that defeats the purpose of a mod that makes all ranged weapon switch to melee versions when "key is pressed", but thats fine.

-

@jaam : im using NV

Link to comment

As for the GeckPU, you can just run it like you would, if you load the GECK with NVSE (shortcut with "filepath\nvse_loader.exe" -editor). All you need is the .dll in the folder for it to work.

 

Lol so thats why it doesn't recognize is keypressed. lol

Link to comment

Well if theres no way to call back the previous weapon that was equipped then that defeats the purpose of a mod that makes all ranged weapon switch to melee versions when "key is pressed", but thats fine.

-

@jaam : im using NV

 

There should be a way to return to the exact previous weapon with NX_GetEVFo, which should distinguish between different 'inventory refs'. The question is, how do you accurately NX_SetEVFo it first? GetEquippedObject only returns a base form, IIRC.

Link to comment

 

The question is, how do you accurately NX_SetEVFo it first? GetEquippedObject only returns a base form, IIRC.

 

Give her long enough and she will find out and be able to tell us :P If there is one thing I can say about Mailamea it is that she has his strong determination to not let anything beat her and she will keep going until she finds out how to do it.

 

Just got to remember to keep giving her cups of tea and chocolate :)

Link to comment
  • 3 weeks later...

You can get an inventory ref with the... InventoryRef set of functions in nvse 3b2 BUT, such a ref is onlly valid for the current frame in the current script!

  Check OBSE online documentation : http://obse.silverlock.org/obse_command_doc.html for more information.

So there is no point to use it here.

 

Now what you could do is use GetEquippedCurrentHealth to store the health of the equipped weapon and GetEquippedObject 5 to store the base item of the weapon. Then on switching back, loop through all the inventory until you find the same object with the same health. I don't think other attributes matter unless mods attached do not change the base item.

If that is the case, then look at the Mod functions added from nvse 2b12. One might allow you to detect and store what makes that weapon different.

Link to comment
  • 3 weeks later...

This was posted elsewhere (in SCR post 247) and thought Halstrom would find it interesting, and it was suggested to post here by DoctaSax. ( at least I think he mentioned to post it here. ) I was trying to learn about the engine and various limitations and discovered at least for me the following:

 

When testing (creating BSA's ) for Sexout Common Resources. Like the texture limit it seems that if you combine a folder of textures/ meshes etc into a BSA and that BSA exceeds 1.5 gigs etc. It starts to break down and cause the dreaded floating exclamation marks. Interestingly enough the files affected seem to be those files like found in Toy Pack that have more deeper nested files. That is more levels of folders (deep ) inside the texture folder. I don't know if this is also what happens with the texture limit with the loose files but logically it should be. The size of the BSA might be related to the hardware, not sure on that fact. However the games BSA's don't seem to exceed 1gig by very much.

 

What does that mean to us modders. Well. It could be that if we keep flatter folder structures we can increase the amount of textures further than if we kept deeper folder structures... regardless of if the files are packed into BSA's or kept loose. Makes sense?

 

Feel free to add your personal experiences and knowledge to this as needed. To the moderators if indeed this should be elsewhere forgive me and let me know I will post it where ever you want or as always you can move it as needed.

Link to comment

Yeah, I thought it should go in here - we don't have that many "random bits of knowledge" threads. I thought it quite interesting that a more superficial BSA structure gets better performance & that there seems to be something of a size limit - at least for nv.

I'd like to add that I think I remember - from my days unpacking, pyffi-ing & repacking Oblivion meshes - that an uncompressed bsa file gets better performance than a compressed one too. Never ended up with a BSA over 1.5 gB, however, so who knows whether that'd make a difference.

Link to comment

Thanks DoctaSax for the added thoughts.

 

The large one was a combination of all the required files for SCR. There are alot of textures for that mod. :s I now have them separated into Lovers pack and Nexus pack and don't have any more issues with big red triangles. I might just go back and repack them into separate packs like I did before.

 

Before I ran each mod's texture and in some case such as in the Bouncing Breast mods I separated them out by armor and created BSAs. I believe I hadn't had them compressed.

:cool:
 
The above gives some hint to the way I had them structured. They worked great. My thoughts were if Halstrom changed any of the core BSA files I could just change the prefix and presto it would work again. That is what I was learning when I uploaded "Toy Pack" from Spectrum Warrior for a resource at Halstrom's request. Safe simple and clean to use. :angel:
 
At first I compressed the flies until I thought better of that. I can easily upload using 7zip and it could compress the files so compression isn't needed. However I notice no difference in performance one way or there other even with the large amount of various BSA's that I had created in the above picture, not to mention the large amount of others for virtually ever other mod I had installed at the time. However that isn't a great test considering I have a pretty good rig to play games on. It might be different for others with lower end gaming computers.
 
For the newer individuals to this it is quite easy to do BSA's from the files you download that is if you understand how to do it. I have folders customized with the Textures and Meshes etc in the folder correct and then just point the BSA creator from FOMM and save with the prefix of the mod. If it is attaching to another mod as a requirements like in the case of SCR I have the prefix of the name of the mod and suffix of the name of the requirement. You can see more with the attached above. Once the mods are download it takes just moments to drag the texture and mesh folder over to an empty folder and create the BSA. I can recreate all the BSA's from SCR requirements in about an hour or less. Less if I don' t use any compression.
 
I am interest in see if anyone else has similar results as I have had with the BSA's. But my main purpose is to gather info on the possibilities of BSA's and learning the limitations so that we can extend the texture/mesh perhaps further than before if we can structure the sub folders in such a way to do so. If what I found is true we may be able to extend the game texture files further before we run into any limitations furthering our gaming pleasure.

 

Link to comment
  • 1 month later...

I just wanted to write down what happened today.

 

When I make an activator (a piece of furniture where I attach a script with a begin onactivate block) I usually take an empty activator (like the electrical switch), I duplicate it, I change the base mesh then I attach my script.

 

Today, for praticality reasons, I duplicated one of my old and already done activators, then I replaced the script with the new one.

 

The result is that when I activate it, BOTH scripts run (they both were showing a message box, so the result is I see two message boxes).

 

Once, one of you veterans addressed me to not duplicate an existing NPC with a script attached. Well, today I found that probably even duplicating an item with a script is dangerous.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use