Jump to content

[LE] compiler gives error on working script


ZombieNL

Recommended Posts

Hello

The papyrus compiler suddenly decided that a working script now must have an error.
A few days ago i ported my mod "Vampire Coffin" to Special Edition. That part works fine and there were no problems at all. Now i want to add a mcm menu to add some options and the problems started.

The problem is not with the mcm part (i only just started with that), but with one of my existing scripts:

Scriptname VC_Script_BloodstoneChalice extends ObjectReference
{Custom Script for Bloodstone Chalice}

CompanionsHousekeepingScript Property CHScript Auto
Race Property PlayerRace Auto
Keyword Property VampireKeyword Auto

DLC1RadiantScript Property DLC1RadScript Auto
Message Property VC_Msg_BloodstoneChalice Auto
Spell Property TrapDiseaseSanguinareVampiris Auto

Event OnActivate(ObjectReference ActivateRef)
PlayerRace = Game.GetPlayer().GetRace()
    if (PlayerRace.HasKeyword(VampireKeyword))    ; player is vampire
        AncientBlood()    ; allow player to drink from chalice
    elseif (CHScript.PlayerHasBeastBlood == 1)    ; player is lycan
        VC_Msg_BloodstoneChalice.Show()    ; cant infect a lycan with dissease, so only show message
    else                                ; player is mortal
        DiseaseSV()                        ; infect player with sanguinare vampiris
        VC_Msg_BloodstoneChalice.Show()    ; Show message
    endif
EndEvent

Function AncientBlood()
    DLC1RadScript.ChaliceDrink()
EndFunction

Function DiseaseSV()
    Game.GetPlayer().DoCombatSpellApply(TrapDiseaseSanguinareVampiris, Game.GetPlayer())
EndFunction

This script was working fine, no compiler errors, when i made it for v1.1 of my mod.
When i try to compile the same script now, i get this error message:

 

Starting 1 compile threads for 1 files...
Compiling "VC_Script_BloodstoneChalice"...
E:\SteamLibrary\steamapps\common\Skyrim\Data\Scripts\Source\temp\VC_Script_BloodstoneChalice.psc(8,27): unknown type dlc1radiantscript
E:\SteamLibrary\steamapps\common\Skyrim\Data\Scripts\Source\temp\VC_Script_BloodstoneChalice.psc(25,15): dlc1radiantscript is not a known user-defined type
No output generated for VC_Script_BloodstoneChalice, compilation failed.

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

 

So, out of nowhere the compiler has a problem with a script from the dawnguard.bsa archive.

I already tried this:
deleting dawnguard.bsa and verify game file with steam to download again
delete all papyrus files and verify creation kit files to download again
uninstall creation kit and download again

Can someone help me with this?

Edited by ZombieNL
Link to comment
Share on other sites

Have you verified that DLC1RadiantScript.psc still exists in the correct folder? Similar happened to me not long ago, and re-extracting the Scripts.zip file placed in the data folder by the Creation Kit install did the job.

Link to comment
Share on other sites

Wow already some reactions, That is fast!

@Rasikko
I agree it makes no sense and that the syntax is correct, but the error is appeared.
When i replace:

DLC1RadiantScript Property DLC1RadScript Auto

with:

Quest Property DLC1Radiant Auto

and then compile, then i get this:

ChaliceDrink is not a function or does not exist

So what do i need to change in this line:

DLC1RadScript.ChaliceDrink()

inside the AncientBlood() function?
I tried:

DLC1Radiant.ChaliceDrink()

But that does not work.

@NexusComa
Dawnguard and Dragonborn dlc's are required for my mod, so i always have the esm's loaded in ck

@Havredave
I checked just to be sure, but the file is still there.
There is (almost) no chance the files get deleted or changed because i use MO2 and made a new mod with the content of the Scripts.rar file (Oldrim has a rar, SE has a zip).

Link to comment
Share on other sites

