Jump to content

Small Amount of Script Help


Recommended Posts

Ok So basically, I am using a script / quest function to rename NPCs by setting them to aliases. The problem is, I can't seem to get them to be removed from the alias, and switch to a new one to change the name.

 

As you see here is the script, It compiles fine, and looks correct to me. But using the option to remove the ref doesn't work, switching them to a diff ref doesn't work either.

"Once I give them a name, I can't change it after that"

 

 

 

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

 

 

Edited by Karel2015
Link to comment
Share on other sites

Instead of removeref, may try using the clear command?

http://www.creationkit.com/fallout4/index.php?title=Clear_-_ReferenceAlias

 

I also tend to use forceref to over addref

 

http://www.creationkit.com/fallout4/index.php?title=AddRef_-_RefCollectionAlias

 

but by using addref and removeref, I assume you're using a refcollection ?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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