Adding properties to scripts problem

Post » Tue Jun 19, 2012 8:00 am

This is not a script problem, since the code is based on a vanilla script called PlayerHorseScript. The problem is getting the Property Manager to play nice.

I have 4 aliases which will all run exactly the same script. However the property Manager complains each time I try to enter properties. I enter the code, save and then open up the property manager. I add the Type & name and click OK... then I get the following complaint ...
Starting 1 compile threads for 1 files...
Compiling "prefix_MyScriptName"...
\pre_MyScriptNameScript .psc(4,1): variable MySelf is undefined
\pre_MyScriptNameScript .psc(8,4): variable MySelf is undefined
\pre_MyScriptNameScript.psc (8,11): none is not a known user-defined type
\pre_MyScriptNameScript .psc(8,20): cannot compare a none to a int (cast missing or types unrelated)
\pre_MyScriptNameScript.psc(10,2): variable MySelf is undefined
\pre_MyScriptNameScript.psc(10,9): none is not a known user-defined type
\pre_MyScriptNameScript.psc(11,2): variable MySelf is undefined
\pre_MyScriptNameScript.psc(11,9): none is not a known user-defined type
\pre_MyScriptNameScript.psc(13,2): variable Myself is undefined
\pre_MyScriptNameScript.psc(13,11): variable StablesPosition is undefined
\pre_MyScriptNameScript.psc(13,42): variable lvlHorseSaddled is undefined
\pre_MyScriptNameScript.psc(13,27): none is not a known user-defined type
\pre_MyScriptNameScript.psc(14,28): variable MySelf is undefined
\pre_MyScriptNameScript.psc(15,42): variable StablesFaction is undefined

No output generated for pre_MyScriptNameScript, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on pre_MyScriptNameScript


This is the point when I scream "I know its undefined - thats why I'm trying to define it!!! - before all this you were saying it was already defined. Make up your mind!"
When I look at the script again, the properties are added but I cannot assign them to anything. So why can I not get the property manager to work?


Here is the script (based on the vanilla "PlayerHorseScript").

oh, and I aleady spotted the error in the case (MySelf & Myself) but it is on the vanilla script. So I leave it there for general awareness. Is Payrus case -sensitive btw?

Scriptname pre_MyScriptNameScript extends ReferenceAlias;; this script is based on the vanilla PlayerHorseScript;Event OnDeath(Actor akKiller)  MySelf = GetActorReference()EndEventEvent OnUnload()  If MySelf.IsDead() == 1  ; disable the dead horse if it is unloaded	MySelf.Disable()	MySelf.Delete()  ; added a new horse that can be bought at the stables	Myself = StablesPosition.PlaceActorAtMe(lvlHorseSaddled)	Alias_HorseRef.ForceRefTo(MySelf)	Alias_HorseRef.GetRef().SetFactionOwner(StablesFaction)EndIfEndEvent
User avatar
Matt Bee
 
Posts: 3441
Joined: Tue Jul 10, 2007 5:32 am

Post » Tue Jun 19, 2012 10:34 am

Did you include the 'Property' & 'Auto' keywords with your variables?
Would you mind including the first part of your script here, where you declare all variables?
User avatar
Marine Arrègle
 
Posts: 3423
Joined: Sat Mar 24, 2007 5:19 am

Post » Tue Jun 19, 2012 7:33 pm

Did you include the 'Property' & 'Auto' keywords with your variables?
Would you mind including the first part of your script here, where you declare all variables?

There are no variables, just properties. They are on the original vanilla script at the bottom in this case. Although, I thought it was supposed to be the property manager that does all that. Add the properties when you define them, and then click edit property to assign them to whatever. So MySelf is assigned to one horse in one script, and in another script, MySelf is asigned to another horse etc. Although you never see it on the script.

When I add it to the propery manager, what you see below is added even though I get an error report. Although The propert manager itself is blank.
 Actor Property MySelf  Auto  ObjectReference Property StablesPosition  Auto  ActorBase Property LvlHorseSaddled  Auto  ReferenceAlias Property Alias_HorseRef  Auto  Faction Property StablesFaction  Auto 

If I add the properties as above and then use the propert manager, I get this error instead:
Starting 1 compile threads for 1 files...Compiling "JAD_FollowersHorseScript"...pre_MyScriptNameScript.psc(29,15): script property MySelf already definedpre_MyScriptNameScript.psc(29,15): script variable ::MySelf_var already definedpre_MyScriptNameScript.psc(29,15): script property MySelf already has a get function definedpre_MyScriptNameScript.psc(29,15): script property MySelf already has a set function definedpre_MyScriptNameScript.psc(31,15): script property MySelf already definedpre_MyScriptNameScript.psc(31,15): script variable ::MySelf_var already definedpre_MyScriptNameScript.psc(31,15): script property MySelf already has a get function definedpre_MyScriptNameScript.psc(31,15): script property MySelf already has a set function definedNo output generated for pre_MyScriptNameScript, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on pre_MyScriptNameScript
User avatar
Ricky Meehan
 
Posts: 3364
Joined: Wed Jun 27, 2007 5:42 pm

Post » Tue Jun 19, 2012 2:02 pm

Papyrus isn't case sensitive, afaik.

Adding these lines somewhere in your script should make it compile. No guarantees on functionality, though.

Actor	        Property MySelf		 AutoReferenceAlias  Property Alias_HorseRef  AutoFaction	        Property StablesFaction  AutoActorBase	Property lvlHorseSaddled AutoObjectReference Property StablesPosition Auto

I wasn't sure what type to declare StablesPosition as, so I declared it as ObjectReference.

Edit: I should refresh pages before I post...
User avatar
Richard Dixon
 
Posts: 3461
Joined: Thu Jun 07, 2007 1:29 pm

Post » Tue Jun 19, 2012 5:45 am

Edit: I should refresh pages before I post...

I was re-editing my post too, then the forum went buggy :smile:
User avatar
gary lee
 
Posts: 3436
Joined: Tue Jul 03, 2007 7:49 pm

Post » Tue Jun 19, 2012 6:43 pm

Ah... its working now I added what you said. I just need to recompile it. Now I can assign everything. Thanks.
User avatar
roxanna matoorah
 
Posts: 3368
Joined: Fri Oct 13, 2006 6:01 am


Return to V - Skyrim