What is about

Message Property VC_Msg_BloodstoneChalice_Lycan Auto

and that code

VC_Msg_BloodstoneChalice.Show()

It seems to me you have changed the property. I also changed the script a bit, maybe it is useful.

 

VC_Script_BloodstoneChalice

 

Scriptname VC_Script_BloodstoneChalice extends ObjectReference
{Custom Script for Bloodstone Chalice}
; https://forums.nexusmods.com/index.php?/topic/7506921-compiler-gives-error-on-working-script/

; Skyrim.esm
  Keyword PROPERTY Vampire           auto                ; [KYWD:000A82BB], track whether the player currently has vampire ability
  Race    PROPERTY WerewolfBeastRace auto                ; [RACE:000CDD84], track whether the player currently has werewolf ability

; Dawnguard.esm
  Quest PROPERTY DLC1Radiant                   auto      ; [QUST:02004C1C], for ChaliceDrink()
  Spell PROPERTY TrapDiseaseSanguinareVampiris auto      ; [SPEL:020037E9], see also "DLC1TrapInfectedBones.psc"

; new created
  Message PROPERTY VC_Msg_BloodstoneChalice auto


; -- EVENTs --

EVENT OnActivate(ObjectReference akActionRef)
    myF_Action(akActionRef as Actor)
ENDEVENT


;====================
state Done
;=========
EVENT OnActivate(ObjectReference akActionRef)
ENDEVENT
;=======
endState


; -- FUNCTIONs -- 2

;--------------------------------
FUNCTION myF_Action(Actor player)
;--------------------------------
IF (player == Game.GetPlayer())
ELSE
    RETURN    ; - STOP -    not activated by the player
ENDIF
;=====================
    gotoState("Done")                ; ### STATE ###

    IF myF_ShowMsg(player)
        VC_Msg_BloodstoneChalice.show()
    ENDIF

    gotoState("")                    ; ### STATE ###    if needed, go back
ENDFUNCTION


;--------------------------------------
Bool FUNCTION myF_ShowMsg(Actor player)
;--------------------------------------
    race r = player.GetRace()

IF (r) && r.HasKeyword(Vampire)
    ; player is vampire.. allow him to drink from chalice
    (DLC1Radiant as DLC1RadiantScript).ChaliceDrink()
    Return False    ; do not show anything
ENDIF
;---------
    IF (r == WerewolfBeastRace)
        ; player is lycan
    ELSE
        ; player is mortal, so infect the player with sanguinare vampiris
        player.DoCombatSpellApply(TrapDiseaseSanguinareVampiris, player as ObjectReference)
    ENDIF
    Return TRUE     ; show message
ENDFUNCTION


;/function ChaliceDrink()
    float today = GameDaysPassed.GetValue()
    float chaliceLevel = DLC1VampireChaliceLevel.GetValue()
    int daysToHavePower

    RemoveRedwaterDenEffects(today)

    if chaliceLevel == 0
        daysToHavePower = 1

    elseif chaliceLevel == 1
        daysToHavePower = 3

    elseif chaliceLevel == 2
        daysToHavePower = 5

    elseif chaliceLevel == 3
        daysToHavePower = 7

    else
        daysToHavePower = 9

    endif

    ;ChaliceStopDay defined at top script
    ChaliceStopDay = today + daysToHavePower

    Debug.Trace(self + "ChaliceDrink() setting DLC1VampireChaliceStopDay to " + ChaliceStopDay)
    DLC1VampireChaliceStopDay.SetValue(ChaliceStopDay)
    
    RegisterForSingleUpdateGameTime(24 * daysToHavePower)

    if Game.GetPlayer().HasKeyword(Vampire)
        Game.GetPlayer().AddSpell(DLC1VampireChalicePower)
    endif
EndFunction
 ### original function ### /;

 

 

Edited by ReDragon2013
Link to comment
Share on other sites

What is about

