[BETA] New Vegas Script Extender (NVSE) v1

Post » Mon Sep 27, 2010 8:15 am

I probably wouldn't use Control 18 itself, since that's Ammo Swap and you want to be able to have that functionality too, but some kind of hotkey at '2' would be great rather than having a random un-changeable ammo swap function in its place.
User avatar
Everardo Montano
 
Posts: 3373
Joined: Mon Dec 03, 2007 4:23 am

Post » Mon Sep 27, 2010 4:01 pm

You might also have a problem with it being a quest script - in other words, it won't run every frame. Put it in an object script, make that object non-playable (you can only do that with weapons/armor/ammo), and then use the quest script to add that object to your character and then quit the quest.

EDIT: Did you use the NVSE_Loader.exe to load the GECK? You need to run it with the -editor argument or else it won't be able to accept NVSE script functions.


Yes, I use a shortcut to the NVSE_Loader.exe with -editor in the target section. I just restarted the GECK, but it still won't save. Weird thing is, I've tried the script on rebinding hotkeys to the numpad like this which worked (GlobalVariant: short, 2):

scn MyTestScriptShort KeyPressedBegin GameMode	If IsKeyPressed RebindHotkey1 == 1 && KeyPressed == 0		Set KeyPressed to 1		TapKey 79	ElseIf IsKeyPressed RebindHotkey1 == 0		Set KeyPressed to 0	EndIfEndBegin MenuMode	If IsKeyPressed RebindHotkey1 == 1 && KeyPressed == 0		Set KeyPressed to 1		TapKey 79	ElseIf IsKeyPressed RebindHotkey1 == 0		Set KeyPressed to 0	EndIfEnd


I'll try to make it as object script though I doubt how to do this correctly.
User avatar
Nice one
 
Posts: 3473
Joined: Thu Jun 21, 2007 5:30 am

Post » Mon Sep 27, 2010 2:45 pm

Thanks for your help friend, but that didn'T work either, the script doesn't even save. Could you tell me by chance if this script is ok, or do you recognize any failures. As I said I'm new to scripting.

As Langy mentioned, make sure you're loading the GECK via the latest NVSE loader, otherwise it won't recognise the NVSE functions. If it still won't save, try commenting out the calls to con_ToggleMenus and con_ToggleFreeCamera to see if that's the problem, and make sure you've spelled the name of your global variable correctly.

Aside from that, your script should work fine, although I'd recommend using a slightly more optimised approach to detecting keypresses:
Spoiler
ScriptName FSEasyConsoleCommandScriptint bKeyPressedBegin GameMode	if bKeyPressed != IsKeyPressed FSToggleCameraKey		set bKeyPressed to IsKeyPressed FSToggleCameraKey		if bKeyPressed			con_ToggleMenus			con_ToggleFreeCamera		endif	endifEndBegin MenuMode	if bKeyPressed != IsKeyPressed FSToggleCameraKey		set bKeyPressed to IsKeyPressed FSToggleCameraKey		if bKeyPressed			con_ToggleMenus			con_ToggleFreeCamera		endif	endifEnd
I've written a tutorial on detecting keypresses based around this format which can be found on my website - http://www.cipscis.com/fallout/tutorials/detecting_keypresses.aspx

Cipscis
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Mon Sep 27, 2010 6:33 pm

As Langy mentioned, make sure you're loading the GECK via the latest NVSE loader, otherwise it won't recognise the NVSE functions. If it still won't save, try commenting out the calls to con_ToggleMenus and con_ToggleFreeCamera to see if that's the problem, and make sure you've spelled the name of your global variable correctly.

Aside from that, your script should work fine, although I'd recommend using a slightly more optimised approach to detecting keypresses:
Spoiler
ScriptName FSEasyConsoleCommandScriptint bKeyPressedBegin GameMode	if bKeyPressed != IsKeyPressed FSToggleCameraKey		set bKeyPressed to IsKeyPressed FSToggleCameraKey		if bKeyPressed			con_ToggleMenus			con_ToggleFreeCamera		endif	endifEndBegin MenuMode	if bKeyPressed != IsKeyPressed FSToggleCameraKey		set bKeyPressed to IsKeyPressed FSToggleCameraKey		if bKeyPressed			con_ToggleMenus			con_ToggleFreeCamera		endif	endifEnd
I've written a tutorial on detecting keypresses based around this format which can be found on my website - http://www.cipscis.com/fallout/tutorials/detecting_keypresses.aspx

