Playing activation games

Post » Sat Sep 20, 2014 5:28 am

Okay this will be tricky to explain.

I have 2 Activators, the 1st has this script on it and I have set it a linkedref to the 2nd Activator.

Scn DalekFieldControlPanelScriptInt bSwitchInt bDoOnceRef rLinkedBegin OnLoad	If bSwitch == 1		PlayGroup Forward 1	Else		PlayGroup SpecialIdle 1	EndIfEndBegin OnActivate	Set rLinked to GetLinkedRef	If bDoOnce != 1		If bSwitch == 1			PlayGroup SpecialIdle 1			Set bSwitch to 0		ElseIf bSwitch == 0			PlayGroup Forward 1			Set bSwitch to 1		EndIf		If rLinked != 0 && IsActionRef Player == 1			rLinked.Activate Player		EndIf		Set bDoOnce to 1	EndIfEnd
The 2nd Activator has this script attached to it and it has a linkedRef set back to the 1st Activator.

Scn DalekForceFieldScriptShort bOnceRef rLinkedRef rSelfBegin OnLoad	If bOnce == 0		Playgroup Forward 0		Set bOnce to 1	EndIfEndBegin OnHitWith NVDLC03SonicWeaponList	If NVDLC03MQ03.bSonicEmitterUpgraded == 1		Set rSelf to GetSelf		Set rLinked to GetLinkedRef		If rLinked != 0			rLinked.Activate rSelf		EndIf		PlaySound OBJForceFieldDeactivate		Disable	EndIfEndBegin OnActivate	Set rLinked to GetLinkedRef	Set rSelf to GetSelf	If rLinked != 0		rLinked.Activate rSelf	EndIf	PlaySound OBJForceFieldDeactivate	DisableEnd
What I'm after is that if the 2nd Activator (forcefieldwall) is brought down by the sonic emitter or it receives an activation from the 1st or a master activator then it triggers the animation state change on the 1st Activator.

The 1st activator I only want to send the activation to the 2nd when the player activates it.

I've compiled both scripts fine and cross linked the linked references but it doesn't work, One thing I'm not too sure of is if I can pass the reference over and actually have it trigger the OnActivate block. I don't want to pass the references directly as I want to setup 5 instances of this so I really don't want 5 versions of the same script when linkedRefs might work.

Oh and I know I have some redundant code in the 1st script, I was just keeping that if I needed it for another script.
User avatar
herrade
 
Posts: 3469
Joined: Thu Apr 05, 2007 1:09 pm

Return to Fallout: New Vegas

cron