How do you delete a property from a script in the script win

Post » Thu Jun 21, 2012 11:42 am

All,

So I made a property on my script in a quest. I named it something and I really want to delete the property. But I cant find a delete anywhere. I see Edit Value, Revert (greyed out), and Auto-Fill. But there is no delete option, and simply highlighting the property and hitting delete doesnt work either.

The irritating thing is that I didnt save my changes in the Creation Kit. I closed it, assuming that it wouldnt save my property, but apparently those auto-save. It was there when I re-opened the Creation Kit.

I guess I could delete the whole quest and re-make it, but what a pain.

Help? :)

Thanks!
User avatar
Javaun Thompson
 
Posts: 3397
Joined: Fri Sep 21, 2007 10:28 am

Post » Thu Jun 21, 2012 2:45 pm

You don't. You'll have to manually remove it from the PSC. Note that you'll probably want to remove the script, then reattach it and fill its properties as it (the form it was attached to) will otherwise retain erroneous data from the removed property.
User avatar
kat no x
 
Posts: 3247
Joined: Mon Apr 16, 2007 5:39 pm

Post » Thu Jun 21, 2012 12:43 pm

you don't have to remove the script anymore (to avoid the complaining in the papyrus logs)


basically clear the value of the property first, so that it just says

hit ok on all windows (this is important or else the changes dont get updated). then open the edit window again and double check to see if the property is still pointing to nothing (default).

right click the script to Edit Source, delete the line of code that declares your property. hit ok to close all windows.



this will safely remove the property from the script AND the VMAD record (so that there are no complaints in payrus logs)

^ thanks arthmoor for pointing this out to me



if you delete the property from the script only, without clearing its value in the objects the script is attached to, then these properties will stay in the VMAD record forever, unless you remove the script and then re-attach it
User avatar
Frank Firefly
 
Posts: 3429
Joined: Sun Aug 19, 2007 9:34 am

Post » Thu Jun 21, 2012 1:12 pm

you don't have to remove the script anymore (to avoid the complaining in the papyrus logs)
I've had too many cases where things didn't work properly after removing/adding properties I guess. The plugin will retain erroneous info as is evident (if you remove a property from a script w/o removing the script and reattaching it) when you re-add a property with the same name as the deleted one and it's already filled...

Edit: Missed the part about clearing the value. Still, I prefer to wipe the slate clean, particularly if there are no Array vars or anything and it'll all autofill so readily..
User avatar
Bloomer
 
Posts: 3435
Joined: Sun May 27, 2007 9:23 pm

Post » Thu Jun 21, 2012 9:58 am

Thanks for the replies.

Just a fast question that maybe you knowledgeable folks can answer here real fast. Otherwise I will start a new post later. This is kinda unrelated, but related in the sense that I am having issues with the correct property I made.

I have a quest that runs on startup and registers an event that runs and re-registers every 20 seconds. Later I will drop it down to 120 seconds or longer. Anyway, I have a property set now in the psc, a Barbarian00 perk, and its auto-filled and linked to the property in the script properties window and etc. Or so I believe. I also am sure my code reaches this snippet because I am seeing the text pop up every 20 seconds. But I ALWAYS end up in the IF condition whether I have the Barbarian00 perk or not, and whether or not I have the "!" in front of the condition or not. Its always getting IN the IF block. But the player.AddPerk never ever works, even though I qualify in terms of my skill rank. However, the script compiles just fine. I'm kinda jumping into the scripting tho, so maybe I'm missing obvious?

Below is the code fragment:

If !(player.HasPerk(Barbarian00))
Debug.Notification("Made it into IF statement")
player.AddPerk(Barbarian00)
EndIf


Also, here is the perk associated created in my psc:

Perk Property Barbarian00 Auto


Is there any obvious reason why my script compiles with no errors, and yet I always get inside the IF loop whether I use ! or I dont use ! and whether or not I have Barbarian00 (which I assume is the 1/5 that I need 0 skill points for) and yet the Addperk never works?

Thanks so much!
User avatar
Heather M
 
Posts: 3487
Joined: Mon Aug 27, 2007 5:40 am

Post » Thu Jun 21, 2012 11:22 am

Try:
If !Player.HasPerk(Barbarian00)
?

I'd avoid extraneous parenthesis whenever possible, but that's just me.
User avatar
Josh Trembly
 
Posts: 3381
Joined: Fri Nov 02, 2007 9:25 am

Post » Thu Jun 21, 2012 11:47 am

That worked, but I don't understand why.

I mean, I was getting to the interior of my loop, so I would think AddPerk would have worked anyway, since it was in the loop. But it never would work.

By dropping the extra parens, the function evaluated as I expected, but all that means is that I got into the interior of the loop. But I expected AddPerk to keep failing. But it worked.

Freaking me out, it is.

Thanks!
User avatar
Taylah Illies
 
Posts: 3369
Joined: Fri Feb 09, 2007 7:13 am


Return to V - Skyrim