Cipscis


As I already said, yes I use the NVSE_loader.exe with -editor enabled.

I've commented out the con_ToggleMenus and con_ToggleFreeCamera and it indeed was the problem...the script saved.

Finally I quickly copy and pasted your script, but it didn'T save, so I assume it's related to the con variables?

Edit: What is if I upgrade NVSE? Do I simply copy and paste over the old version, or do I first have to delete the old files?
User avatar
Project
 
Posts: 3490
Joined: Fri May 04, 2007 7:58 am

Post » Mon Sep 27, 2010 4:23 pm

I just tried myself, and the GECK doesn't seem to recognise con_ToggleFreeCamera.

Cipscis
User avatar
Batricia Alele
 
Posts: 3360
Joined: Mon Jan 22, 2007 8:12 am

Post » Mon Sep 27, 2010 5:44 am

You just need to copy+paste the new NVSE to update it.

Add -serr to your NVSE_loader.exe launcher and include NVGeckExt.dll in your New Vegas directory (you can get it from http://www.mdn.fm/files/217839_cobrz/ScriptError1.zip). This will tell you what, exactly, is preventing you from compiling your script.
User avatar
Spooky Angel
 
Posts: 3500
Joined: Thu Aug 10, 2006 5:41 pm

Post » Mon Sep 27, 2010 8:59 am

You just need to copy+paste the new NVSE to update it.

Add -serr to your NVSE_loader.exe launcher and include NVGeckExt.dll in your New Vegas directory (you can get it from http://www.mdn.fm/files/217839_cobrz/ScriptError1.zip). This will tell you what, exactly, is preventing you from compiling your script.


I think I already found what wasn't working. con_ToggleCollision and con_ToggleMenu works like a charm, but con_ToggleFreeCamera doesn't.

It's also clear now that I shouldn't use F1-F3 for keybinds. Thoose keys are already used by the Pipboy... :facepalm:
User avatar
Cathrine Jack
 
Posts: 3329
Joined: Sat Dec 02, 2006 1:29 am

Post » Mon Sep 27, 2010 6:50 am

Still, having debug info on why your scripts aren't working is ridiculously useful, so you might want to consider getting that anyways.
User avatar
gemma
 
Posts: 3441
Joined: Tue Jul 25, 2006 7:10 am

Post » Mon Sep 27, 2010 5:03 am

Ah, could I request IsFormValid please? I've just tried porting across some code and forgot I'd liberally sprinkled it with IFV to avoid crashes.
User avatar
Stephanie Kemp
 
Posts: 3329
Joined: Sun Jun 25, 2006 12:39 am

Post » Mon Sep 27, 2010 5:43 pm

Still, having debug info on why your scripts aren't working is ridiculously useful, so you might want to consider getting that anyways.


When I try to follow your download link for the debug thingy, it gives me a page loading error. Any chance you can upload it somewhere else?
User avatar
LijLuva
 
Posts: 3347
Joined: Wed Sep 20, 2006 1:59 am

Post » Mon Sep 27, 2010 5:10 pm

I just tried myself, and the GECK doesn't seem to recognise con_ToggleFreeCamera.

Cipscis

Probably I need to import TFC instead of ToggleFreeCamera. Or perhaps that console option has gone away. I will look into it tonight.

Ah, could I request IsFormValid please? I've just tried porting across some code and forgot I'd liberally sprinkled it with IFV to avoid crashes.

Sure TTT. I'll look at how it was implemented and see how tough it is to bring across.
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Mon Sep 27, 2010 5:29 pm

It isn't mine to distribute. Not sure why it's down, but you could try http://www.newvegasnexus.com/downloads/file.php?id=36290. No idea how to get it to work with NVSE, though it says that it's possible.
User avatar
Michelle davies
 
Posts: 3509
Joined: Wed Sep 27, 2006 3:59 am

Post » Mon Sep 27, 2010 7:45 am

@Behippo

Thanks for taking your time to look into this, I really appreciate your efforts. Since I already uploaded my mod (yeah I know I have a fast internet :D) http://www.newvegasnexus.com/downloads/file.php?id=36911, can I ask for more con varibales in next version? Sure only if you have the time. I'm planning to make this a developer mod with easy console variable access, here's a list of things that would be usefull:

TLB = Toggle Lightbrite ModeShow InventoryTGM = Toggle God ModeGBO = Get Base Object IDKillResurrectResethealthdisableenablestartcombatstopcombat 

I apologize for hijacking this thread with my weird script problem. I will be less intrusive next time...I promise... :rolleyes:

It isn't mine to distribute. Not sure why it's down, but you could try http://www.newvegasnexus.com/downloads/file.php?id=36290. No idea how to get it to work with NVSE, though it says that it's possible.


That thing doesn't work with XP, but thanks anyways and thanks for showing me the failure inside my script.
User avatar
sam smith
 
Posts: 3386
Joined: Sun Aug 05, 2007 3:55 am

Post » Mon Sep 27, 2010 6:41 pm

http://nvse.silverlock.org/beta/nvse_1_beta2.zip

New functionality:
  • SetArmorAR
  • UI Functions (Get/SetUIFloat, GetUIString)
  • GetCrosshairRef
  • GetGameRestarted/Loaded
  • con_ToggleMenus, con_ToggleFreeCamera, con_ToggleCollision
  • GetWeaponItemMod - format: optionalRef.GetWeaponItemMod int:whichMod (1-3) optionalForm
  • Mod functions (IsModLoaded, GetModIndex, GetNumLoadedMods, GetSourceModIndex)
  • GetDebugSelection
  • Get/SetArmorDT - gets/sets a float


@DarN: you should have everything you asked for (aside from string_vars) to get started.

Nice! I need a functional SetUIFloat though. ;)

Your compiler theory might be valid. I know a lot of UI code was cleaned up and optimized for F3 - NV could simply be based on early BGS code.
User avatar
Isaiah Burdeau
 
Posts: 3431
Joined: Mon Nov 26, 2007 9:58 am

Post » Mon Sep 27, 2010 6:01 am


That thing doesn't work with XP, but thanks anyways and thanks for showing me the failure inside my script.


It was updated to work with XP a while ago.
User avatar
Rebekah Rebekah Nicole
 
Posts: 3477
Joined: Fri Oct 13, 2006 8:47 pm

Post » Mon Sep 27, 2010 5:08 pm

Okay - so we are getting the correct number in place (0x38F00000) which as a float is 0. Hmm. I wonder if they aren't using floats for some reason, but instead interpreting things as integers. That might be a change.

Oh - I think I have a possibility. We've noticed that there is less compiler optimization in NV than in FO3. We've seen quite a few more or less duplicated functions. Perhaps they've got multiple version of the functions - one that expects a float and one that expects an integer. Perhaps we've hooked up to the wrong one? That would explain why the float we are passing might get stored as an Int. I'll need to talk to Ian about it. We'll try and sort this out with a patch as soon as we can.

Oops. Fixed locally and testing now. Found the accessor function by running across a helper function that takes an integer, converts it to a float, then stores it on the Tile.... then copy/pasted the address of the helper instead of the accessor. orz
User avatar
Sabrina Steige
 
Posts: 3396
Joined: Mon Aug 20, 2007 9:51 pm

Post » Mon Sep 27, 2010 7:47 am

This is awesome so far! I was wondering though, is the ability to add the time of day, encumbrance and so forth (like the FO3 version) in there now and I just can't find it? Or is that a soon to be released feature? Thanks for your hard work Darn, and everyone else who help with this project.
User avatar
Chloé
 
Posts: 3351
Joined: Sun Apr 08, 2007 8:15 am

Post » Mon Sep 27, 2010 8:42 am

This is awesome so far! I was wondering though, is the ability to add the time of day, encumbrance and so forth (like the FO3 version) in there now and I just can't find it? Or is that a soon to be released feature? Thanks for your hard work Darn, and everyone else who help with this project.

If there are specific functions you want from FOSE, please request them specifically. We'll see what we can do to port them.
User avatar
Devils Cheek
 
Posts: 3561
Joined: Sun Aug 13, 2006 10:24 pm

Post » Mon Sep 27, 2010 8:56 am

If there are specific functions you want from FOSE, please request them specifically. We'll see what we can do to port them.


Sorry, I had 2 threads up at the same time, and I thought I was posting in the DarnUI thread....doh! :whistling: :facepalm:
User avatar
Sierra Ritsuka
 
Posts: 3506
Joined: Mon Dec 11, 2006 7:56 am

Post » Mon Sep 27, 2010 5:52 am

Great work! I have a question (or maybe a request): is there any chance of getting MenuTapKey working with XML menu keys (like E for Exit in containers)? It would be very helpful.
User avatar
Kim Kay
 
Posts: 3427
Joined: Fri Oct 13, 2006 10:45 am

Post » Mon Sep 27, 2010 5:15 am

here's a list of things that would be usefull:
[snip]

Most of those functions are already available via script, and http://geck.gamesas.com/index.php/ShowInventory should be fakeable with the available inventory-walking functions. Considering that it's only really useful as a debugging function anyway, I'm not sure I see the benefit of making it available via script, although I guess it couldn't hurt.

That thing doesn't work with XP, but thanks anyways and thanks for showing me the failure inside my script.
Running your script through my http://www.cipscis.com/fallout/utilities/validator.aspx should help with any structural problems, although it currently won't recognise any New Vegas-specific functions, and it can't tell you if you've misspelled anything that is defined outside of your script, like global variables, which is a common problem.

Cipscis
User avatar
Elizabeth Lysons
 
Posts: 3474
Joined: Fri Feb 02, 2007 7:16 am

Post » Mon Sep 27, 2010 4:28 am

Uploaded http://nvse.silverlock.org/beta/nvse_1_beta3.zip.

- fix SetUIFloat
- Script functions (IsScripted, GetScript, RemoveScript, SetScript)
- IsFormValid, IsReference
User avatar
KRistina Karlsson
 
Posts: 3383
Joined: Tue Jun 20, 2006 9:22 pm

Post » Mon Sep 27, 2010 9:14 am

Whenever I try to run nvse through Steam, it tells me to update fallout instead. Was there a NV patch I didnt know about or am I just installing wrong? Thanks
User avatar
Cagla Cali
 
Posts: 3431
Joined: Tue Apr 10, 2007 8:36 am

Post » Mon Sep 27, 2010 4:59 pm

Whenever I try to run nvse through Steam, it tells me to update fallout instead. Was there a NV patch I didnt know about or am I just installing wrong? Thanks

What version of NV do you have? Go to your steam/common/steamapps/New Vegas folder and get properties on the FalloutNV.exe. Hit the Details tab and report what version you have. There has been one patch to build 271 which we support. But we are also expecting a new patch any day now. It is possible it showed up tonight.
User avatar
kirsty joanne hines
 
Posts: 3361
Joined: Fri Aug 18, 2006 10:06 am

Post » Mon Sep 27, 2010 4:45 pm

Most of those functions are already available via script, and http://geck.gamesas.com/index.php/ShowInventory should be fakeable with the available inventory-walking functions. Considering that it's only really useful as a debugging function anyway, I'm not sure I see the benefit of making it available via script, although I guess it couldn't hurt.

Running your script through my http://www.cipscis.com/fallout/utilities/validator.aspx should help with any structural problems, although it currently won't recognise any New Vegas-specific functions, and it can't tell you if you've misspelled anything that is defined outside of your script, like global variables, which is a common problem.

Cipscis


Thanks, looks like a very nifty tool. Any chance for a in depth documentation. I assume yellow dots mean, that the script doesn't understand the variable?
User avatar
sam
 
Posts: 3386
Joined: Sat Jan 27, 2007 2:44 pm

PreviousNext

Return to Fallout: New Vegas