Jump to content

Variable questions... Still? :D


A.J.

Recommended Posts

I'm following the useful advices on the 101 scripting help page. But after setting the load multiple masters on, I did a bad mistake. A master file from an external quest mod I installed decided to automatically tick while loading my esp in my geck. I didn't notice it at first, it was in the middle of the list, my esp chained to that esm, I've seen weird consequences ingame and I'm not sure this is the reason. But well, to make long story short, this made me wonder a lot about this, mainly for understand better the compatibility/conflicts with other mods. Now think that my own esp and that other quest mod take place in two different places away from vanilla. Also think that playing that mod I've met bugged things that stopped me from playing quite soon. And I'm sure that mod is good (very well endorsed) so I suppose I created these issues. Also think I don't use vanilla contents usually, I duplicate them giving a new (very peculiar) ID. Well an example of weird things happened is this: that external quest mod teleports me in that little room where in the vanilla at the end of the game it shows you some slides while a narrator speaks, but of course with the mod custom slides that introduce you to the quest. Well, I could freely roam around the room, I don't think the modder forgot a disableplayercontrols or what.

 

But the most interesting thing was this interaction between my esp and that mod: "my_own_trigger" sets the "my_own_quest.dialogue_behaviour_variable" of "my_own_npc" to 1, so he'll speaks to me. Instead, this unexpectly made the other quest mod starting. Now, I really didn't want to look at that external mod deeply. But what I'm wonder is:

 

1) is it possible that a specific variable in this form "MYPECULIARQUESTNAME.MYCOMMONVARIABLENAME" can create conflict with "ANOTHERQUESTNAME.MYCOMMONVARIABLENAME? i.e. quest1AHAHAHAH.talk and quest2NONONONO.talk - PS while I can use common var names, my peculiar quest names are really peculiar, it can't happen to see 2 like them. While I'm aware they SHOULDN'T create conficts, what I'm asking is if there are known unexpected but common reasons/scenarios where they can create issues, things I should avoid (like putting numbers before names...)

 

2) in some guides I've seen, they make simple scripts where they set a doonce variable inside a script, then they place that script on a trigger so that the trigger will work just once. Since they don't refer to any quest (quest.variable) I suppose this doonce variable can't interact outside that script itself. Is it true? or if I load more mods there's the risk that some generic variable name is used in another script and trigger it? what happens if 2 or more scripts, even from different mods, run in the same moment and they all inside use common name variables without referring to a specific quest?

 

They are probably obvious questions but I really would like to do the right things, as you all know doing a simple mod can require a big amount of time and noone likes do it again and again because of silly mistakes (like putting numbers before names...yes it really stuck in my mind :D ) or, worser, finding the mod could be incompatible with most of the other mods for reasons outside editing the same cells.

 

Thank you

Link to comment

Other than referring to a variable that shares an editorID with a global, or the bit about leading numbers that you know of already, there's not much that I know of that would cause quest variables to become 'detached' from the quest script they belong to, and by extension the mod they belong to.

But having this master of the other mod accidentally added to your own mod's master list (most likely a .nam issue, delete all .nam files you can find in your data folder) can cause problems indeed. First step is getting rid of it with FNVEdit.

Link to comment

There is the issue of using local variables withinin dialogue overwriting the variables of scripts attached directly to NPCs.

 

Another possibility is that if you duplicated an NPC and are referencing the duplicate with the Base ID, you'll get the original, not the duplicate.

 

Also if you've duplicated an NPC, the duplicate could still be using the original's attached script.

 

Also if you've copied a trigger to make your own trigger, it's possible your trigger was parented by a a linked set of triggers. So activating your trigger does an activation of others.

Link to comment

Doctasex

I got rid of the Master dependencies by TESSnip deleting the MAST that wasn't FalloutNV (FNVEdit wasn't loading anymore my esp, it was giving error... it was my fault), what I see now is that loading on FOMM I don't see the dependency anymore. I tested the quest and it seems everything ok for now, but is there some other thing I can do to check it? I mean if there could be "hidden" consequences I'll notice just later.

About the .nam files, that mod had one, opening it with notepad I've seen there was only the name of the quest and a link to a facebook... I really ignored that, is it important?

 

Astymma

I would like to fully understand what you wrote, because I duplicate often my NPCs.

Do you mean if I duplicate GHOUL and give him a MYGHOUL id, then if I make calls to MYGHOUL it still points to GHOUL instead? I would use a MYGHOULREF call inside a script, but I use the MYGHOUL base ID as condition in dialogues, (i.e. the simple GETISID in the Greetings) so I think understanding this point is very important.

And about the attached script, you mean even if I remove it on its page, choosing NONE?

I don't mind creating some brand new NPCs, but they still don't fight as I would like, mainly they don't shoot but fight melee, so I'm duplicating range npcs hoping that this will solve. On a brand new NPC, I've put a gun, some ammos, a ranged "combat style" and a range "class" on the first page, and used the same AI packages range npcs use (these all are copied by Ranged Raiders). Still, he takes a knife on the floor and prefers using it. It makes no sense for me, maybe he can't use the gun but on the GECK preview he draws that gun so at least I think he could use it. The only thing I'm wondering is that I'm using the level multiplier instead of manually placing stats, I'm doing that because I think it could give different challenges concerning the PC level, but I don't know if this also means he could be specialized in melee instead of range and this creates the issue...

