Jump to content

[LE] Scripts don't want to Compile


Pickysaurus

Recommended Posts

Hi all, me again xD

 

So I'm pretty much convinced there's something wrong with the compiler in my CK. I have yet to compile or use a custom function without it giving me errors for days.

 

I am trying to write a very simple function, based off the FreeformSkyHavenTempleA script layout to change faction and outfit of an NPC.

Scriptname PKY_RecruitToEQ extends Quest  Conditional

Alias Property Alias_Michlon_Waltvale  Auto  
Outfit Property EGOutfit  Auto  
Faction Property EGFaction  Auto 
Weapon Property AkaviriKatana Auto 

Function EquipEGArmour (Actor Alias_Michlon_Waltvale)

	;Michlon joins Explorers Guild
	Alias_Michlon_Waltvale.RemoveAllItems
	Alias_Michlon_Waltvale.AddtoFaction(EGFaction)
	Alias_Michlon_Waltvale.SetOutfit(EGOutfit)
	Alias_Michlon_Waltvale.AddItem(AkaviriKatana)
	Alias_Michlon_Waltvale.EquipItem(AkaviriKatana)
	
EndFunction

When compiling this I get the following:

 

Starting 1 compile threads for 1 files...
Compiling "PKY_RecruitToEQ"...
C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(11,24): RemoveAllItems is not a property on script alias or one of its parents
C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(12,24): AddtoFaction is not a function or does not exist
C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(13,24): SetOutfit is not a function or does not exist
C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(14,24): AddItem is not a function or does not exist
C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(15,24): EquipItem is not a function or does not exist
No output generated for PKY_RecruitToEQ, compilation failed.

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

 

I've re-run compiler on the SkyHaven temple script and that comes out just fine, so where am I going wrong?

 

Thanks for any comments :D

Link to comment
Share on other sites

I think you need to get the actor on the alias with GetActorReference() before running all that stuff, as in:

Alias_Michlon_Waltvale.GetActorReference().RemoveAllItems()

And you're missing the () on that one.

Link to comment
Share on other sites

I think you need to get the actor on the alias with GetActorReference() before running all that stuff, as in:

Alias_Michlon_Waltvale.GetActorReference().RemoveAllItems()

And you're missing the () on that one.

 

Hey FrankFamily (I really like your mods btw!)

 

I've corrected the missing brackets and added the bits you suggested so my script looks like this;

 

 

Scriptname PKY_RecruitToEQ extends Quest  Conditional

Alias Property Alias_Michlon_Waltvale  Auto  
Outfit Property EGOutfit  Auto  
Faction Property EGFaction  Auto 
Weapon Property AkaviriKatana Auto 

Function EquipEGArmour (Actor Alias_Michlon_Waltvale)

	;Michlon joins Explorers Guild
	Alias_Michlon_Waltvale.GetActorReference().RemoveAllItems()
	Alias_Michlon_Waltvale.GetActorReference().AddtoFaction(EGFaction)
	Alias_Michlon_Waltvale.GetActorReference().SetOutfit(EGOutfit)
	Alias_Michlon_Waltvale.GetActorReference().AddItem(AkaviriKatana)
	Alias_Michlon_Waltvale.GetActorReference().EquipItem(AkaviriKatana)

EndFunction

 

 

 

But now I get another error:

 

 

 

Starting 1 compile threads for 1 files...

Compiling "PKY_RecruitToEQ"...

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(11,24): GetActorReference is not a function or does not exist

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(11,44): none is not a known user-defined type

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(12,24): GetActorReference is not a function or does not exist

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(12,44): none is not a known user-defined type

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(13,24): GetActorReference is not a function or does not exist

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(13,44): none is not a known user-defined type

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(14,24): GetActorReference is not a function or does not exist

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(14,44): none is not a known user-defined type

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(15,24): GetActorReference is not a function or does not exist

C:\Games\steamapps\common\skyrim\Data\Scripts\Source\temp\PKY_RecruitToEQ.psc(15,44): none is not a known user-defined type

No output generated for PKY_RecruitToEQ, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on PKY_RecruitToEQ

Link to comment
Share on other sites

You really need to get a much better grasp on what you are doing. Did you see any scripts in the FreeformSkyHavenTempleA quest that look anything like what you have there? You do not have a clue what you are doing and you are blaming the compiler?

Scriptname PKY_RecruitToEQ extends Quest ;Conditional????  Why would you make this script Conditional?

Alias Property Alias_Michlon_Waltvale Auto ; Alias Property? What is that? 
Outfit Property EGOutfit Auto
Faction Property EGFaction Auto
Weapon Property AkaviriKatana Auto

; Where are you calling this function from?
Function EquipEGArmour (Actor Alias_Michlon_Waltvale ; Why did you put this here? You defined the alias in the properties. Actor Alias? What is that?)

    ;Michlon joins Explorers Guild
    Alias_Michlon_Waltvale.RemoveAllItems()
    Alias_Michlon_Waltvale.AddtoFaction(EGFaction)
    Alias_Michlon_Waltvale.SetOutfit(EGOutfit)
    Alias_Michlon_Waltvale.AddItem(AkaviriKatana)
    Alias_Michlon_Waltvale.EquipItem(AkaviriKatana)
    
EndFunction
Scriptname PKY_RecruitToEQ extends Quest  

ReferenceAlias Property Alias_Michlon_Waltvale  Auto  
Outfit Property EGOutfit  Auto  
Faction Property EGFaction  Auto 
Weapon Property AkaviriKatana Auto 

