Jump to content

Recommended Posts

Posted

Solved.

______________________________________________________________________________________________________________________________________________________

 

So,

 

I've this script (added the corrections already, wrong code still there as comment):

 

  Reveal hidden contents

 

 

Everything works as intended.

I actually already skipped this step and continued with my container (of which I recently opened a topic), but now I checked the console after activating the farm tools.

Tons of errors.

WHY?

 

Working script, but I still get spammed with error messages in the console?

This is preposterous!

 

 

 

 

In addition:

Hm, it may be jazzi's angel dust... ehm JIP LN, which allows me to have working message boxes and functions, when there is a script error.

However, I still don't get why the script actually works as intended when there are errors.

If that's all JIP LN NVSE plugin's fault then this is not just a simple gamefix and NVSE enhancement, but a magic moving caslte. oO

 

Yet is there a way to turn off these annoying messages?

Posted (edited)

I would start adding print checks after everything. If it's not giving you anything more specific than which script has the error, you should still know which line is causing the problem by the order in which things are printed to the console. So, for example, if there are print checks every once in a while, and the first error occurs after the print check that you know is at line 12 but before like 18, you can look for Let lines in that range. That's how most code trouble-shooting is done if the problem isn't obvious at first glance. Or at least, that's what real programmers (as in, people that are not myself) have told me more than once. And what errors are you getting? Are they all the same? What do they say and when do you get them?

 

Edit: Hadn't remembered to watch the video first. I don't really have time to look through that whole script unfortunately, but I'm getting that at some point, you must have forgotten to do a check that makes sure you're not using an empty variable somewhere. This could be of use, or you may know everything that's here:
https://geckwiki.com/index.php/NVSE_Error

Edited by EPDGaffney
Posted

Please see the 'TIP: Debugging data to file' and 'TIP: Pass a variable number into a script message' entries under the "Scripting" section of the wiki "Getting started creating mods using GECK" article. As suggested, those are the most common and useful methods of debugging similar problems. (It's not uncommon for debugging statements to outnumber the number of actual code lines.)

 

-Dubious-

Posted

Well thanks for the input. :smile:

 

The thing is that I actually didn't even know about the issues as when I tested the function, everything worked.

I simply didn't check the console until now.

 

Basically I would love to clear all console messages. XD

I mean the game doesn't crash and the function works as intended.

Still "LET" produces console entries. -.-

 

This really doesn't make sense, but I'm gonna use some console prints to check which exact LET does have "issues".

Thanks you.

 

 

 

In Addition:

Much, much thanks again to get me into looking over it again.

Fault was on my side. Actually, when I got instructed into scripting I was told to destroy a string variable everytime after usage by

Let myString := sv_destruct

Which was of course the wrong syntax. :awkward:

sv_destruct myString

Error message gone now.

 

 

My apologies to "LET". You're a fine function. :D

 

Oh, I've also updated the script in the OP, by making "comments" of the wrong code and including the working fix.

Posted

Those are what we call "non-fatal errors". They don't break the program/script, but are still things that should be corrected as they mean things are not going to work quite as desired. Be happy you caught them now. The vanilla game and DLC are riddled with them.

 

-Dubious-

Posted

Is it possible you confused strings and arrays? Arrays are nullified with

Let aArray := Ar_Null

Thanks for commenting the code with the solution. Someone's life will probably be easier one day.

Posted
  On 7/1/2018 at 2:01 AM, EPDGaffney said:

Is it possible you confused strings and arrays? Arrays are nullified with

Let aArray := Ar_Null

Thanks for commenting the code with the solution. Someone's life will probably be easier one day.

Actually my "mentor" told me to do that.

Maybe he confused it with Oblivion? He did a lot with scripts there too. Guess if that's a legit syntax there he simply took it over which is wrong in the case of NV.

 

I don't know, I am just happy that I will do one mistake less in the future. ^^

 

 

 

Even though it has nothing to do with the topic, it's still about the same script...

I've added some additions to the plant activation:

 

 

  Reveal hidden contents

 

 

The highlighted code will ensure that the plant is already harvested (without the player knowing he had a plant in his inventory as "ClearMessageQueue" removes the pending "AddItem" message from the activation.

Yet, I've an issue with the plants performing "OnReset", everytime I enter a building and get back out.

Normally they should respawn in 3 days, no?

 

This happens with all exterior plants. Only the mushrooms in the basement stay harvested after a few visits.

But outside they regrow as soon as I enter and leave the house.

 

Is that normal vanilla behavior? As I haven't used any other plant activators than vanilla there.

Posted

Ah, just figured a solution. It may need a bit work in worldspace (ugh), but I'll create now an unique activator for any plant instead of using the vanilla one.

These ones will have the highlighted addition to the code:

 

 

  Reveal hidden contents

 

 

Now the plants can only be harvested every 3 days.

 

 

 

Interesting observation:

I just checked the plants behind Doc Mitchell's house.

The Agave, the Maize both don't respawn, when I enter Doc's house or any other.

 

The difference to my plants is, that these are persistent references and initially disabled, but the ones behind Doc's house only generic ones. So maybe that has something to do with OnReset firing too early.

Seems the regular script works on regular plants, but unique ones will respawn over and over. With the awkward exception of having unique plants inside an interior, but these don't fire up the OnReset block wrongfully.

(Well I've still added that failsafe to the script of the mushrooms. :tongue:)

 

One more reason to make them real unique activators. :smile:

 

 

 

 

Another addition:

Alright, I scrapped OnReset and switched to GameMode.

Even though that's not recommended as it is firing everytime, but there are only 2 conditions to be taken care of.

First the State then the days passed.

 

So with this low amount of plants it is acceptable.

 

 

A pitty, that OnReset doesn't run properly.

Posted

OnLoad and OnReset are both unreliable, I will ask jazz for something like On3DLoaded that should work, and maybe he can fix OnReset.

 

I had the very same issue with plants respawning and DLC has the same issue.

 

Now if only the picking sound wouldn't always get overridden with the default take sound...

Posted

Hey Roy, that would be awesome. :D

 

My enhancement of the house mod actually is relying onto some JIP LN functions, so it will be perfect to have a functional OnReset block too with that DLL plugin.

Hopefully jazz finds some time for. :smile:

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...