Karel2015 Posted June 10, 2016 Posted June 10, 2016 (edited) 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 June 10, 2016 by Karel2015
JonathanOstrus Posted June 10, 2016 Posted June 10, 2016 I saw code for another script where they were using forceref. Then to "put it back" they used a forceref again with an alias with the original name. Maybe that will work for you?
Korodic Posted June 14, 2016 Posted June 14, 2016 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 ?
Recommended Posts