Message Property VC_Msg_BloodstoneChalice_Lycan Auto

and that code

VC_Msg_BloodstoneChalice.Show()

It seems to me you have changed the property.

 

You are correct. i made a mistake in my post. It should be:

Message Property VC_Msg_BloodstoneChalice Auto

I will correct in the first post. Now i need to spend some time figuring out what you did to my script. It looks verry complicated.

Link to comment
Share on other sites

I also changed the script a bit, maybe it is useful.

 

VC_Script_BloodstoneChalice

 

Scriptname VC_Script_BloodstoneChalice extends ObjectReference
{Custom Script for Bloodstone Chalice}
; https://forums.nexusmods.com/index.php?/topic/7506921-compiler-gives-error-on-working-script/

; Skyrim.esm
  Keyword PROPERTY Vampire           auto                ; [KYWD:000A82BB], track whether the player currently has vampire ability
  Race    PROPERTY WerewolfBeastRace auto                ; [RACE:000CDD84], track whether the player currently has werewolf ability

; Dawnguard.esm
  Quest PROPERTY DLC1Radiant                   auto      ; [QUST:02004C1C], for ChaliceDrink()
  Spell PROPERTY TrapDiseaseSanguinareVampiris auto      ; [SPEL:020037E9], see also "DLC1TrapInfectedBones.psc"

; new created
  Message PROPERTY VC_Msg_BloodstoneChalice auto


; -- EVENTs --

EVENT OnActivate(ObjectReference akActionRef)
    myF_Action(akActionRef as Actor)
ENDEVENT


;====================
state Done
;=========
EVENT OnActivate(ObjectReference akActionRef)
ENDEVENT
;=======
endState


; -- FUNCTIONs -- 2

;--------------------------------
FUNCTION myF_Action(Actor player)
;--------------------------------
IF (player == Game.GetPlayer())
ELSE
    RETURN    ; - STOP -    not activated by the player
ENDIF
;=====================
    gotoState("Done")                ; ### STATE ###

    IF myF_ShowMsg(player)
        VC_Msg_BloodstoneChalice.show()
    ENDIF

    gotoState("")                    ; ### STATE ###    if needed, go back
ENDFUNCTION


;--------------------------------------
Bool FUNCTION myF_ShowMsg(Actor player)
;--------------------------------------
    race r = player.GetRace()

IF (r) && r.HasKeyword(Vampire)
    ; player is vampire.. allow him to drink from chalice
    (DLC1Radiant as DLC1RadiantScript).ChaliceDrink()
    Return False    ; do not show anything
ENDIF
;---------
    IF (r == WerewolfBeastRace)
        ; player is lycan
    ELSE
        ; player is mortal, so infect the player with sanguinare vampiris
        player.DoCombatSpellApply(TrapDiseaseSanguinareVampiris, player as ObjectReference)
    ENDIF
    Return TRUE     ; show message
ENDFUNCTION


;/function ChaliceDrink()
    float today = GameDaysPassed.GetValue()
    float chaliceLevel = DLC1VampireChaliceLevel.GetValue()
    int daysToHavePower

    RemoveRedwaterDenEffects(today)

    if chaliceLevel == 0
        daysToHavePower = 1

    elseif chaliceLevel == 1
        daysToHavePower = 3

    elseif chaliceLevel == 2
        daysToHavePower = 5

    elseif chaliceLevel == 3
        daysToHavePower = 7

    else
        daysToHavePower = 9

    endif

    ;ChaliceStopDay defined at top script
    ChaliceStopDay = today + daysToHavePower

    Debug.Trace(self + "ChaliceDrink() setting DLC1VampireChaliceStopDay to " + ChaliceStopDay)
    DLC1VampireChaliceStopDay.SetValue(ChaliceStopDay)
    
    RegisterForSingleUpdateGameTime(24 * daysToHavePower)

    if Game.GetPlayer().HasKeyword(Vampire)
        Game.GetPlayer().AddSpell(DLC1VampireChalicePower)
    endif