Link to comment

As far as baseid issues, it's only really a problem with templated NPCs. I.E. you've templated a reference to copy it's appearance/etc..

 

If an NPC has an attached script, like say Cass who has RoseofSharonCassidyScript [sCPT:0013408C] in the NPC record, if you copy her and don't remove the script entry for your NPC, your new NPC will be running her script in addition to her running it.

 

As far as your NPC, post an esp and we can take a look.

Link to comment

Doctasex

 

I got rid of the Master dependencies by TESSnip deleting the MAST that wasn't FalloutNV (FNVEdit wasn't loading anymore my esp, it was giving error... it was my fault), what I see now is that loading on FOMM I don't see the dependency anymore. I tested the quest and it seems everything ok for now, but is there some other thing I can do to check it? I mean if there could be "hidden" consequences I'll notice just later.

 

About the .nam files, that mod had one, opening it with notepad I've seen there was only the name of the quest and a link to a facebook... I really ignored that, is it important?

Nam files auto-load the plugin they belong to in the geck when you're working on whatever. They're a pain in the ass for modders, so delete all you can find.

To further check whether the master left behind breakage upon removal, you can "check for errors" on your mod in fnvedit as a first scan.

 

Astymma pointed out some good extra possibilities for variable breakage I didn't think of at first. So yeah, don't declare variables in dialog result scripts, and get rid of object scripts on duplicated npc's.

Inconsistencies in fighting style could just be due to a lack of ammo, instead of packages?

Link to comment

Actually .nam files are empty. So you can delete everyone of them you don't want and create your own, if you want the GECK to automatically select your plugin at startup. Just create an empty text file, name it "yourexactpluginname.nam" and put it in your data folder. I did this for my plugins, for instance if you want the GECK to automatically load SexoutWillow, you need a "SexoutWillow.nam" file.

Link to comment

Thank you for the answers, these are really precious for me. And now I finally understood why the DLCs and that mod were automatically ticked in GECK (they all had that .nam).

I won't use templates anymore, I'm sure I'll forget to check the scripts attached and I'll do a mess.

Seems that now the inconsistencies during the fight are over, I checked every npc manually copying all the fields from other vanilla npcs. The only one that was remaining was one using a sawedoffnpc weapon, replacing with sawedoff and giving him ammos did the trick.

But still, packages confuse me a lot. I'm sorry to come back to this same subject but... I just spent the whole night trying different packages on a npc and they don't work as I would like. There's still something I miss, probably there are many problems overlapped that make me not understanding what the real cause is.

 

