Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

That is a "known" bug in FNVEdit. Update to the "nightly" version available here : https://docs.google.com/file/d/0B4rR0C-Bcx_JYkhBUERWYWE0T2M/edit?usp=sharing

 

Hello... was this ^^^ for me?

If it was... I tried it but it gives the same error.

 

This is the error, with the record reference, and to what I think is corrisponding in game (don't know a way to check if it's true):

 

http://www.mediafire.com/view/myfiles/#0f71850vx5218f6

 

It's the only DELETED topic that remains when I reload the esp, so I think it was a vanilla record... but it was empty, this confuses me. I just hope I didn't do any damage.

Link to comment

The last version corrects the handling of misplaced INFC.

The deleted "record containing data" is in fact an error. Whichever tool made the change should have purged those fields.

I think, you should be able to clean the esp by removing the deletion, copy as override the original record, and then flag the copy as deleted.

 

By the way, I'm pretty sure the game engine will ignore the fileds as soon as it has detected the record is deleted.

Link to comment

Is there some kind of limit on the number of spells that can be running on an actor?

 

EDIT:  Sorry to be a bother.  Dumb mistake on my part.  I was reworking some scripts and changed one from a token to a spell but forgot to change getcontainer back to getself.  Doh!  No wonder it wouldn't run.  I reject the notion that I'm getting too old for this. lol

Edited by t3589
Link to comment

Lately I've been merging / remaking mods for my own game to shorten the load order a bit as it became a bit unstable. One of the things I've been working is so-called Armor Switcher.

 

How it works:

I currently use 2 different armor replacers, T3M and T6M, and I want armor to change to T3M whenever my character equips it and to T6M whenever any other NPC has it.

I made a first version of the script which just switched the armor regardless of the health it had. I then "upgraded" it to this version, which checks health of the current armor and sets health to new one.

 

Now I'm curious how to make the script to "target" anyone in the same cell as the player, so I don't have to add the token to every single NPC in the game. I google'd a bit, searched this forum, but didn't find anything I thought I could use. And, would it be better if the script is run through a quest?

ref rArmor
int ArmorCurrHP
int ArmorMaxHP
float HPPerc

Begin gameMode
    if player.GetEquipped ArmorLeather
        set rArmor to player.GetEquippedObject 2
        set ArmorCurrHP to player.GetEquippedCurrentHealth 2
        set ArmorMaxHP to GetHealth rArmor
        set HPPerc to (ArmorCurrHP / ArmorMaxHP) * 100
        player.AddItemHealthPercent T3MArmorLeather 1 HPPerc 1
        player.EquipItem T3MArmorLeather 0 1
        player.RemoveItem ArmorLeather 1 1
    endif
End

For any help you can provide I'll be grateful...

Link to comment

I've been through this with damaged armor & preg body swapping, I think you need some sort of scanner to add it to other actors within a distance of the player and same cell. I added it to an effect of the armor and added an effect where necessary to armors without them and that worked for all actors everywhere, I also hit problems when there was more than one of an outfit and storing the health of the worn outfit, though now I would use an NX variable to do so, I actually had the effect add a scripted token which did the swapping then deleted it self, look more into the damaged armor swapping in SCR, and I mentioned a few other issues earlier in this thread, I found that scripts run on NPC armor could cause CTD when adding objects to themselves for some strange reason, but it work for the player fine.

Link to comment

I already asked for something similar in a specific thread, but now I'd like to ask it more generically, I'd like to understand if it's a good practice to do.

 

I'm using GameMode scripts attached to quests. The script is usually regulated by a first peculiar condition, so it usually doesn't work. But the delay time isn't default, it is usually very low (between 0.01 and 1). So could make sense to make some purge script when those scripts are no more useful, with a simple "stop quest"?

 

Also, I've read to disable and mark for delete the Refs created by placeatme or they could create issues on savegames. Could it be useful also to do it to the other specific Refs I don't use anymore? I'm referring to those whom baseID has a gamemode script attached, so that I could stop the script as for the quest above.

 

Which possible consequences could have something like that? i.e. a declared variable in a script linked to a quest then called by another script as quest.var, I suppose it would be "null" if I stop that quest, or maybe not?

Link to comment

If you delete the quest any attempt to read the quest variable will CTD.

