Trigger On Death 02

Post » Tue Mar 02, 2010 2:10 pm

I want my trap to spurt poision gas opon the death of an npc. below is the ORIGIONAL script for the trap:

scn ARTrapGasEmitter01SCRIPT; spurt gas on activationshort initfloat timershort nextref mySelfref myParentfloat fTrapDamagefloat fLevelledDamagefloat fTrapPushBackfloat fTrapMinVelocityshort bTrapContinuousbegin onActivate	if init == 0		set mySelf to getSelf		set myParent to getParentRef		set init to 1	endif	if isActionRef player == 0 && isActionRef mySelf == 0				set init to 2	; set up the damage values		set fTrapDamage to 10		set fTrapPushBack to 0		set fLevelledDamage to 0.125		set fTrapMinVelocity to 20		set bTrapContinuous to 1				set timer to 8		set next to 1		playgroup forward 1			endifendbegin gameMode;daisy-chain	if next == 1 && timer <= 7		set next to 0		myParent.activate mySelf 1	endif	if timer <= 0 && init == 2				playgroup forward 1		set timer to 10	endif	if timer > 0		set timer to timer - getSecondsPassed	endifend


And hear is the npc's script used to activate the trap and advance the player further in the quest:

scn AAadvanceOnDeath01Begin OnDeath	SetStage AABattleMageStartTEST 110	Activate DeathTrapEnd


This type of scripting is WAY past my know how and I need help.

--Thanks
-MNPred
User avatar
hannah sillery
 
Posts: 3354
Joined: Sun Nov 26, 2006 3:13 pm

Post » Wed Mar 03, 2010 5:45 am

The way you are calling activate is not correct. Should be DeathTrap.activate NPCRef 1. That means you need to set a ref variable to your NPC in his script, like set NPCRef to getself. The trap needs a parent to work too, so you need to set that up. I guess you could use the NPC as the parent if that makes things easier.
User avatar
Suzy Santana
 
Posts: 3572
Joined: Fri Aug 10, 2007 12:02 am

Post » Wed Mar 03, 2010 6:54 am

So my npc's Script should be:

scn AAadvanceOnDeath01Begin OnDeath	SetStage AABattleMageStartTEST 110DeathTrap.activate SelfRef 1End

User avatar
Tania Bunic
 
Posts: 3392
Joined: Sun Jun 18, 2006 9:26 am

Post » Wed Mar 03, 2010 3:28 am

No more like this.
scn AAadvanceOnDeath01ref meBegin OnDeath	set me to getself	SetStage AABattleMageStartTEST 110DeathTrap.activate me 1End

User avatar
Scott Clemmons
 
Posts: 3333
Joined: Sun Sep 16, 2007 5:35 pm

Post » Tue Mar 02, 2010 9:00 pm

So, I keep the trap script the same and only change the npc's script?
User avatar
James Shaw
 
Posts: 3399
Joined: Sun Jul 08, 2007 11:23 pm

Post » Tue Mar 02, 2010 9:25 pm

My game still crashes when the trap is supposed to be activated. Hmm...Is it possible that it is not the script that crashes the game, but something else related to the trap.. maby the Dasy-chain linking it to 3 other traps of the same nature.
User avatar
April D. F
 
Posts: 3346
Joined: Wed Mar 21, 2007 8:41 pm

Post » Wed Mar 03, 2010 6:15 am

Probably because the trap doesn't have a parent.
User avatar
Arrogant SId
 
Posts: 3366
Joined: Sat May 19, 2007 11:39 am

Post » Wed Mar 03, 2010 12:05 am

Probably because the trap doesn't have a parent.

This. Load the cell with your NPC and double click on him/her in the Render Window. A Reference Window for your NPC will open. Towards the bottom left-hand side, you will see a box named Persistent Reference. Click on it to make your NPC a Persistent Reference. In the middle of the Reference Window, you will see several tabs (3D Data, Enable Parent, Merchant Container & Travel Horse). Click on the Enable Parent tab. Now click on the button that says Select Reference in Render Window. A red crosshair will appear. Move it over the first gas trap in your chain (the crosshair should turn white) and double click on it. That should fix the problem.
User avatar
Stat Wrecker
 
Posts: 3511
Joined: Mon Sep 24, 2007 6:14 am

Post » Tue Mar 02, 2010 9:05 pm

Ohhh! THAT was my problem!!! I had the Parent marked as the Child and Vis\Versa! Oh I feel Sooo stupid...

Thanks!
User avatar
Kerri Lee
 
Posts: 3404
Joined: Sun Feb 25, 2007 9:37 pm


Return to IV - Oblivion