EndFunction
 ### original function ### /;

 

 

You didn't change the script a bit, you completely rebuild it in a totaly different way. I don't understand most of it. More important is that this also will not compile succesfully. Here is the error i get:

Starting 1 compile threads for 1 files...

Compiling "VC_Script_BloodstoneChalice"...

E:\SteamLibrary\steamapps\common\Skyrim\Data\Scripts\Source\temp\VC_Script_BloodstoneChalice.psc(60,17): cannot convert to unknown type dlc1radiantscript

E:\SteamLibrary\steamapps\common\Skyrim\Data\Scripts\Source\temp\VC_Script_BloodstoneChalice.psc(60,17): cannot cast a quest to a dlc1radiantscript, types are incompatible

E:\SteamLibrary\steamapps\common\Skyrim\Data\Scripts\Source\temp\VC_Script_BloodstoneChalice.psc(60,39): dlc1radiantscript is not a known user-defined type

No output generated for VC_Script_BloodstoneChalice, compilation failed.

 

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

Failed on VC_Script_BloodstoneChalice

 

The part:

(DLC1Radiant as DLC1RadiantScript).ChaliceDrink()

Looks promissing, but that is the part were the compiler gives the error.

So maybe i should stop trying to link to the ChaliceDrink() function inside the DLC1RadiantScript and just add the function to my script file.

I still don't understand how the compiler can't handel DLC1RadiantScript any more.

Link to comment
Share on other sites

Your source path is

E:\SteamLibrary\steamapps\common\Skyrim\Data\Scripts\Source\temp\VC_Script_BloodstoneChalice.psc

maybe you can move the psc-file manually to source folder

E:\SteamLibrary\steamapps\common\Skyrim\Data\Scripts\Source\

I got it compiled like that

 

Flag cross-ref info:
    conditional: 1 (0x00000002)
    hidden: 0 (0x00000001)

VC_Script_BloodstoneChalice: ObjectReference
Docstring: "Custom Script for Bloodstone Chalice"

Variables:
    spell ::TrapDiseaseSanguinareVampiris_var
    quest ::DLC1Radiant_var
    keyword ::Vampire_var
    message ::VC_Msg_BloodstoneChalice_var
    race ::WerewolfBeastRace_var

Properties:
    message VC_Msg_BloodstoneChalice
        autoVar: ::VC_Msg_BloodstoneChalice_var
    race WerewolfBeastRace
        autoVar: ::WerewolfBeastRace_var
    spell TrapDiseaseSanguinareVampiris
        autoVar: ::TrapDiseaseSanguinareVampiris_var
    keyword Vampire
        autoVar: ::Vampire_var
    quest DLC1Radiant
        autoVar: ::DLC1Radiant_var

States and functions:
    state "<empty state>":
        Bool myF_ShowMsg(actor player)
            race ::temp4
            Bool ::temp5
            race r
            dlc1radiantscript ::temp6
            None ::NoneVar
            ObjectReference ::temp7
            Instruction count: 17
        None GotoState(String newState)
            Docstring: "Function that switches this object to the specified state"
            None ::NoneVar
            Instruction count: 3
        String GetState()
            Docstring: "Function that returns the current state"
            Instruction count: 1
        None OnActivate(ObjectReference akActionRef)
            actor ::temp0
            None ::NoneVar
            Instruction count: 2
        None myF_Action(actor player)
            actor ::temp1
            Bool ::temp2
            None ::NoneVar
            Int ::temp3
            Instruction count: 11
    state "Done":
        None OnActivate(ObjectReference akActionRef)
            Instruction count: 0

0 error(s), 0 warning(s)
Assembly succeeded

Compilation succeeded.

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

 

 

 

import looks as follow, I did not used the CK, I have a batch-file for compiling. Make sure all imports files are existing. Have you got deleted a source-file?

 

 

