Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

 

 

But I'm no more sure of what I'm looking for, now -_-

So what does that mean?  I've got a uniquely nonfunctional version of NVSE?  I suppose I'll try an earlier version or something.
Oh I just wanted to have an answer from you, to see if I really understood the whole subject or I did it wrong.

 

Oh it can be everything. But personally I doubt it's in your NVSE. Mine is the latest, a modified version of the one online, but there are no changes on arrays so it is can't be related to your issue.

 

I tell you what *I think* it's happening, because incredibly we were discussing just yesterday about it with Xilandro. Two years ago, I was scripting 100 times more than now, so I was definetely less rusty, and still I was having *a lot* of weird issues. Today, I almost have no weird issues.

 

*I think* the key is using small tips to prevent bad things happening.

 

Here few mystical tips of what I follow:

- No magical tools when modding (i.e. NVAC)

- No use of other tools than GECK. If I have too (i.e. a slight modify on xEdit), I immediately reload everything on GECK.

- Never start with numbers on references (this one's old)

- Smallest load order ever, no other plugins if possible, my test plugin on the bottom (you don't need me to write you, but better be redundant)

- Updated versions of script extenders, ready to remove what you don't use if you'll have a weird issue

- Going in game with GECK opened is fine, but then close the game before modding again (ok this is banal)

- ALWAYS USE A CLEAN SAVE, this one's very important. Do not save after that you COCed inside the Atomic wrangler room, so that next time you'll have to avoid the command on console... always load a savegame done when your mod was still not active. This leads to special wondrous impossible issues connected to variables, when for example you add / remove vars from a quest script and it was already running in your previous save

- ALWAYS RECOMPILE SCRIPTS RELATED TO OTHER SCRIPTS. In your case, you modify the quest script, then recompile the object script too, you only need to add a blank space and click save.

- Close GECK and reboot pc (!!!) when you're having a definetely weird result which makes no sense and you're not seeing any mistake

 

Not saying this is vangel or what, it is just my own personal experience. I can't say it's the root of your issues, too, but it saved me a lot of headaches and wasted time, and I hope it will save you too. There are few bugs in the engine, but believe me if I tell you they are almost unnoticiable unless very very few specific cases, and often involving rendering / spawn / graphic, almost never involving scripts.

 

Please continue posting when you find a bug or you have difficulties, it always deserves to double / triple check

Link to comment
  • 1 month later...
  • 1 month later...
  • 5 weeks later...

Did anyone know that despite the wiki having told us for the longest time that setAV affects the av on the actor's base form, it doesn't actually seem to work that way? I SetAV'd doc m's strength to 6 (reg, base & permAV being 4) and it only affected the ref, not any other doc m I spawned. Tried delaying, thinking it needed some time to stick, tried after saving: only the original ref, not the spawn. Tried changing it on one ref while 2 were loaded: only the one ref.

 

Does anyone else have different results?

Link to comment

Thanks for confirming, I adjusted the page.

 

The other bit about it not directly modifying player health is wrong too, I think.

Aside from the example given saying endurance could be 40 (!), which makes it clearly an oblivion copy-paste, the line "If you use player.SetAv Health 100 the player will have 180 total health - 80 from base health, and 100 for the rest." doesn't pan out.

 

Test:

Endurance at baseAV 7, permAV 7, current AV 6 (due to wearing an outfit) --> health is base 240, perm 240, current 240

modAV health by 20 ---> health is base 240, perm 260, curr 260

modAV endurance by 1 (7-8-7) --> health is base 260, perm 280, curr 280

setAV health to 300 --> health is base 300, perm 320, curr 320

 

So obviously endurance does affect health. But when you set it, you set it. It doesn't immediately become (what you set) + (some extra value).

Link to comment

I think so. An example that makes sense (for my concept of making sense) is the classic bug where if you uninstall a mod with an armor that grants you +(something) while you're wearing it, the calculation will be wrong. I had this "issue" on FO4 too, where I had to manually calculate how many stats I had and I had to manually setav them, because the game wasn't recalculating them correctly. I think it never recalculates from the begin, it always starts from the actual value and makes corrections, because console or mods are not expected behaviours.

 

Just for curiosity... I had this kind of thoughs with Stamina: to optimize the quantity of operations, I couldn't recalculate everything in every moment, I had to make choices, and my choice was to not take care about console. So if you modify your stats via console the stamina won't be affected, it will be only the next time that an expected event will allow a complete recalculation.

 

By the way, could you think to a way to retrieve the reference you click on console and pass it to a script? Retrieving a reference in flycam would be quite nice.

Link to comment
  • 1 month later...

Hello there. 

 

I'm working to improve the Cirosans Classic Overhaul mod. I just installed the Damage Resistance module. Basicly it gives armors DR based on their type such as light, medium or heavy. To adding custom armors to the form lists it has a script but it is not working. I tried to fix it but I cannot make it. The code is 

scn CCODRArmorScanScript

ref armor

int BitMask

begin gamemode

set armor to player.getEquippedObject 2
let BitMask := GetEquipmentBipedMask armor

if Bitmask == (SetBit BitMask, 3) && armor.isInList CCODRMediumArmor == 0
	addFormToFormList CCODRMediumArmor armor
elseif Bitmask == (SetBit BitMask, 7) && armor.isInList CCODRHeavyArmor == 0
	addFormToFormList CCODRHeavyArmor armor
elseif armor.isInList CCODRLightArmor == 0
	addFormToFormList CCODRLightArmor armor
endif

end

I tried with light, medium or heavy armors and it doesn't working. Can somebody help me?

Link to comment

I'd suggest to put some message in console to understand what's happening.

 

ref rArmor

int iBit

int iSw

 

...

 

set rArmor to player.getEquippedObject 2

 

if rArmor

Set iSw to 0

Set iBit to GetEquipmentBipedMask rArmor

if iBit == (SetBit rArmor, 3)

if rArmor.isInList CCODRMediumArmor == 0

Print " I am a Medium Armor"

ListAddForm CCODRMediumArmor, rArmor

else

Print " I am a Medium Armor but already in list"

endif

 

elseif iBit == (SetBit rArmor, 7)

if rArmor.isInList CCODRHeavyArmor == 0

Print " I am a Heavy Armor"

ListAddForm CCODRHeavyArmor, rArmor

else

Print " I am a Heavy Armor but already in list"

endif

 

elseif rArmor.isInList CCODRLightArmor == 0

Print " I am a Light Armor"

ListAddForm CCODRLightArmor, rArmor

else

Print "I'm none of the above"

endif

else

if iSw

else

set iSw to 1

Print "Ref doesn't exist"

endif

endif

 

Alternatively, Lutana had (and JIP should have) GetArmorClass - http://geck.bethsoft.com/index.php?title=GetArmorClass

Once you understand what is happening, you could think to see if you can make it work on an ActorEquip Event Handler instead than in GameMode

Link to comment
  • 2 weeks later...

Hello all,

 

I've found through fnvedit some dialogues that contain scripts I want to edit.

If I go to GECK 'Filtered Dialogues' I can find most of them. And in quests I can find even more of those that I'm searching. The last few however I have no idea where I can view them. I can see them in 'dialogue tree'. If I do 'Edit info' I get to an empty 'Conversation' tab.

 

Can somebody tell me (preferabe step by step) where I can find the scripts connected to dialog 0012519b, part of 'VFSSimonCallsItADay' ( 'Oh, I'm going to need the rifle and armor back. Boss's orders.') ? I hope that if somebody can help me find this particular one, I can find most others as well.

Link to comment

Can somebody tell me (preferabe step by step) where I can find the scripts connected to dialog 0012519b, part of 'VFSSimonCallsItADay' ( 'Oh, I'm going to need the rifle and armor back. Boss's orders.') ? I hope that if somebody can help me find this particular one, I can find most others as well.

You mean in GECK?

You open the quest VMS29a, then you go under Topic tab, you pick your topic VFSSimonCallsItADay, under Info you select the second sentence: you'll find the script on bottom right in Result Script End

Link to comment

Sorry. I tried but I don't see either 'VFSSimonCallsItADay', the sentence 'Oh, I'm going to need the rifle and armor back. Boss's orders.'

or its predecessor 'It's just about closing time. Let's go see the boss about getting paid.'

 

This is what I see:

post-480625-0-17852900-1492110504_thumb.jpg

Link to comment

 

 

Let me guess.... Windows 10? :)

 

I remember someone mentioning that you have to "drag" in order to see some parts on GECK, with Windows 10, or it's like if you miss them (i.e. perk conditions)

 

http://i67.tinypic.com/351s8pi.jpg"]http://i67.tinypic.com/351s8pi.jpg

 

Yep you got to drag the columns over on any conditions, it broke in a Windows 8.1 update so is unlikely to ever be fixed
Link to comment

Ah. So the column on the left side isn't just a cosmetic thing, to make the rest of the dialog-window look more importantly.....

 

I'll see if I can figure out, how I can view that list on the left side. Thank you A.J.

 

Edit. Thank you DoctaSax. CTRL + "+" makes the list visible (at least for me)

Link to comment
  • 1 month later...
  • 1 month later...

I really want to start making my own maternity wear (fill in the missing outfits from MPO), but I have not succeeded in making an altered mesh visible in FNV. I believe the problems I had were caused by me, not knowing how to import a FNV-original mesh.

Does anybody know a video-tutorial or other guide of importing an existing mesh, changing it to fit a different bodyshape, (fixing weights,) saving it and loading it in-game?

Link to comment

I really want to start making my own maternity wear (fill in the missing outfits from MPO), but I have not succeeded in making an altered mesh visible in FNV. I believe the problems I had were caused by me, not knowing how to import a FNV-original mesh.

Does anybody know a video-tutorial or other guide of importing an existing mesh, changing it to fit a different bodyshape, (fixing weights,) saving it and loading it in-game?

 

When I was young, I've learnt with this: http://wiki.tesnexus.com/index.php/Creating_an_armour_for_Fallout._Part_1

Link to comment
  • 3 weeks later...

Time for another scripting question.

 

As some of you might know I've build massively large scripts to do outfit swapping, and I'm getting signals from users that their old computers can't handle my massive scripts (users are getting performance problems in-game). So I want to optimize my scripts. One of the solutions I'm thinking of, is that once I've found the outfit and done my thing with it, I'd abort/exit/kill/terminate the script. I know this is possible in a lot of scripting languages and programming languages, but I'm wondering if the GECK-scripting language can also do that.

 

Does anybody know the command to exit a function or script immidiatly?

 

 

<Some stuff happens before this>

    if GetEquipped OutfitUniqueMerc05

            SetFunctionValue to OutfitUniqueMerc05

           <Terminate/abort/stop the script/function here>
    endif

    if GetEquipped OutfitUniqueMerc06

            SetFunctionValue to OutfitUniqueMerc06

            <Terminate/abort/stop the script/function here>
    endif

<If user has none of the x-types of outfits equiped. Do some other stuff>

Link to comment

Usually you abort a script with "return". Ofc, that doesn't stop it from running the next time it's supposed to run, which you'll have to do depending on the script type: stopquest for quests, dispel for spells, etc.

 

If you're looking for other ways to optimize your structure, you can always pm me the scripts and I can have a quick look.

Link to comment

Time for another scripting question.

 

As some of you might know I've build massively large scripts to do outfit swapping, and I'm getting signals from users that their old computers can't handle my massive scripts (users are getting performance problems in-game). So I want to optimize my scripts. One of the solutions I'm thinking of, is that once I've found the outfit and done my thing with it, I'd abort/exit/kill/terminate the script. I know this is possible in a lot of scripting languages and programming languages, but I'm wondering if the GECK-scripting language can also do that.

 

Does anybody know the command to exit a function or script immidiatly?

 

 

<Some stuff happens before this>

    if GetEquipped OutfitUniqueMerc05

            SetFunctionValue to OutfitUniqueMerc05

           <Terminate/abort/stop the script/function here>

    endif

    if GetEquipped OutfitUniqueMerc06

            SetFunctionValue to OutfitUniqueMerc06

            <Terminate/abort/stop the script/function here>

    endif

<If user has none of the x-types of outfits equiped. Do some other stuff>

 

Yeah that's probably a good idea, I thought of adding returns earlier but had reached script size limits :)
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