Anyway, don't worry, the vanilla game has already created way more refrences and quest that you can, you won't make a sizeable dent in your ressources unless your mod is huge.

 

Link to comment

If you delete the quest any attempt to read the quest variable will CTD.

Anyway, don't worry, the vanilla game has already created way more refrences and quest that you can, you won't make a sizeable dent in your ressources unless your mod is huge.

 

The mod itself isn't big (2+ Mb), but I've read a post above that was saying something like "unless you are using the default delay". I'm using short delay (till 0.01) gamemode blocks, my only concern is on this. Just to be sure, with "delete" are you meaning "stopquest questname"?

 

A quest doesn't need to be active for another script to read and set its quest script variables.

 

Sorry I just would like to not misunderstand... same as over here, with "active" are you meaning it wasn't stopped by "stop quest"? if it so, are you meaning it will stop the block types to run but still it will read my declared variables? I'm still trying to figure how a "complete/fail" quest is behaving, and a "stop quest" too. I'm having some hard time on this and I'm making a ton of getstage conditions until I won't be 100% sure, but it could leads to many mistakes I'd love to avoid...

Link to comment

Forget my remark, I was talking about removing the quest from memory which obviously cannot be done as it is not a reference.

 

As for what DoctaSax said, yes, when a quest ends (fail or complete or stopped explicitly), all the variables it defines are still available.

 

You can even make a quest that is never started, just to define some scripts variables.

Link to comment

So, just another stupid question.

 

I try to add a creature from my mod to one of the sexout formlists.

 

Tryed it this way in the Basic Questscript

if ( iDoOnce == 0 ) && ( aayGSBigHorner.IsInList SexoutCListBighorner == 0 )
	set iDoOnce to 1
	AddFormToFormList SexoutCListBighorner aayGSBigHorner
endif

So I thought I doublechecked, that the Bighorner is added realy only once.

 

But now neither the added Creature nor the other creatures work with the Sexout-Calls I made for them. (The vanilla bighorners worked before I tried this)

 

What did I do wrong?

Link to comment

1) Don't bother checking if your item is already in the list, AddformToFormList will do that anyway. :)

 

 2) AddFormToFormList takes a reference and insert the BASEFORM of that reference in the list.

 

if you want to insert a reference or directly a baseform, yous should use ListAddForm. But if you use ListAddForm, you will have to repeat the command every time you start the game (ie in a if (GetGameLoaded || GetGameRestarted) block.

 

Link to comment

Thank you!

 

I just want to add one creature, to call it like any other.

First I tried to add the Reference to the formlist, but this didn't do it (Ok, the vanilla creatures still did what they should) So I thought, my first attemt did do nothing.

 

So I will try it with ListAddForm next.

 

EDIT: Has this to be checked so it is added ony once, or is the GetGame ... enough.

 

NEXT EDIT: That did it, thank you once again! Have made Betsy happy now ;)

Link to comment

 

If you delete the quest any attempt to read the quest variable will CTD.

 

The mod itself isn't big (2+ Mb), but I've read a post above that was saying something like "unless you are using the default delay". I'm using short delay (till 0.01) gamemode blocks, my only concern is on this. Just to be sure, with "delete" are you meaning "stopquest questname"?

 

 

 

You can delete/rename the quest (or its variables) in the GECK, and if some other script or dialogue was referencing them then its bad bad news.

 

I assume you have a good reason for setting a quest delay of 0.01 seconds.. incidentally, if you weren't aware- I believe once per frame (30fps etc) is the maximum speed, so it won't actually be that fast and may vary.

Link to comment

Well, Odessa, you're right. 0.01 is definetely a short time. I mainly use Default time when I don't care, 1 sec when I want something happening now, and it doesn't require real time, and 0.01 when it does require realtime (like handling my cameras movements etc.). For what I've seen (better saying "for what I've feeled"), it handles these times as "I'll do it when you said that, but also when I'll be able". I.E. I can see a great difference with ENB on/off, or Fraps on/off, or during a combat, or when I playsound something. Till now it worked quite well, I didn't have unexpected consequences. I hope this isn't a wrong way to think and it won't cause save bloats.

 

About quests I did just some of the purges I wanted. There are too many stuff in game, I would risk some serious damage on savegames if I miss some detail.

 