Starting 1 compile threads for 1 files...
Compiling "VC_Script_BloodstoneChalice"...

 Starting import of E:\Papyrus\scripts\source\TESV_Papyrus_Flags.flg...
 Finished import

Flag hidden: 0
Flag conditional: 1

Starting import of E:\Papyrus\scripts_compile\VC_Script_BloodstoneChalice.psc...

  Starting import of E:\Papyrus\scripts\source\ObjectReference.psc...
   Starting import of E:\Papyrus\scripts\source\Form.psc...
    Starting import of E:\Papyrus\scripts\source\Keyword.psc...
     Starting import of E:\Papyrus\scripts\source\Location.psc...
      Starting import of E:\Papyrus\scripts\source\LocationRefType.psc...
      Finished import
     Finished import
    Finished import
    Starting import of E:\Papyrus\scripts\source\Actor.psc...
     Starting import of E:\Papyrus\scripts\source\GlobalVariable.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\ActorBase.psc...
      Starting import of E:\Papyrus\scripts\source\Class.psc...
      Finished import
      Starting import of E:\Papyrus\scripts\source\FormList.psc...
      Finished import
      Starting import of E:\Papyrus\scripts\source\Race.psc...
      Finished import
      Starting import of E:\Papyrus\scripts\source\Outfit.psc...
      Finished import
     Finished import
     Starting import of E:\Papyrus\scripts\source\Game.psc...
      Starting import of E:\Papyrus\scripts\source\WordOfPower.psc...
      Finished import
      Starting import of E:\Papyrus\scripts\source\ImageSpaceModifier.psc...
      Finished import
     Finished import
     Starting import of E:\Papyrus\scripts\source\Perk.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\Shout.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\Spell.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\Faction.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\Package.psc...
      Starting import of E:\Papyrus\scripts\source\Quest.psc...
       Starting import of E:\Papyrus\scripts\source\Alias.psc...
       Finished import
      Finished import
     Finished import
     Starting import of E:\Papyrus\scripts\source\Weapon.psc...
      Starting import of E:\Papyrus\scripts\source\Ammo.psc...
      Finished import
     Finished import
     Starting import of E:\Papyrus\scripts\source\Armor.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\AssociationType.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\MagicEffect.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\Idle.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\TextureSet.psc...
     Finished import
    Finished import
   Finished import
   Starting import of E:\Papyrus\scripts\source\Cell.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\Utility.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\Key.psc...
    Starting import of E:\Papyrus\scripts\source\MiscObject.psc...
    Finished import
   Finished import
   Starting import of E:\Papyrus\scripts\source\Scene.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\VoiceType.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\WorldSpace.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\EncounterZone.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\ImpactDataSet.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\Topic.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\Projectile.psc...
   Finished import
  Finished import
 
  Starting import of E:\Papyrus\scripts\source\Message.psc...
  Finished import
 
  Starting import of E:\Papyrus\scripts\source\DLC1RadiantScript.psc...
   Starting import of E:\Papyrus\scripts\source\ReferenceAlias.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\DLC1VampireTurnScript.psc...
    Starting import of E:\Papyrus\scripts\source\PlayerVampireQuestScript.psc...
     Starting import of E:\Papyrus\scripts\source\Static.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\EffectShader.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\Sound.psc...
     Finished import
    Finished import
    Starting import of E:\Papyrus\scripts\source\CompanionsHousekeepingScript.psc...
     Starting import of E:\Papyrus\scripts\source\DialogueFollowerScript.psc...
      Starting import of E:\Papyrus\scripts\source\SetHirelingRehire.psc...
      Finished import
     Finished import
     Starting import of E:\Papyrus\scripts\source\DarkBrotherhood.psc...
      Starting import of E:\Papyrus\scripts\source\DarkSanctuaryDialogueScript.psc...
      Finished import
      Starting import of E:\Papyrus\scripts\source\pDBEntranceQuestScript.psc...
       Starting import of E:\Papyrus\scripts\source\Book.psc...
       Finished import
      Finished import
     Finished import
     Starting import of E:\Papyrus\scripts\source\LeveledItem.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\CompanionsRadiantQuest.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\CompanionsStoryQuest.psc...
     Finished import
     Starting import of E:\Papyrus\scripts\source\LocationAlias.psc...
     Finished import
    Finished import
    Starting import of E:\Papyrus\scripts\source\Debug.psc...
    Finished import
    Starting import of E:\Papyrus\scripts\source\DLC1ReferenceAliasArrayScript.psc...
    Finished import
   Finished import
   Starting import of E:\Papyrus\scripts\source\Potion.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\DLC1RH05DwarvenTechScript.psc...
   Finished import
   Starting import of E:\Papyrus\scripts\source\DLC1TrollArmoredPlayerFollower.psc...
   Finished import
  Finished import

