<Alias=MyAlias1>etc.. aren't clearing when in messag

Post » Mon Nov 19, 2012 8:19 pm

Let me expalin a bit.

I created a tagging quest. Go up to someone, talk to them. pick Tag! and they they're able to be tracked.
Talk to that same person, remove tag.. Works great. they get removed. Go check on the objectives and when tagged they show up, when removed, it clears the alias' references that were assigned to that particular alias slot.

Now, while that's all great. I wanted a way to remove certain tags in slots via a menu system.

I created one via a lesser power. The effect script starts up a function on my quest script. so the menu
system is run strictly via a quest script.

The menu system itself works fine, click the corresponding button to remove said ailas. That part works.
What isn't working, is the update to the messagebox screen where once the Alias reference was being shown.
Eg..
Which one to remove?-----------------------------------1 - &--#60;Alias=Tag01Alias&--#62;  2 - &--#60;Alias=Tag02Alias&--#62;3 - &--#60;Alias=Tag03Alias&--#62;4 - &--#60;Alias=Tag04Alias&--#62;5 - &--#60;Alias=Tag05Alias&--#62;

Where alias would show the corresponding actor's name in game. If an actor was not assigned it shows as [...]
That works when it's filled. When i clear it. the actor gets removed but the text never does.
I double checked the alias tabs and for all of them I have their checkboxes set to:
- uses stored text
- stores text
- optional
- clears name when removed.

So I've no idea how to get the messageboxes to update to show a blank nothing after I remove the actor reference from the alias.

Again, any help would be most appriciative please. Thank you :smile:

-Mush-
User avatar
SEXY QUEEN
 
Posts: 3417
Joined: Mon Aug 13, 2007 7:54 pm

Post » Mon Nov 19, 2012 6:03 pm

I think I know what your doing and you could do this. Instead of directly referencing the alias use GetActorRef().getname() on the alias to fill a string variable. Then display that variable in your menu instead. Then if GetActorRef() return None set the string to "..."

function SetNames()  int i = 0  while i < MyAlias.length	If MyAlias.GetActorRef() != None	  Names[i] = MyAlias[i].GetActorRef().GetName()	else	  Names[i] = "..."	endif	i += 1  endwhileendfunction

First create properties for the Names[] and MyAlias[] arrays filling MyAlias with your aliases in the quest and defining Names to be an equal number sting array. Then you can display the names in your menu by calling the function then referencing the Names[] array.
User avatar
Project
 
Posts: 3490
Joined: Fri May 04, 2007 7:58 am

Post » Tue Nov 20, 2012 12:48 am

