Jump to content

Activate() worked with one Activator, not another?


DukeFred

Recommended Posts

I'm having issues getting my script to work now that I've changed one of the objects involved. Basically, I'm trying to Activate() a mannequin using an activator object. Originally I was using WETempActivator, which worked fine. Now I'm using DweButton01 and Activate() simply isn't working.

Scriptname XmogScriptActivator extends ObjectReference
{Allows transmog, tells TransmogMannXmog to UnequipAll & Activate.}

Actor property TransmogMannXmog auto
bool property XmogActivated auto
ObjectReference property objSelf auto hidden
Sound property QSTAstrolabeButtonPressX auto

event onCellAttach()
	objSelf = self as objectReference
	playAnimation("Open")
endEvent

auto State ready
	Event OnActivate(ObjectReference akActionRef)
		gotoState("busy")
		playAnimationAndWait("Trigger01","done")
		if QSTAstrolabeButtonPressX
			QSTAstrolabeButtonPressX.play(objSelf)
		endif
		if (akActionRef == Game.GetPlayer())
			XmogActivated = TRUE
			TransmogMannXmog.UnequipAll()
			TransmogMannXmog.Activate(self)
			Utility.Wait(0.5)
			XmogActivated = FALSE
		endif
		gotoState("ready")
	endEvent
endState

State busy

endState

Right now, the UnequipAll() function correctly makes the mannequin unequip everything. I've snuck a Debug.Notification() message into the very beginning of the mannequin's transmog OnActivate event to see if the event is even firing, and seeing nothing.

 

I've also checked the script properties of both objects a million times making sure I have them set correctly.

 

Side note, both the DweButton01 and mannequin default scripts have been deactivated, and the mannequin's default script replaced with an exact copy with one very slight modification - it's OnActivate event contents only run if the "XmogActivated" flag is FALSE (this is to prevent the mannequin's inventory from opening when activating the trigger). This duplicate script is separate from the mannequin transmog script/OnActivate event.

 

Does anybody know why the mannequin wouldn't receive the Activate() command from the DweButton01 activator? But would from the WETempActivator?

Link to comment
Share on other sites

If it helps, I've tried adding Utility.Wait(0.1) between UnequipAll() and Activate() just in case it was an issue with processing (had no effect), and the mannequin transmog script OnActivate event fires just fine when clicking on the mannequin as a player.

Link to comment
Share on other sites

What is this to accomplish?

 

This is the line that is presumably not working

TransmogMannXmog.Activate(self)

 

If that is the case, you are telling the mannequin to activate itself which is something that you won't ever see. If what you want to accomplish is open the inventory for the player to access then replace self with Game.GetPlayer(). However, it would be better to use OpenInventory() if that is indeed your goal.

 

Should I have missed the mark on what you are trying to do then please explain in more detail.

Link to comment
Share on other sites

Yep, TransmogMannXmog.Activate(self) is indeed the line that doesn't appear to be working. The relevant portion of the transmog script on the mannequin is below. The Debug.Notification() never runs when using the activator.

Event OnActivate(ObjectReference akActionRef)
	Debug.Notification("Xmog OnActivate running.")  ;Using to troubleshoot
	if TransmogActivator.XmogActivated
		if !self.IsEquipped(xmogHead)
			self.EquipItem(xmogHead)
		endif
		if !self.IsEquipped(xmogBody)
			self.EquipItem(xmogBody)
		endif
		if !self.IsEquipped(xmogHand)
			self.EquipItem(xmogHand)
		endif
		if !self.IsEquipped(xmogFeet)
			self.EquipItem(xmogFeet)
		endif
		if !self.IsEquipped(xmogShield)
			self.EquipItem(xmogShield)
		endif
	endif
endEvent

I've done some more testing this morning, and so far the problem doesn't appear to be related to which objects I'm using. I replaced DweButton01 with WETempActivator and it still doesn't work. I've got a duplicate setup of mannequin & activator in MolagBalVoiceCell where I originally wrote the script and used as reference, and the scripts are running just fine. I've again checked all the property settings and scripts, and they are indeed matching.

 

I'll do some more testing to figure out what other differences might exist. For one, I've noticed the OnReset event fires when I load into the new store cell I created for the 2nd mannequin/activator setup, but doesn't fire when I load into MolagBalVoiceCell with the 1st setup.

Link to comment
Share on other sites

Well...that was silly. ;>_>

 

On yet another double checking of all the settings, I noticed I had "Parent Activate Only" turned on for the mannequin in the 2nd setup, but not in the 1st. Which, obviously, means the only possible thing allowed to activate the mannequin is the mannequin trigger box. On all my double checks, I only ever checked to see that the Activate Parent was set...completely ignored the Parent Activate Only check box.

 

It's working now. Sorry for wasting your time. :(

Link to comment
Share on other sites

  • Recently Browsing   0 members

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