Jump to content

Fallout New Vegas GECK & Scripting Help 101


Recommended Posts

Posted

At that time, when the ref is searched for the baseform it doesn't have one listed, so no script and no variable.

How the ref can exist without a baseform is an "interesting" issue.

 

Guest tomm434
Posted

This is indeed Interesting but I though that GECK just didn't find a variable in the reference(due to incorrect search pattern or something)

Posted

I have a small question regarding AddToLeveledList, should it always be avoided at all costs? I know that if you use it to add something and then want to remove a mod it leaves those things in the save. However, it is a very useful function if you ask me, especially if one looks to avoid compatibility issues. There isn't an NVSE version of it or something similar that doesn't have that downside is there? I'm not really using it but I can see how it could come in handy. 

 

To be honest I'm of the opinion that if the mod is heavily scripted, then no one should be removing it mid game. The reason I don't  use that function is because I don't want to screw myself when testing and not being able to remove something without having to restart a game in order to test things. 

Posted

Maybe someone else can confirm this but I think the description of GetRace is wrong in a few places

 

set rRace to GetRace rPartner

compliles fine but causes CTD on excecution

 

set rRace to rPartner.GetRace

 

works fine

Posted

I have a small question regarding AddToLeveledList, should it always be avoided at all costs? I know that if you use it to add something and then want to remove a mod it leaves those things in the save. However, it is a very useful function if you ask me, especially if one looks to avoid compatibility issues. There isn't an NVSE version of it or something similar that doesn't have that downside is there? I'm not really using it but I can see how it could come in handy. 

 

To be honest I'm of the opinion that if the mod is heavily scripted, then no one should be removing it mid game. The reason I don't  use that function is because I don't want to screw myself when testing and not being able to remove something without having to restart a game in order to test things.

Probably depends on what you are adding if they are vanilla assets they are there forever but if they are assets from a non-vanilla mod then a clean save should fix it.
Posted

 

To be honest I'm of the opinion that if the mod is heavily scripted, then no one should be removing it mid game. The reason I don't  use that function is because I don't want to screw myself when testing and not being able to remove something without having to restart a game in order to test things. 

 

Agree with you, but then when I was playing NV I was doing it all the times :P

 

What about a simple uninstall script that does the contrary, to run before uninstalling the mod? I think it would be a win win. I saw that in some Skyrim mods and I did it in NV few times. When the player is ready he starts a procedure that does the contrary of the init script, then he saves, quits and untick, with a clean save everything should be clean.

Posted

Maybe someone else can confirm this but I think the description of GetRace is wrong in a few places

 

set rRace to GetRace rPartner

compliles fine but causes CTD on excecution

 

set rRace to rPartner.GetRace

 

works fine

 

GetRace rPartner expect rPartner to be an NPC, not an actor (reference).

rPartner.GetRace expects rPartner to be a reference.

 

It definitively could be written better.

Posted

 

Maybe someone else can confirm this but I think the description of GetRace is wrong in a few places

 

set rRace to GetRace rPartner

compliles fine but causes CTD on excecution

 

set rRace to rPartner.GetRace

 

works fine

 

GetRace rPartner expect rPartner to be an NPC, not an actor (reference).

rPartner.GetRace expects rPartner to be a reference.

 

It definitively could be written better.

 

Ah, thanks for clearing that up :)
Posted

The issue with Let in OnEnd scripts came from the fact that the definition of a reference did not account for the differences between the Editor and the Engine (one more field in the Editor). It should be corrected in the next version of NVSE.

 

Anywhere else Let is acting very weird ?

Posted

FWIW, it was the End Result for a Package.  Can't speak to End Result on dialogue, and I don't know if there are other forms with script windows (as opposed to manual scripts, if that makes sense).  I'm sure that I don't have to tell you, but there are the Begin/Start Result and the other one for Packages.  Just a consideration if the issues might need to be corrected for the other types.

 

If you want me to test the update, I can if you send me/link me the beta.

Posted

It's not built yet :), and where the syntax is called should not matter for that issue. It's more about finding all the "loopholes" in the ParseArgs function.

Posted

 

 

It's even worse now. The current version requires a NPC but only accept a reference as a parameter :(

so the only way to make it work is:

let aNPC := Veronica

