Weapon Durability Script

Post » Tue Jun 19, 2012 10:24 pm

Ok, so after many hours I have a durability mod that is just starting to actually work...

It really isn't well polished and I'm trying to fix some of the issues by changing from a Formlist to a Form Array - but the code just seems to fail for no good reason.

Does anyone know whether you can have Hidden Form Array Properties?
Form[]    Property FormTracker				  Auto Hidden
User avatar
Marquis deVille
 
Posts: 3409
Joined: Thu Jul 26, 2007 8:24 am

Post » Tue Jun 19, 2012 9:59 pm

umm... I'd be surprised if you could have any array property as hidden.
By rights it can't be hidden to the CK if it's to be populated. Otherwise it's just a permanently empty array.

Edit: I'm not sure if the CK has as much trouble finding Form's for an array than it does for a single Form Property.
I posted the other day about http://www.gamesas.com/topic/1357862-setting-a-form-as-a-property-works-ok/.
User avatar
Ysabelle
 
Posts: 3413
Joined: Sat Jul 08, 2006 5:58 pm

Post » Wed Jun 20, 2012 3:25 am

I've successfully used other kinds of hidden array properties, but I am suddenly having trouble since I added a Form one :smile:
I'm only using this array within my script - it is not needed by the CK, hence I hid it .... but perhaps I should try it as a variable?

here's the top of my working script:
Spoiler
;===============  PROPERTIES  ==========================================;Formlist  Property ScarabDurabilityTrackerFLST  AutoFloat	 Property DamagePerHit				 AutoFloat	 Property BaseDurability			   AutoFloat[]   Property DurabilityTracker			Auto HiddenActor	 Property ThisActor					Auto HiddenWeapon	Property RightWeapon				  Auto HiddenWeapon	Property LeftWeapon				   Auto Hidden
And the non-functional one (it compiles but just doesn't work proper!
Spoiler
;===============  PROPERTIES  ==========================================;Float	 Property DamagePerHit				 AutoFloat	 Property BaseDurability			   AutoFloat[]   Property DurabilityTracker			Auto HiddenForm[]	Property FormTracker				  Auto HiddenActor	 Property ThisActor					Auto HiddenWeapon	Property RightWeapon				  Auto HiddenWeapon	Property LeftWeapon				   Auto Hidden

I did read your thread, but it doesn't seem to apply to my usage as I am not populating mine from the CK...
User avatar
Laurenn Doylee
 
Posts: 3427
Joined: Sun Dec 03, 2006 11:48 am

Post » Wed Jun 20, 2012 12:12 am

When you say you're not using CK to populate it, do you mean you're using another tool?

If not what size does it grant you if you declare an empty one?

Edit: nvm, I'd forgotten the you can make constructor functions.

Is it the hidden flag that is causing the problem? does it work the same without?
You could do away with the property altogether and use a functon as the accessor instead.
User avatar
zoe
 
Posts: 3298
Joined: Sun Nov 12, 2006 1:09 pm

Post » Wed Jun 20, 2012 4:51 am

Not sure I'm using a Constructor function unless you just mean calling 'new' .... here's my code:
Spoiler
;===============	EVENTS	==========================================;Event OnEffectStart(Actor akTarget, Actor akCaster)  ThisActor = Self.GetTargetActor()  Debug.Trace("ScarabDurability I am " + ThisActor + ", I have ScarabDurabilityActorEffect")  DurabilityTracker = new Float[128]endEvent

Unfortunately Arrays can only have a maximum size of 128 - that is one of the reasons I'm trying to move to local arrays rather than a global...
User avatar
Bek Rideout
 
Posts: 3401
Joined: Fri Mar 02, 2007 7:00 pm


Return to V - Skyrim