Finished import

 

 

Edited by ReDragon2013
Link to comment
Share on other sites

E:\SteamLibrary\steamapps\common\Skyrim\Data\Scripts\Source\temp\VC_Script_BloodstoneChalice.psc

This is my Source path because i run ck through mo2

In mo2 i have everything setup so that i can keep my Skyrim\Data folder clean.

For every mod/program that wants to put files in my Data folder, i made a mod in mo2.

This works great as long as i start ck through mo2.

I don't know how to compile without ck.

 

I got it compiled like that

 

Flag cross-ref info:
    conditional: 1 (0x00000002)
    hidden: 0 (0x00000001)

VC_Script_BloodstoneChalice: ObjectReference
Docstring: "Custom Script for Bloodstone Chalice"

Variables:
    spell ::TrapDiseaseSanguinareVampiris_var
    quest ::DLC1Radiant_var
    keyword ::Vampire_var
    message ::VC_Msg_BloodstoneChalice_var
    race ::WerewolfBeastRace_var

Properties:
    message VC_Msg_BloodstoneChalice
        autoVar: ::VC_Msg_BloodstoneChalice_var
    race WerewolfBeastRace
        autoVar: ::WerewolfBeastRace_var
    spell TrapDiseaseSanguinareVampiris
        autoVar: ::TrapDiseaseSanguinareVampiris_var
    keyword Vampire
        autoVar: ::Vampire_var
    quest DLC1Radiant
        autoVar: ::DLC1Radiant_var

States and functions:
    state "<empty state>":
        Bool myF_ShowMsg(actor player)
            race ::temp4
            Bool ::temp5
            race r
            dlc1radiantscript ::temp6
            None ::NoneVar
            ObjectReference ::temp7
            Instruction count: 17
        None GotoState(String newState)
            Docstring: "Function that switches this object to the specified state"
            None ::NoneVar
            Instruction count: 3
        String GetState()
            Docstring: "Function that returns the current state"
            Instruction count: 1
        None OnActivate(ObjectReference akActionRef)
            actor ::temp0
            None ::NoneVar
            Instruction count: 2
        None myF_Action(actor player)
            actor ::temp1
            Bool ::temp2
            None ::NoneVar
            Int ::temp3
            Instruction count: 11
    state "Done":
        None OnActivate(ObjectReference akActionRef)
            Instruction count: 0

0 error(s), 0 warning(s)
Assembly succeeded

Compilation succeeded.

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

 

 

 

I don't know what you compiled there, but it has a few words i recognize. It looks nothing like any script i could work with, i guess i am not smart enough to understand what you made there.

 

I did not delete any files and when i compile everything works excep for that DLC1RadiantScript (The DLC1RadiantScript.psc is also present). All other scripts and files work as they should. So missing files should not be the problem, but just to be sure, how do i use that import script? I don't know what to do with it.

Edited by ZombieNL
Link to comment
Share on other sites

  • Recently Browsing   0 members

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