let aRace := GetRace aNPC

 

Next version should be friendlier.

 

Guest tomm434
Posted
Anywhere else Let is acting very weird ?

Of course! I keeo reputation points for my companion in her object script and "Let" doesn't work inside dialogues script.

Posted

 

Anywhere else Let is acting very weird ?

Of course! I keeo reputation points for my companion in her object script and "Let" doesn't work inside dialogues script.

 

 

Exact syntax please ? Also try with NVSE 4.5 Beta 5 now.

Guest tomm434
Posted
Exact syntax please ? Also try with NVSE 4.5 Beta 5 now.

yes! with beta5 "let" works!

Guest tomm434
Posted

jaam, if I declare a variable inside dialogue script, will it be destroyed after script is finished?

Posted

You should not declare variable inside dialog script. It does not have the means to allocate the variable or it doesn't do it properly. So you are going to overwrite the first variable in your quest. :(

 

Instead declare the variable in the quest script.

 

Guest tomm434
Posted

You should not declare variable inside dialog script. It does not have the means to allocate the variable or it doesn't do it properly. So you are going to overwrite the first variable in your quest. :(

 

Instead declare the variable in the quest script.

 

Is that really neccesary? SOmetimes I need to do things with quest references so I type

ref mutant

set mutant to aamutant.mutantRef
mutant.disable

How can I do it another way?

Posted

 

You should not declare variable inside dialog script. It does not have the means to allocate the variable or it doesn't do it properly. So you are going to overwrite the first variable in your quest. :(

 

Instead declare the variable in the quest script.

 

Is that really neccesary? SOmetimes I need to do things with quest references so I type

ref mutant

set mutant to aamutant.mutantRef
mutant.disable

How can I do it another way?

 

 

 

scn MyDisableUDF

 

ref somerefvar

 

Begin Function {somerefvar}

 

somerefvar.disable

 

End

 

 

 

call MyDisableUDF aamutant.mutantRef

Guest tomm434
Posted

Brilliant! thanks.

Posted

 

 

 

It's even worse now. The current version requires a NPC but only accept a reference as a parameter :(

so the only way to make it work is:

let aNPC := Veronica

let aRace := GetRace aNPC

 

Next version should be friendlier.

 

Hmm I'm using Set instead of Let:

 

Set rPartnerRace to rPartner.GetRace

if (NX_IsInList CausasianRace rPartnerRace)

<Do Caucasian Stuff>

endif

 

and it seems to work fine.

Guest luthienanarion
Posted

Here's a good one for you coding gurus:

 

I'm trying to output the list of hairs available to a race to the log in an NVSE plugin function. I've walked tLists plenty of times before, but not tLists of pointers.

TESRace* race = NULL;
ExtractArgsEx(EXTRACT_ARGS_EX, &race);
if(race)
    for(tList<TESHair*>::Iterator iter = race->hairs.Begin(); !iter.End(); ++iter)
    {
        TESHair* hair = *iter.Get();
        _MESSAGE("%04.0f :: [%08X]", hair->hairFlags, hair->refID);
    }
}

What I end up with is garbage values being output to the log, as my 'hair' pointer is obviously not pointing to the right data.

The 'iter.Get()' call returns a TESHair**, and I'm definitely not handling it right. Oh, pointers...

Posted

 

 

To be honest I'm of the opinion that if the mod is heavily scripted, then no one should be removing it mid game. The reason I don't  use that function is because I don't want to screw myself when testing and not being able to remove something without having to restart a game in order to test things. 

 

Agree with you, but then when I was playing NV I was doing it all the times :P

 

What about a simple uninstall script that does the contrary, to run before uninstalling the mod? I think it would be a win win. I saw that in some Skyrim mods and I did it in NV few times. When the player is ready he starts a procedure that does the contrary of the init script, then he saves, quits and untick, with a clean save everything should be clean.

 

 

I've heard of that. I might look it into it with future mods. I expected more people telling me to not use AddToLeveledList to be honest, I've heard a lot of people say its bad to use it. 

Posted

I've heard of that. I might look it into it with future mods. I expected more people telling me to not use AddToLeveledList to be honest, I've heard a lot of people say its bad to use it.

I've used it a lot, in the end it's the only way to do things sometimes

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...