Jump to content

[Solved]Papyrus Help Requested for unusual problems


fishburger67

Recommended Posts

I am nearly ready to release a mod based on Sexlab.  I have encountered two problems that I cannot solve although I have worked around both.

 

Problem 1:

 

Creating a Faction Property xys (ex. CurrentFollowerFaction) does not initialize at runtme even though the property names are exactly the same as the faction names and AutoFill works fine.  I added 6 fractions to a 1000 line script with 26 total properties.  All the properties except the faction properties initialize correctly, even ones added after the faction properties.  They show up in creation kit correctly as initialized like the 20 other properties that work fine.  I worked around this by creating a second script with the same factions and added a getxxx() (ex.  getCurrentFollowerFAction()) funciton to get the faction and then in the main script did (GetOwningQuest() as StorageScript).getxxxxFaction().  That works and I can initialize the unitialized factions just fine like this, but it is a really messy cludge and I would like to understand why these properties are not correctly initialized at runtime.  I have no clue.

 

Problem 2:

 

I have an Actor script that subclasses OnHit().  The purpose is to do things differently when the player is hitting the NPC and the weapon they are using causes minor damage (spanking).  I was doing something like this:

 

            ;if((beginningHealth > 0.00) && ((beginningHealth - ourHealth) > 10))
                ouch()

 

This works for non-followers.  I tried it with followers setting actor.IgnoreFriendlyHits(false), but after a few hits, the actor leaves my service even though the damage was 2 per wack.  I worked around this by doing weapon.getBaseDamage() instead of a health based check, but that does not do exactly what I wanted.  Anyone know how to prevent a follower to from leaving your service when you hit them too many times?

 

Thanks in Advance

Link to comment

For 1, did you start your mod (as in the quest with the script) on that save with an earlier version and then added that faction property, continuing with the same save? Properties added to quests while they're running won't get filled ingame. You need to manually stop and restart the quest through console, or do this in a version upgrade script so updates won't break it for users.

Link to comment

For 1, did you start your mod (as in the quest with the script) on that save with an earlier version and then added that faction property, continuing with the same save? Properties added to quests while they're running won't get filled ingame. You need to manually stop and restart the quest through console, or do this in a version upgrade script so updates won't break it for users.

 

That is exactly what I did.  I am adding to this mod continuously as time goes by and it takes like an hour to get to the point where I can test the newly added content, so I saved the game near where the testing was needed.

 

Thanks a load for the information.  Is there some documentation and/or an example on a "version upgrade script" somewhere where added properties will get filled correctly?  I found an example using fVersion, but not how to force a refill of the properties.  Is this as simple as just doing a quest.stop() and quest.start() and have the quest stage remain where it was?  That is what is done in zbfConfig.

 

Thanks in advance this is a big help as I have other similiar kinds of issues where working scenes no longer play even though I rebuilt the SEQ file.  I am betting that it is related to this.

 

Link to comment

If your mod has an MCM menu, you can just piggyback on its versioning scripts (refer to the mcm documentation), just have it stop & restart your main quest during version update. The properties will get filled normally any time the quest starts.

 

For a simple one time solution, you could also make an update quest with "start game on" which only has the startup stage and on that has a script to restart the main quest (and preferably stop itself as well). The downside with this is that you need to make a new quest or at least rename the one for every update to force it to restart the main quest.

Link to comment

Thank you Srende.  My mod does not currently have an MCM menu, but I guess I will add one if that fixes it.  However, the mod has 2 main quests and 5 subquests, so this thing might get a little overwhelming.  I think I will explore first the fVersion code I have seen and stop and start the quest myself in a Maintenence() routine.  This appears to only be a problem when you add properties to a running quest, so that might be best.

Link to comment

For those of you like me who are not too experienced with this, this problem turned out to be as simple as just regenerating the SEQ file.

 

After that, all the all the dialogs magically showed up again.  I should have known better because missing dialog options has plagued me from time to time and I always forgot to regenerate the SEQ file.

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