Yeah, I've no idea how to actually implement that. I can show my script. It's a bit long and it's a catch all script. I use it for doing certain functions in sort of 'groups'.
Spoiler
Scriptname CSLetsTagQuestScript extends Quest  Int Property TagInt  Auto  {Number used to total the number of tags}Actor Property TagActorTemp  Auto  {Used to hold the Actor for adding them to the Tag Faction}Faction Property CSTagFaction  Auto  {The Name of the Faction with ranks from 1 to 10};---Alias ReferencesReferenceAlias Property Tag01Alias  Auto  ReferenceAlias Property Tag02Alias  Auto  ReferenceAlias Property Tag03Alias  Auto  ReferenceAlias Property Tag04Alias  Auto  ReferenceAlias Property Tag05Alias  Auto  ReferenceAlias Property Tag06Alias  Auto  ReferenceAlias Property Tag07Alias  Auto  ReferenceAlias Property Tag08Alias  Auto  ReferenceAlias Property Tag09Alias  Auto  ReferenceAlias Property Tag10Alias  Auto  ;----- Used to check which slots are free or notInt Property Slot1 AutoInt Property Slot2 AutoInt Property Slot3 AutoInt Property Slot4 AutoInt Property Slot5 AutoInt Property Slot6 AutoInt Property Slot7 AutoInt Property Slot8 AutoInt Property Slot9 AutoInt Property Slot10 AutoInt Property iDoOnce AutoInt Property iRemSlot AutoInt Property iStartup AutoQuest Property rTagQuest  Auto  SPELL Property CSRemoveTagSpell  Auto  GlobalVariable Property gvTotalTag  Auto  Message Property MessageA  Auto  Message Property MessageB  Auto  ;==================================================================================; Give the player a lesser power (Used as an optional way to remove tags once placed);============================Event OnInit()		if !(Game.GetPlayer().HasSpell (CSRemoveTagSpell))			(Game.GetPlayer().AddSpell (CSRemoveTagSpell))		endif	EndEvent;==================================================================================;===============================;  Used in dialogue when player talks to the person to Add a tag;;  The various states are used to control which Slot is open or not.  It assigns an actor to the first open slot.;===============================Function TagActor()	actor TaggedActor = TagActorTemp  as Actor	rTagQuest.SetStage(10)	if TagInt &--#60; 1		TagInt = 0	endifif Slot1 == 1	GotoState("Slot2State")else	if iDoOnce == 0		GotoState("DoOnceState")	else		TaggedActor.SetFactionRank(CSTagFaction , 1)		Tag01Alias.ForceRefTo(TaggedActor)		rTagQuest.SetObjectiveDisplayed(10)		rTagQuest.SetObjectiveDisplayed(11,0)		rTagQuest.SetObjectiveDisplayed(200)		Slot1 = 1		TagInt += 1		gvTotalTag.SetValueInt(TagInt)	endifendifEndFunctionState Slot2StateEvent OnBeginState()	   actor TaggedActor = TagActorTemp  as Actorif Slot2  == 1	GotoState("Slot3State")else	TaggedActor.SetFactionRank(CSTagFaction , 2)	Tag02Alias.ForceRefTo(TaggedActor)	   rTagQuest.SetObjectiveDisplayed(20)	   rTagQuest.SetObjectiveDisplayed(21,0)	Slot2 = 1	TagInt += 1	gvTotalTag.SetValueInt(TagInt)endifEndEventEndStateState Slot3StateEvent OnBeginState()	   actor TaggedActor = TagActorTemp  as Actorif Slot3 == 1	GotoState("Slot4State")else	TaggedActor.SetFactionRank(CSTagFaction , 3)	Tag03Alias.ForceRefTo(TaggedActor)	   rTagQuest.SetObjectiveDisplayed(30)	   rTagQuest.SetObjectiveDisplayed(31,0)	Slot3 = 1	TagInt += 1	gvTotalTag.SetValueInt(TagInt)endifEndEventEndStateState Slot4StateEvent OnBeginState()	   actor TaggedActor = TagActorTemp  as Actorif Slot4 == 1	GotoState("Slot5State")else	TaggedActor.SetFactionRank(CSTagFaction , 4)	Tag04Alias.ForceRefTo(TaggedActor)	   rTagQuest.SetObjectiveDisplayed(40)	   rTagQuest.SetObjectiveDisplayed(41,0)	Slot4 = 1	TagInt += 1	gvTotalTag.SetValueInt(TagInt)endifEndEventEndStateState Slot5StateEvent OnBeginState()	   actor TaggedActor = TagActorTemp  as Actorif Slot5 == 1	GotoState("Slot6State")else	TaggedActor.SetFactionRank(CSTagFaction , 5)	Tag05Alias.ForceRefTo(TaggedActor)	   rTagQuest.SetObjectiveDisplayed(50)	   rTagQuest.SetObjectiveDisplayed(51,0)	Slot5 = 1	TagInt += 1	gvTotalTag.SetValueInt(TagInt)endifEndEventEndStateState Slot6StateEvent OnBeginState()	   actor TaggedActor = TagActorTemp  as Actorif Slot6 == 1	GotoState("Slot7State")else	TaggedActor.SetFactionRank(CSTagFaction , 6)	Tag06Alias.ForceRefTo(TaggedActor)	   rTagQuest.SetObjectiveDisplayed(60)	   rTagQuest.SetObjectiveDisplayed(61,0)	Slot6 = 1	TagInt += 1	gvTotalTag.SetValueInt(TagInt)endifEndEventEndStateState Slot7StateEvent OnBeginState()	   actor TaggedActor = TagActorTemp  as Actorif Slot7 == 1	GotoState("Slot8State")else	TaggedActor.SetFactionRank(CSTagFaction , 7)	Tag07Alias.ForceRefTo(TaggedActor)	   rTagQuest.SetObjectiveDisplayed(70)	   rTagQuest.SetObjectiveDisplayed(71,0)	Slot7 = 1	TagInt += 1	gvTotalTag.SetValueInt(TagInt)endifEndEventEndStateState Slot8StateEvent OnBeginState()	   actor TaggedActor = TagActorTemp  as Actorif Slot8 == 1	GotoState("Slot9State")else	TaggedActor.SetFactionRank(CSTagFaction , 8)	Tag08Alias.ForceRefTo(TaggedActor)	   rTagQuest.SetObjectiveDisplayed(80)	   rTagQuest.SetObjectiveDisplayed(81,0)	Slot8 = 1	TagInt += 1	gvTotalTag.SetValueInt(TagInt)endifEndEventEndStateState Slot9StateEvent OnBeginState()	   actor TaggedActor = TagActorTemp  as Actorif Slot9 == 1	GotoState("Slot10State")else	TaggedActor.SetFactionRank(CSTagFaction , 9)	Tag09Alias.ForceRefTo(TaggedActor)	   rTagQuest.SetObjectiveDisplayed(90)	   rTagQuest.SetObjectiveDisplayed(91,0)	Slot9 = 1	TagInt += 1	gvTotalTag.SetValueInt(TagInt)endifEndEventEndStateState Slot10StateEvent OnBeginState()	   actor TaggedActor = TagActorTemp  as Actorif Slot10 == 1	else	TaggedActor.SetFactionRank(CSTagFaction , 10)	Tag10Alias.ForceRefTo(TaggedActor)	   rTagQuest.SetObjectiveDisplayed(100)	   rTagQuest.SetObjectiveDisplayed(101,0)	Slot10 = 1	TagInt += 1	gvTotalTag.SetValueInt(TagInt)endifEndEventEndState;==================================================================================;===============================;  Used in dialogue when player talks to the person to remove their tag;===============================Function RemoveTagActor()	if TagInt &--#60; 1		TagInt = 0	endif	Actor TaggedActor = TagActorTemp as Actor	Int FactionRank = TaggedActor.GetFactionRank(CSTagFaction) as Int	TaggedActor.RemoveFromFaction (CSTagFaction)if FactionRank == 1	Tag01Alias.Clear()	Slot1 = 0	rTagQuest.SetObjectiveDisplayed(10,0)	rTagQuest.SetObjectiveDisplayed(11)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif FactionRank == 2	Tag02Alias.Clear()	Slot2 = 0	rTagQuest.SetObjectiveDisplayed(20,0)	rTagQuest.SetObjectiveDisplayed(21)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif FactionRank == 3	Tag03Alias.Clear()	Slot3 = 0	rTagQuest.SetObjectiveDisplayed(30,0)	rTagQuest.SetObjectiveDisplayed(31)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif FactionRank == 4	Tag04Alias.Clear()	Slot4 = 0	rTagQuest.SetObjectiveDisplayed(40,0)	rTagQuest.SetObjectiveDisplayed(41)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif FactionRank == 5	Tag05Alias.Clear()	Slot5 = 0	rTagQuest.SetObjectiveDisplayed(50,0)	rTagQuest.SetObjectiveDisplayed(51)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif FactionRank == 6	Tag06Alias.Clear()	Slot6 = 0	rTagQuest.SetObjectiveDisplayed(60,0)	rTagQuest.SetObjectiveDisplayed(61)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif FactionRank == 7	Tag07Alias.Clear()	Slot7 = 0	rTagQuest.SetObjectiveDisplayed(70,0)	rTagQuest.SetObjectiveDisplayed(71)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif FactionRank == 8	Tag08Alias.Clear()	Slot8 = 0	rTagQuest.SetObjectiveDisplayed(80,0)	rTagQuest.SetObjectiveDisplayed(81)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif FactionRank == 9	Tag09Alias.Clear()	Slot9 = 0	rTagQuest.SetObjectiveDisplayed(90,0)	rTagQuest.SetObjectiveDisplayed(91)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif FactionRank == 10	Tag10Alias.Clear()	Slot10 = 0	rTagQuest.SetObjectiveDisplayed(100,0)	rTagQuest.SetObjectiveDisplayed(101)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)endifEndFunction;==================================================================================;=========; Used in Script Effect Menu to Remove Tags;=========function MenuA()	;Page 1	iRemSlot = 0	int iNum = MessageA.show()	if iNum == 0		; Remove 1		iRemSlot = 1		RemoveMessageSlots()	elseif iNum == 1	; Remove 2		iRemSlot = 2		RemoveMessageSlots()	elseif iNum == 2	;  Remove 3		iRemSlot = 3		RemoveMessageSlots()	elseif iNum == 3	;  Remove 4		iRemSlot = 4		RemoveMessageSlots()	elseif iNum == 4;  Remove 5		iRemSlot = 5		RemoveMessageSlots()	elseif iNum == 5	; Next Page		Utility.Wait(0.5)		MenuB()	elseif iNum == 6	; Exit			endifendFunctionFunction MenuB()	;Page 2	iRemSlot = 0	int iNum = MessageB.show()	if iNum == 0		; Remove 6		iRemSlot = 6		RemoveMessageSlots()	elseif iNum == 1	; Remove 7		iRemSlot = 7		RemoveMessageSlots()	elseif iNum == 2	;  Remove 8		iRemSlot = 8		RemoveMessageSlots()	elseif iNum == 3	;  Remove 9		iRemSlot = 9		RemoveMessageSlots()	elseif iNum == 4	;  Remove 10		iRemSlot = 10		RemoveMessageSlots()	elseif iNum == 5	; Previous Page		Utility.Wait(0.5)		MenuA()	elseif iNum == 6; Exit			endifendFunctionFunction RemoveMessageSlots()if iRemSlot == 1	Actor TaggedActor = Tag01Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag01Alias.Clear()	Slot1 = 0	rTagQuest.SetObjectiveDisplayed(10,0)	rTagQuest.SetObjectiveDisplayed(11)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif iRemSlot == 2	Actor TaggedActor = Tag02Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag02Alias.Clear()	Slot2 = 0	rTagQuest.SetObjectiveDisplayed(20,0)	rTagQuest.SetObjectiveDisplayed(21)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif iRemSlot == 3	Actor TaggedActor = Tag03Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag03Alias.Clear()	Slot3 = 0	rTagQuest.SetObjectiveDisplayed(30,0)	rTagQuest.SetObjectiveDisplayed(31)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif iRemSlot == 4	Actor TaggedActor = Tag04Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag04Alias.Clear()	Slot4 = 0	rTagQuest.SetObjectiveDisplayed(40,0)	rTagQuest.SetObjectiveDisplayed(41)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif iRemSlot == 5	Actor TaggedActor = Tag05Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag05Alias.Clear()	Slot5 = 0	rTagQuest.SetObjectiveDisplayed(50,0)	rTagQuest.SetObjectiveDisplayed(51)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif iRemSlot == 6	Actor TaggedActor = Tag06Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag06Alias.Clear()	Slot6 = 0	rTagQuest.SetObjectiveDisplayed(60,0)	rTagQuest.SetObjectiveDisplayed(61)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif iRemSlot == 7	Actor TaggedActor = Tag07Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag07Alias.Clear()	Slot7 = 0	rTagQuest.SetObjectiveDisplayed(70,0)	rTagQuest.SetObjectiveDisplayed(71)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif iRemSlot == 8	Actor TaggedActor = Tag08Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag08Alias.Clear()	Slot8 = 0	rTagQuest.SetObjectiveDisplayed(80,0)	rTagQuest.SetObjectiveDisplayed(81)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif iRemSlot == 9	Actor TaggedActor = Tag09Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag09Alias.Clear()	Slot9 = 0	rTagQuest.SetObjectiveDisplayed(90,0)	rTagQuest.SetObjectiveDisplayed(91)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)elseif iRemSlot == 10	Actor TaggedActor = Tag10Alias.GetActorRef() as Actor	TaggedActor.RemoveFromFaction (CSTagFaction)	Tag10Alias.Clear()	Slot10 = 0	rTagQuest.SetObjectiveDisplayed(100,0)	rTagQuest.SetObjectiveDisplayed(101)	TagInt -= 1	gvTotalTag.SetValueInt(TagInt)endif	if TagInt &--#60; 1		TagInt = 0		gvTotalTag.SetValueInt(TagInt)	endif	Utility.Wait(0.5)	if iRemSlot &--#60;= 5		MenuA()	else		MenuB()	endifEndFunction;==================================================================================;==================; Do once startup for when the player tags a person for the first time;==================State DoOnceStateEvent OnBeginState()   		actor TaggedActor = TagActorTemp  as Actor		TaggedActor.SetFactionRank(CSTagFaction , 1)		Tag01Alias.ForceRefTo(TaggedActor)		rTagQuest.SetObjectiveDisplayed(101)		rTagQuest.SetObjectiveDisplayed(91)		rTagQuest.SetObjectiveDisplayed(81)		rTagQuest.SetObjectiveDisplayed(71)		rTagQuest.SetObjectiveDisplayed(61)		rTagQuest.SetObjectiveDisplayed(51)		rTagQuest.SetObjectiveDisplayed(41)		rTagQuest.SetObjectiveDisplayed(31)		rTagQuest.SetObjectiveDisplayed(21)		rTagQuest.SetObjectiveDisplayed(10)		rTagQuest.SetObjectiveDisplayed(200)		Slot1 = 1		TagInt += 1		gvTotalTag.SetValueInt(TagInt)		iDoOnce = 1EndEventEndState

