Is there a trick to getting properties to work right?

Post » Mon Nov 19, 2012 3:33 am

Ok so since dawnguard I've been having problems left and right adding spells and perks to the player. I have a feature that allows the player vampire to drink blood from dead bodies. It has always worked for months. Now suddenly it stops working.

Here's the code:
;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 24Scriptname PRKF__0100A98D Extends Perk HiddenPlayerVampireQuestScript Property PlayerVampireQuest  Auto;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akTargetRef, Actor akActor);BEGIN CODEdebug.notification("perk script fired")Game.GetPlayer().StartVampireFeed(akTargetRef as actor)(PlayerVampireQuest as PlayerVampireQuestScript).VampireCorpseFeed(AkTargetRef as Actor);END CODEEndFunction;END FRAGMENT

I can activate the dead body, get my "drink blood" dialogue, and even my debug text "perk script fired" works. However, my function VampireCorpseFeed refuses to do anything. It has worked forever, suddenly it doesn't work. My debug text within it does not fire. So my fragment is not successfully calling the function. Even though the function is there and it always worked. I noticed the property somehow came un-filled. I refilled it using auto fill, it filled the vampire quest just fine, but still nothing. I started a new character thinking the old character with the improperly filled function didn't work, same thing.

Are there any glitches or bugs known with properties? My vampire quest is conditional. I call functions from it from other quests and fragments just fine. Suddenly this doesn't work and I can't figure it out. Any help would be great.
User avatar
TOYA toys
 
Posts: 3455
Joined: Sat Jan 13, 2007 4:22 am

Post » Mon Nov 19, 2012 7:17 am

(I not sure I'd really class this as help, sorry mole)

You have tried New Game, Save, Load (just for the sake of it)?

Is the owning quest of VampireCorpseFeed Auto-Start?

AV has a thing where 99% of his stuff starts, but one Quest doesn't (no known reason). He fixed it by adding a wrapper Quest (0 stage, just did myOtherQuest.Start()) then stopped itself - The wrapper was set to Auto-Start! That fixed the problem!! (but yeah, that's no good to you)

I've seen no issue with properties losing their values ... so something odd may have gone odd in the CK at some point, to have caused that?

I have used property=foriegn-function a couple of times, but in a MOD that is stuffed with too many Auto-Start bugs to allow me to test it now. I've not seen anyone else report a problem with such functionality on here though?



And someone will ask you to post the vampirecorpsefeed script/function ... so you may as well get it over with ;)
User avatar
Madeleine Rose Walsh
 
Posts: 3425
Joined: Wed Oct 04, 2006 2:07 am

Post » Mon Nov 19, 2012 5:23 am

I see you're editing a fragment script, and you've added code between the "Do not edit code between these comments" warning comments, so when you changed a fragment somewhere it blew away your property. (That's why the warning is there) To fix this, add your property to the bottom of the file, outside of the pairs of comments. Anything outside those two comments will be preserved, anything inside will be deleted.
User avatar
Jake Easom
 
Posts: 3424
Joined: Sun Jul 29, 2007 4:33 am

Post » Mon Nov 19, 2012 2:59 am

I see you're editing a fragment script, and you've added code between the "Do not edit code between these comments" warning comments, so when you changed a fragment somewhere it blew away your property. (That's why the warning is there) To fix this, add your property to the bottom of the file, outside of the pairs of comments. Anything outside those two comments will be preserved, anything inside will be deleted.
I knew that would be there for some reason :wallbash: :wink:
User avatar
Spencey!
 
Posts: 3221
Joined: Thu Aug 17, 2006 12:18 am

Post » Mon Nov 19, 2012 8:01 am

Thanks so much! Its been months since I created a fragment script so typically I just edited them with a text editor. Once I fubared it I had forgotten where they are generated, etc. I found it and regenerated it and got it working. Another crazy trick is fragments cannot have properties added initially, you have to create a dummy script without much code first, (unless your code requires no properties) then close it all out, reopen it, then add your properties manually so you can compile it, then code in your stuff.

http://www.creationkit.com/Perk_Fragments

A little tricky, especially if you are rusty :) Anyhow, its working again, I'm back in business drinking from corpses. Such fun!
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm


Return to V - Skyrim