This is the scene: PC enters in an apartment, he arrives in a zone trigger, the npc (owner of the apartment) appears just outside (but in the same cell, we're speaking about 10-15 meters radius) and run to PC, after a little dialogue (what are you doing here!etc.) he attacks the PC. It would seem quite simple, but it doesn't work.

 

Here what I did:

- setting a 2 stages variable, tied to 2 packages of this NPC (dialogue and fight)

- the trigger zone sets him enable (he was disabled)

- After the dialogue he starts to fight correctly (removing player friend faction etc. as result script) so this part should be good.

 

My issue is that when he goes enabled, he doesn't look for the player. Worst, sometimes he does, other times he doesn't.

 

What else I did:

 

- Changed Dialogue package with Travel (it's written that if reference is a npc, he should start speaking after reaching the target). It was working, again, WHEN he was looking for the player. Sometimes he wasn't, exactly when I was passing the trigger zone faster and going a bit far away, maybe too far for him to know where I was, I dont know.

 

- Introduced a third value in the variable, so: Travel (to PC and to a Marker hypotetically near the PC, I tried both) -> Dialogue -> Fight. Used the conclusion of the Travel package itself to change the state of the variable to Dialogue. Same as before, sometimes good, others not.

 

- Attached a script to the npc: if distance from player is < than (I tried many values, from 50 to 500) then set the variable to Dialogue mode. Changed many radius on packages, both Travel and Dialogue.

What happens? Often he doesn't walk, other times he makes few steps then stops, other times he doesn't speak at all even if i approach him. Ok, you could say I took wrong radius for example, so why if I put 500 OR 50 on dialogue, he always speaks when I'm really near him, and not more far away? And why other times he NEVER speaks even when I'm near him? This really confuses me. A common radius for that situation would be 400, about the distance I use when a npc approaches me to speak to me.

 

It acts too much randomly. I mean if I reload he does different things etc. Oh, I always reload a save before entering that cell, before that part has ever started or npc spawned. I'm really thinking there's something else, like navmesh maybe. I still don't know how it could influence that, as I still don't know if I do it correctly, I just do it like I've seen in Beth tutorial and in few other tutorials around. But well we're speaking about a npc that sometimes doesn't go through a hallway, not some heavy cluttered space or a place with weird geometries. Also, I don't know if this counts, but to check how they act and move I put myself in god mode and move around the places with them fighting me, to see where they go or they don't, where they get stuck, etc. And it seems that in combat mode the npc moves very good.

 

A theory I had is that when he finishes his Travel state, even if he's near me there's something that blocks his sight, this prevents him speaking to me for a moment and everything else stops working. Or maybe, while in travel mode he sticks somewhere for who knows which reason, this stops the change of behaviours (that's why at a certain point I introduced that script comparing the distance of the player, to force another package to start).  I don't know if this makes sense.

 

If you can give me an advice I'll be very pleased. Just an advice if I took the good or the wrong way to solve this situation, maybe there's an easier way to do that. Also please tell me if you need more informations what else I should provide you. About posting the .esp, I would avoid it for now if possible, because I know how much is boring and a loss of time digging through other people's .esp and I wouldn't like to steal you all that time, think also that I started modding a month ago, so I'm still not very clean and well-ordered while doing things on GECK, so it's twice a suicide digging on it...

Link to comment

If a dialog package doesn't perform as it should, especially with the distance at which the dialog triggers, try a travel package + "startconversation" in the travel package end result script. With radius and a moving travel target, flags like must complete/reach location sometimes end up doing the opposite of what they're supposed to do. Detection can also factor into all this, stats like perception, even lighting.

Navmesh could be a factor, or not. I don't know much about it, other than it's some mystic shit that can trip you up in unimaginable ways. If it's your own cell, it could help to mark the triangles you want him to use as having priority, but I'd stick with focusing on the packages/scripts/ai side.

 

In general, I'd say:

- look in vanilla or another mod for a scene that does something similar & have a good look at how that works. The difference can be a detail.

- don't be afraid of adding in an extra layer of security in the form of a script that checks the current package/procedure & reapplies. It can also just give you an idea what's going on if you add in some printc's or debugprints just so you know how things are breaking. The same goes for printc's on the package result scripts.

- don't let it get to you. Everybody can struggle with packages, experienced or not. All experience teaches you is that you can't expect it all to work from the start.

Link to comment

For your packages that you want to kick in and do as expected, make sure you uncheck "enable fallout behavior". Also check "continue if pc near" if the PC is the intended target.

 

The standards also apply: "must complete", "must reach target", "always run" if desired to run, "no idle anims", "weapon drawn" if desired, "continue during combat" if you want them to close to melee before attacking. Also check the door options if you think the PC might flee through a door.

 

Be aware that immediately after a package completes, EVP is done to the actor by the engine so if you add a new package too soon, the EVP will drop it and the NPC will go into their default package instead (probably an IDLE).

 

Generally you want to have your "action" packages be the non-default package and then set conditions on them such as quest variables. For example MyQuest.QuestStage is a variable, default package has a condition of that variable==0, speak dialogue at player package has a condition of that variable==1, moveto player package has a condition of that variable==2, attack player package has a condition of that variable==3. In the trigger set the variable = 1 and call EVP. The end state for the dialogue package should set it to 2 and not call EVP. The end state for the travel to player package should set it to 3 and not call EVP.

Link to comment

I've just read this last message when my hopes were painfully afflicted by frustration... and it solved my issues. One of these checks did the trick, but I want to add something more, since I spent something like 8 hours in this silly thing.

 

I tried the startconversation as suggested, it wasn't working, once I turned fast and I saw him speaking to Veronica (?) even if I also tried the full sentence npcREF.startconversation player greeting (I tried with and without npcREF., with and without greeting). There was something else. The npc was stucking, randomly, without doing his work. His head sometimes was moving very fast, and sometimes when I was near him, looking at him for seconds to see if something was happening, 3 dots were appearing (as subtitle) as he was speaking and saying nothing (I saw that happening in a quest mod once).

At the end, I destroyed everything, every package (why travel? let's make the npc moving with the dialogue package. Why fight? let's change faction by dialogue), and left only the dialogue package. I have the same situation with another npc, and it is working, but it is in open space, in Freeside: a trigger that enables a npc, he runs to the player and the dialogue starts at radius. Here it was the same situation but it wasn't working. My explanation could seem very weird I suppose, I don't have the knowledge to explain this, but read what I did. I supposed my problems were the walls, collision, the only difference in the open space where this same thing was working.

Now, think at me in front of the door, when I enter it triggers and the npc appears some meters away behind me. Now if I stay in my place, he arrives and everything works. But if I enter in the room, everything breaks, and I find him middle way from where he appeared and where he should be if I stayed in my place (the radius to allow him to speak), moving his head fast and blatering 3 dots randomly. And here we don't have EVP, scripts, variables, nothing, only a single dialogue package. Now the weird thing, if I "pull" him in the spot where he HAD SUPPOSED TO BE, he starts to speak to me...

So I think the trick was the "must complete" or maybe "must reach location" (PC is his location reference) or something like that. But I really don't want to go deeper in this, for now.

I really thank you all for everything, I think I would have driven mad without your solutions. Or worser, give up.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • 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