Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

Is there something that returns the actual weight a reference (or better, Player) is carrying? I do believe there's something specific to do that, but actually I can't remember anything like that... I don't think I must scan the inventory and calculate it everytime...

Link to comment

I'm afraid so. I would not be surprised if it is stored in one of the Actor's member but which I don't know. Maybe it can be found using the saves:

 

Load your inventory until a known value. Save, Dump the save. Load some more, Save and dump again. Compare the dumps. If you find a field for the PlayerRef record whose values match it should be the one.


Just tested it myself and I get the same:

 

GetEquipmentBipedMask ArmorCombat

 

returns: 3452816648

 

I'm thinking NVSE bug.

 

It was a NVSE bug corrected in v5 Beta 1

Link to comment
Guest luthienanarion

GetBaseForm can be used in place of GetBaseObject in all other circumstances. Unless you specifically want to retrieve the leveled list an actor was generated from, just use GBF.

Link to comment

So I had an idea, but I'm not sure how it could be done with Fallout. I basically want to create a plugin that detects weapons from other mods, and inserts them to leveled lists, however there's two things I don't know how'd identify. First, the weapons, although, I would guess most people place their weapons in the NVAllWeapons Form List. Then there's also the fact that some plugins may have their own leveled lists and stuff, so it'd be redundant if I started distributing stuff that they have already distributed. Anyway, the way I'd do if it were possible, and I'm sure this way isn't because Fallout doesn't have a language that operates properly on OO, would be to create a leveled list object and insert the weapon, ammo, levels, etc, and then place into various leveled lists. 

 

So is there any way to attempt to do this? My emphasis would be to avoid using anyone else's plugin, my plugin is only the distributor, it would not  use assets from anyone's mods, it would only distribute their stuff. 

Link to comment
Guest tomm434
I would guess most people place their weapons in the NVAllWeapons Form List

If they do -  NVAllWeapons form list  will be overwritten with every plugin and the result is - only bottom weapon plugin's weapon will be in the list.

 

You should use BuildRef function or Odessa's (I believe she did that :P ) FnGetExternalForm (http://geck.bethsoft.com/index.php?title=FnGetExternalForm)

http://geck.bethsoft.com/index.php?title=BuildRef

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I have an idea but I never tried it anywhere.

First - learn how BuildRef works

When you create formIDs in GECK every time count (in decimal) is higher

{hex} - {dec}

ADD == 2781

ADE == 2782

ADF == 2783

etc..

 

So in theory you can scan every form ID from every mod. Sure, this will take time but it's okay to use (to wait) in MCM menu (Not on game load!). Imagine function which scans every form ID from other mod, check is if it's weapon and if it is - adds it to leveled list.

I believe script will be like:

begin function{}

    let iTotalMods := GetNumLoadedMods
    let iIndex := 0
    while iIndex < iTotalMods ; -----------------------------------loop for all mods
        let CurrentMofIndex := GetNthModName iIndex

        let CurrentModFormID := 2781 ; as a starting number

        let CurrentItem := BuildRef CurrentMofIndex 2781 ; captured first item in the mod, add it if it's weapon by GetType check
        let CurrentItemIndex := 2781 ; index for the loop

        While GetType CurrentItem !=0 ; --------------------------------------------------loop for all FormIDs in the mod
            let  CurrentItemIndex +=1 ; -------------------------------------------------increase index by 1
            let CurrentItem := BuildRef CurrentMofIndex CurrentItemIndex ;----Buildref item with that index

                 if GetType CurrentItem ; check if it exists
                     if GetType CurrentItem == 40 ; if it is weapon
                         ; More checks for it being quest item and else
                          AddFormToFormList LeveledFormList CurrentItem ; yeah, vanilla AddFormToFormList command.
                     endif
                 else
                     break ; no form id anymore - break the loop for this mod ???
                 endif

        loop


        let iIndex += 1
    loop

end

I don't think it's 100% reliable because mod author can delete some FormID in the middle of development and loop for each mod can break and I don't know the principle new formIDs are given so there may be natural gaps in the FormIDs decimal #.

Just an idea anyway. You can always check weapons manually from Most downloaded weapon plugins on Nexus.

 

 

Link to comment

 

I would guess most people place their weapons in the NVAllWeapons Form List

If they do -  NVAllWeapons form list  will be overwritten with every plugin and the result is - only bottom weapon plugin's weapon will be in the list.

 

You should use BuildRef function or Odessa's (I believe she did that :P ) FnGetExternalForm (http://geck.bethsoft.com/index.php?title=FnGetExternalForm)

http://geck.bethsoft.com/index.php?title=BuildRef

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I have an idea but I never tried it anywhere.

First - learn how BuildRef works

When you create formIDs in GECK every time count (in decimal) is higher

{hex} - {dec}

ADD == 2781

ADE == 2782

ADF == 2783

etc..

 

So in theory you can scan every form ID from every mod. Sure, this will take time but it's okay to use (to wait) in MCM menu (Not on game load!). Imagine function which scans every form ID from other mod, check is if it's weapon and if it is - adds it to leveled list.

I believe script will be like:

 