This works exactly how I need it too. It's just visually in the messagebox, doesn't for some reason want to display the cleared alias. Even though it actually is empty.

-Mush-

edit: wanted to add, this is for any npc in the world. There is no filter. Anyone can be tagged, up to a total of 10 people. At anytime even 1 get's tagged, the objective markers show over their corresponding heads when the quest is ticked active.
User avatar
Crystal Clarke
 
Posts: 3410
Joined: Mon Dec 11, 2006 5:55 am

Post » Tue Nov 20, 2012 12:23 am

Ah i see now, sorry. Maybe precede Tag01Alias.Clear() with Tag01Alias.ForceRefTo(None).

If not this should work:

If Tag01Alias.GetActorRef() == None
Tag01Alias.SetName("")
endif
User avatar
Melung Chan
 
Posts: 3340
Joined: Sun Jun 24, 2007 4:15 am

Post » Mon Nov 19, 2012 1:59 pm

I'm getting a compile error saying it doesn't know what 'SetName" is. hmmm, I'm using SKSE too. Let me check to see if I have the latest version and scripts for it.
User avatar
Mistress trades Melissa
 
Posts: 3464
Joined: Mon Jun 19, 2006 9:28 pm

Post » Mon Nov 19, 2012 3:48 pm

No setname() has to be used on a form. You could try using GetBaseObject(), but I really don't think that will work.