And talking about damaged savegames... I post it here, maybe it's stupid but I didn't find it when I still didn't know the reason of the issue and tried to Google it. I started creating new cells in World-Cells instead of duplicating new ones like Bethesda says in tutorials. Well, if you forget to place a name on the brand new cell, when ingame you'll save inside of it your savegame will be automatically damaged, even labeled as "corrupted". Just to say... I didn't notice it was missing the name because it wasn't linked by a door but a Moveto Xmarker... grrrr it's like if I do everything I can to invent new issues... *laughs*

Link to comment

Maybe just a matter of taste, but which solution would be better:

 

I want to add a QuestStage to a NX variable, to enable a QuestStage check by an external Mod.

 

I could put this in the Questscript

 

    set iQuest01 to ( GetStage aayQuest01 )                                   ; Quest-Stage to variable
    PlayerREF.NX_SetEVFl "MIMO:Quest01" iQuest01                        ; Quest-Stage to NX

    ( something like PlayerREF.NX_SetEVFl "MIMO:Quest" ( GetStage aayQuest01 ) doesn't work )

 

Or I could add a

    PlayerREF.NX_SetEVFl "MIMO:Quest01" 10, 20, 30 ... 255

 

to every Quest stage.

 

The first solution would add only two lines to the whole mod and it could be changed by changing only those two lines.

But it would be executed every 5 seconds (if the quest has the standart quest delay) whether the stage is changed or not.

It would be a waste of processor time.

 

The second solution doesn't look so smart. It would be a (tiny) little more work to be added or edited. But it would run only if the QuestStage changes.

 

So? How would you do it?

Link to comment

I the quest script, check if QuestStage has change, then update it. This way you cannot forget one stage.

 

As for the overhead, checking 2 variable and setting a memory location evrey 5 seconds won't be noticed at all.

SexoutNG has the scanner running every tenth of a second, and I personally have quest runniing checking big list on every default quest script interval with no visible effect. Only time I noticed script slowing things down is when I spent too much time manipulating the inventory of all actors in close cells.

Link to comment

Toady I haven't another question.

 

I just want to report about another stupid mistake, I made ...

... and it took me hours and hours to figure out, what I did wrong.

 

Because I has overseen, that I put this nonsense into a quest script:

; === external BH count up from NX to mod counter

    if PlayerREF.NX_GetEVFl "MIMO:Cownt" 1
            PlayerREF.NX_SetEVFl "MIMO:Cownt" 0
            set iCow to iCow + 1
            set aayMiMoPerkQuest.iSexEffect to 0
    endif

What did happen?

 

Neither GeckPU nor F:NV itself showed any error. And F:NV ran as 'smoth' as before.

 

But this questscrips wasn't executed any five seconds, as excepted.

It ran only once: At starting the game and loading the savegame.

Not even loading a savegame didn't start the quetsscript again.

 

Maybe this is helpfull for other noobs:

Allways look, what you are doing. Not any scripting mistake you make leads to a error in GeckPU or to a crash of the game.

 

:)

Link to comment
  • 3 weeks later...

Found another fun way to crash a script today

 

Oh and if you have debug messages please prefix them with something indicating your mods name so if they are annoying to other modders debugging their scripts we know what to disable.

 
Set rRef to NVFakeGolfBall
 
if rRef.GetIsCreature != 1
 
<Do Stuff with actors>
 
endif
Link to comment

I remember in Skyrim there was a mod that was allowing me to cut trees if there were near me. I suppose this is some sort of "scanner" that checks if trees are near. Is it possible to do something like that in NV too? or, more generally speaking, how a "scanner" script works?

Link to comment

I remember in Skyrim there was a mod that was allowing me to cut trees if there were near me. I suppose this is some sort of "scanner" that checks if trees are near. Is it possible to do something like that in NV too? or, more generally speaking, how a "scanner" script works?

There's NVSE commands called GetFirstRef & GetNextRef and you can set the parameter to look for objects by type in the list, I'm playing with it at the moment trying to get NPC's and it sort of works

Trees are number 37

http://fose.silverlock.org/fose_command_doc.html#GetFirstRef

 

My scanning script is in my thread

http://www.loverslab.com/topic/24208-questions-on-packages/

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