begin function{}

    let iTotalMods := GetNumLoadedMods
    let iIndex := 0
    while iIndex < iTotalMods ; -----------------------------------loop for all mods
        let CurrentMofIndex := GetNthModName iIndex

        let CurrentModFormID := 2781 ; as a starting number

        let CurrentItem := BuildRef CurrentMofIndex 2781 ; captured first item in the mod, add it if it's weapon by GetType check
        let CurrentItemIndex := 2781 ; index for the loop

        While GetType CurrentItem !=0 ; --------------------------------------------------loop for all FormIDs in the mod
            let  CurrentItemIndex +=1 ; -------------------------------------------------increase index by 1
            let CurrentItem := BuildRef CurrentMofIndex CurrentItemIndex ;----Buildref item with that index

                 if GetType CurrentItem ; check if it exists
                     if GetType CurrentItem == 40 ; if it is weapon
                         ; More checks for it being quest item and else
                          AddFormToFormList LeveledFormList CurrentItem ; yeah, vanilla AddFormToFormList command.
                     endif
                 else
                     break ; no form id anymore - break the loop for this mod ???
                 endif

        loop


        let iIndex += 1
    loop

end

 

I don't think it's 100% reliable because mod author can delete some FormID in the middle of development and loop for each mod can break and I don't know the principle new formIDs are given so there may be natural gaps in the FormIDs decimal #.

Just an idea anyway. You can always check weapons manually from Most downloaded weapon plugins on Nexus.

 

Now that is a cool idea :)
Link to comment

Interesting I shall see where this leads. I'm hoping though, that I do not have to use nested cycles, what I do already does that, and I want to avoid that, not because of performance or anything but because I want to find a better way to do it. 

Link to comment

I see, I wasn't aware such a function existed. I haven't kept up to date with that plugin. Been too busy with a lot of other stuff. Regardless, that will make it a lot easier to retrieve, instead of having to iterate through a bunch of lists to get everything. Thanks. 

Link to comment
Guest luthienanarion

I see, I wasn't aware such a function existed. I haven't kept up to date with that plugin. Been too busy with a lot of other stuff. Regardless, that will make it a lot easier to retrieve, instead of having to iterate through a bunch of lists to get everything. Thanks.

It's also astronomically faster. Before I delved into writing my own script functions, I once wrote a script similar to the one above that took 20 minutes to generate a list of all weapon forms in a load order comprised only of the DLCs. (FormIDs are not necessarily contiguous, so you must attempt to build a reference to all 16.7 million possible values for each plugin.)

GetLoadedType and GetLoadedTypeArray instead iterate over an already-existing linked list in the game's memory containing the necessary data and return a result in mere milliseconds.

Link to comment

 

It's also astronomically faster.

 

I use it on getgameloaded on a mod, god I can't really notice the load difference with or without the mod.

 

Now we only need a function that calms down users and convince them that installing an extension won't destroy their life.

Link to comment
Guest luthienanarion

 

It's also astronomically faster.

 

I use it on getgameloaded on a mod, god I can't really notice the load difference with or without the mod.

 

Now we only need a function that calms down users and convince them that installing an extension won't destroy their life.

 

There are still people who refuse to install NVSE, citing various half-baked reasons, but I think most of them are just too lazy to install something that isn't a one-click process in NXMM.
Link to comment

Stll, I can't sleep everytime I must decide if Lutana or JIP must be a requisite, especially because most of the times I need very small things and I end up workarounding them in a bad way or simply rip them out. That's so bad, they should come down from steam when people install vanilla.

Link to comment

 

 

Damnit, I had this problem fix itself when I updated from windows 8 to windows 8.1, 18 months ago, my hard drive crashed at Xmas and I had windows 8 re-installed on a new drive and updated to 8.1 and the GECK columns have never worked since, long before the march updates mentioned, stupid windows people :P

 

 

This guy removed that update and solved the problem, so another confirmation of what stated above here.

http://forums.nexusmods.com/index.php?/topic/2679079-geck-error-dialogue-topics-and-conditions-invisible-and-uneditable/&do=findComment&comment=23514774

 

Unfortunately I don't have any updates installed on that 13/3/15, I have a stack of them installed on the 15th instead.

I'm guessing it's not one of the security updates.

post-12141-0-80924200-1431139359_thumb.png

Link to comment

So. I have created an OnActivate follower that only follows when I activate them with the choice to follow. The script I use only

has two options: follow or wait. I wish to have a third option of sending them home, but don't know what script I could use in this

case. The script as-is uses a 'short' called 'followstate', which is set to 1 if choose to have them follow, and set to 0 when I want

them to wait. What I would like to know is what script could I use to make them return to the place I found them at originally?

 

This isn't anything like a typical follower (with a companion wheel) - I have them down as perfectly as can be expected. Just want

to see if there's a way to have the above work like I wish it to...

Link to comment
Guest tomm434

So. I have created an OnActivate follower that only follows when I activate them with the choice to follow. The script I use only

has two options: follow or wait. I wish to have a third option of sending them home, but don't know what script I could use in this

case. The script as-is uses a 'short' called 'followstate', which is set to 1 if choose to have them follow, and set to 0 when I want

them to wait. What I would like to know is what script could I use to make them return to the place I found them at originally?

 

This isn't anything like a typical follower (with a companion wheel) - I have them down as perfectly as can be expected. Just want

to see if there's a way to have the above work like I wish it to...

 

To send follower home use "MoveTo" function (FollowerRef.MoveTo MyFollowerMarkerRef). Then create a sandbox package and set MyFollowerMarkerRef as location so follower stayes there.

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