Function EquipEGArmour() 
ObjectReference INeedAClue = Alias_Michlon_Waltvale.GetReference()

	;INeedAClue joins Cluelessclub Guild
	INeedAClue.RemoveAllItems()
	(INeedAClue As Actor).AddtoFaction(EGFaction)
	(INeedAClue As Actor).GetActorBase().SetOutfit(EGOutfit)
	INeedAClue.AddItem(AkaviriKatana)
	(INeedAClue As Actor).EquipItem(AkaviriKatana)
	
EndFunction

You are not even filling the properties of this AAAAAAAAA script!! There is no such thing as an Alias Property!!!

Edited by Masterofnet
Link to comment
Share on other sites

Yeah, sorry, didn't look too deep, do follow Masterofnet advice below the condescending attitude, nobody is born knowing. The ck wiki is great, both as a reference for the available functions and for its tutorials: http://www.creationkit.com/index.php?title=Category:Papyrus

Link to comment
Share on other sites

You really need to get a much better grasp on what you are doing. Did you see any scripts in the FreeformSkyHavenTempleA quest that look anything like what you have there? You do not have a clue what you are doing and you are blaming the compiler?

 

Scriptname PKY_RecruitToEQ extends Quest ;Conditional????  Why would you make this script Conditional?

Alias Property Alias_Michlon_Waltvale Auto ; Alias Property? What is that? 
Outfit Property EGOutfit Auto
Faction Property EGFaction Auto
Weapon Property AkaviriKatana Auto

; Where are you calling this function from?
Function EquipEGArmour (Actor Alias_Michlon_Waltvale ; Why did you put this here? You defined the alias in the properties. Actor Alias? What is that?)

    ;Michlon joins Explorers Guild
    Alias_Michlon_Waltvale.RemoveAllItems
    Alias_Michlon_Waltvale.AddtoFaction(EGFaction)
    Alias_Michlon_Waltvale.SetOutfit(EGOutfit)
    Alias_Michlon_Waltvale.AddItem(AkaviriKatana)
    Alias_Michlon_Waltvale.EquipItem(AkaviriKatana)
    
EndFunction
Scriptname PKY_RecruitToEQ extends Quest  

ReferenceAlias Property Alias_Michlon_Waltvale  Auto  
Outfit Property EGOutfit  Auto  
Faction Property EGFaction  Auto 
Weapon Property AkaviriKatana Auto 

Function EquipEGArmour() 
ObjectReference INeedAClue = Alias_Michlon_Waltvale.GetReference()

	;Michlon joins Explorers Guild
	INeedAClue.RemoveAllItems
	(INeedAClue As Actor).AddtoFaction(EGFaction)
	(INeedAClue As Actor).GetActorBase().SetOutfit(EGOutfit)
	INeedAClue.AddItem(AkaviriKatana)
	(INeedAClue As Actor).EquipItem(AkaviriKatana)
	
EndFunction

 

You are not even filling the properties of this AAAAAAAAA script!! There is no such thing as an Alias Property!!!

 

 

This is where I got confused with Alias property :/

 

Thanks for the help, adding brackets to the removeitems in your version of the script allowed it to compile properly :D

 

Sorry if I sounded arrogant somehow, I am really new to scripting and I am struggling to get my head around the logic of it all. Where I read it as making sense, the compiler throws up errors all over the place. For example now the function exists I'm having trouble calling it in a Quest Fragement, the errors it gives aren't really very helpful :(

 

I used FreeformSkyHavenTempleAScript.psc as a base for this - with the exception of the alias property being wrong, it's pretty similar (to me anyways).

 

I'm here to try and learn from you guys because at the moment I can only copy/paste other bits of script and hope for the best.

Link to comment
Share on other sites

 

 

I'm here to try and learn from you guys because at the moment I can only copy/paste other bits of script and hope for the best.

 

 

Pickysaurus, You need to try and learn something from, looking at the scripts and templates in the kit, Watching videos, reading tutorials and the creation kit wiki. Not just coming here and asking other people to do your work for you.

 

I have never used that Alias property. I certainly do not remember using it. What you needed was a ReferenceAlias property.

 

The next time I am in the kit i will have a look at that and see what it dose. Quest aliases are Reference Aliases or Location Aliases.

 

Do some research!

Scriptname PKY_RecruitToEQ extends Quest

Outfit Property EGOutfit Auto
Faction Property EGFaction Auto
Weapon Property AkaviriKatana Auto

Function EquipEGArmour(ObjectReference INeedAClue) ; Fill this when you trigger the function so you can use it for multiple NPCs. 

    ;INeedAClue joins Cluelessclub Guild
    INeedAClue.RemoveAllItems()
    (INeedAClue As Actor).AddtoFaction(EGFaction)
    (INeedAClue As Actor).GetActorBase().SetOutfit(EGOutfit)
    INeedAClue.AddItem(AkaviriKatana)
    (INeedAClue As Actor).EquipItem(AkaviriKatana)
    
EndFunction
Edited by Masterofnet
Link to comment
Share on other sites

Afaik alias is the parent of referencealias, so you just have to cast it (obviously is better to have a referencealias property in the first place) I wouldnt be surprised if the ck didnt allow filling them, like form properties.

 

If you are calling from the quest fragment why no have all that in there directly and save a headache?

The wiki's quest tutorial covers quest fragments.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...