Jump to content

Script Halfway Works can't figure it out


Recommended Posts

Posted

Ok, so I am making a script that will rename NPCs by setting them to a quest alias Reference.

 

The first part is working great, I can rename them and it works. Problem is, Once I rename them, The other part of the script doesn't work to remove the new name, and it won't allow me to change it to a different name, so I'm stuck with the first option I choose whether I want to change it or not.

 

i swear unless my old age is getting the best of me, I did it all right, and it compiles fine maybe I'm missing something idk. Any help would be appreciated, it's most the way there, just can't figure out that last part.

 

 

 

 

If(iButton == 0)
            ArmorerAlias.AddRef(akActor)
            ElseIf(iButton == 1)
            ArtillerymanAlias.AddRef(akActor)
            ElseIf(iButton == 2)
            BartenderAlias.AddRef(akActor)
            ElseIf(iButton == 3)
            DoctorAlias.AddRef(akActor)
            ElseIf(iButton == 4)
            FarmerAlias.AddRef(akActor)
            ElseIf(iButton == 5)
            GuardAlias.AddRef(akActor)
            ElseIf(iButton == 6)
            MinutemenAlias.AddRef(akActor)
            ElseIf(iButton == 7)
            CitizenAlias.AddRef(akActor)
            ElseIf(iButton == 8)
            MechanicAlias.AddRef(akActor)
            ElseIf(iButton == 9)
            MercenaryAlias.AddRef(akActor)
            ElseIf(iButton == 10)
            RailroadAlias.AddRef(akActor)
            ElseIf(iButton == 11)
            WorkerAlias.AddRef(akActor)
            ElseIf(iButton == 12)
            OfficerAlias.AddRef(akActor)
            ElseIf(iButton == 13)
            NurseAlias.AddRef(akActor)
            ElseIf(iButton == 14)
            PriestAlias.AddRef(akActor)
            ElseIf(iButton == 15)
            PrisonerAlias.AddRef(akActor)
            ElseIf(iButton == 16)
            ScientistAlias.AddRef(akActor)
            ElseIf(iButton == 17)
            PaladinAlias.AddRef(akActor)
            ElseIf(iButton == 18)
            SynthAlias.AddRef(akActor)
            ElseIf(iButton == 19) ; Remove Names
            ArmorerAlias.RemoveRef(akActor)
            ArtillerymanAlias.RemoveRef(akActor)
            BartenderAlias.RemoveRef(akActor)
            DoctorAlias.RemoveRef(akActor)
            FarmerAlias.RemoveRef(akActor)
            GuardAlias.RemoveRef(akActor)
            MinutemenAlias.RemoveRef(akActor)
            CitizenAlias.RemoveRef(akActor)
            MechanicAlias.RemoveRef(akActor)
            MercenaryAlias.RemoveRef(akActor)
            RailroadAlias.RemoveRef(akActor)
            WorkerAlias.RemoveRef(akActor)
            OfficerAlias.RemoveRef(akActor)
            NurseAlias.RemoveRef(akActor)
            PriestAlias.RemoveRef(akActor)
            PrisonerAlias.RemoveRef(akActor)
            ScientistAlias.RemoveRef(akActor)
            PaladinAlias.RemoveRef(akActor)
            SynthAlias.RemoveRef(akActor)
            EndIf
EndEvent

 

 

Posted

I'm no pro with papyrus, but don't you need to do if checks on the RemoveRef to see if the reference excists before you try to remove it?

Posted

So do like ?? I think is what you mean yah ?

 

if actorToCheck.akActor
        ; clear
        SynthAliases.RemoveRef(actorToCheck.akActor)
        actorToCheck.akActor = NONE
    endif

Posted

Do you have "Clear name when removed" checked in RefCollectionAlias settings in CK?

Posted

Omg Shakrum TYYYYYYYY late night working on mods is not the best idea I see, I best just get to bed lmao but yes that fixed it thank you soooo much :D

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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