Since the old name value isn't cleared and can only be overwritten. You may need to create a dummy actor named "Empty" and fill the alias with that instead of clearing it (or fill it with that before you clear it). You could also try stop and starting the quest (or see if reset works).
User avatar
jeremey wisor
 
Posts: 3458
Joined: Mon Oct 22, 2007 5:30 pm

Post » Tue Nov 20, 2012 2:26 am

No setname() has to be used on a form. You could try using GetBaseObject(), but I really don't think that will work.

Since the old name value isn't cleared and can only be overwritten. You may need to create a dummy actor named "Empty" and fill the alias with that instead of clearing it (or fill it with that before you clear it). You could also try stop and starting the quest (or see if reset works).


Man, yeah I started doing the 'empty' actor when I read your last post and that worked. When the slot is cleared, i run these lines and this 'fixes' it.

    Actor TaggedActor = PlaceHolderActor as Actor    Tag01Alias.ForceRefTo(TaggedActor)

where placeholderactor is a reference to a unique actor I placed in a cell. Thanks, I was about to go mad with all this :) I still have tweaking to do but at least I got this messagebox to update correctly. Awesome.
User avatar
Miss K
 
Posts: 3458
Joined: Sat Jan 20, 2007 2:33 pm

Post » Tue Nov 20, 2012 2:22 am

Just trying to lend a hand. GL =]
User avatar
Rebecca Dosch
 
Posts: 3453
Joined: Thu Jan 18, 2007 6:39 pm


Return to V - Skyrim