Script Won't Work

Post » Sun Oct 18, 2009 6:14 am

For some I reason I don't understand, this script keep moving me to the marker over and over again:

scn 0tfrForgottenKingScriptshort deadbegin OnDeathif (dead == 0)player.moveto tfrForbiddenHallsMarkertfrKingChamberRef.disableset dead to 1endifend


After I killed the creature which triggers the script, I am moved to the marker. I then proceeded through the room I ended up in, and exited the cell. After spending about two to three seconds in the new cell, I am moved back to the marker. I do think that I am moved back to the marker if I just loiter around the first room for the same amount of time that it took me to go into that other cell. No 100% percent sure about that last, though I think I tested it.. but it was quite a while ago.. :P

Anways, does anyone know what the issue here is?
User avatar
Blaine
 
Posts: 3456
Joined: Wed May 16, 2007 4:24 pm

Post » Sun Oct 18, 2009 5:46 am

I don't really know the answer to your question, but I do know that, in the script, there is no need to have the 'death' variable to make sure that the script only executes once. An 'OnDeath' block only ever runs once: the instant the actor dies. It does not run constantly, like 'GameMode', but once, like 'OnEquip'.

The script should probably look like this:

scn 0tfrForgottenKingScript     begin OnDeath          player.moveto tfrForbiddenHallsMarker          tfrKingChamberRef.disable     endifend

User avatar
Peter lopez
 
Posts: 3383
Joined: Mon Sep 10, 2007 5:55 pm

Post » Sun Oct 18, 2009 10:12 am

Moveto acts as a "return" in scripts, so essentially dead is never set to 1, edit it to this:

scn 0tfrForgottenKingScriptshort deadbegin OnDeathif (dead == 0)tfrKingChamberRef.disableset dead to 1player.moveto tfrForbiddenHallsMarkerendifend


Though, tbh, I'd have thought "OnDeath" would only run once anyway, but apparently not :huh:


Lol, ninja'd by Smart Kid. :D
User avatar
jessica sonny
 
Posts: 3531
Joined: Thu Nov 02, 2006 6:27 pm

Post » Sun Oct 18, 2009 6:32 am

I don't really know the answer to your question, but I do know that, in the script, there is no need to have the 'death' variable to make sure that the script only executes once. An 'OnDeath' block only ever runs once: the instant the actor dies. It does not run constantly, like 'GameMode', but once, like 'OnEquip'.

The script should probably look like this:

scn 0tfrForgottenKingScript     begin OnDeath          player.moveto tfrForbiddenHallsMarker          tfrKingChamberRef.disable     endifend


That's how it looked from the beginning, but since I kept on being transported back to the marker, I grew desperate and added the if-things :P But it didn't help :facepalm:
User avatar
Dale Johnson
 
Posts: 3352
Joined: Fri Aug 10, 2007 5:24 am

Post » Sun Oct 18, 2009 6:46 am

yes player.moveto acts as return - does it work if you put the moveto line just before end ? let us know

and don't start editorIDs with numbers :nono:

edit - it never sees end - that is why it doesn't know the on death block did run I guess
User avatar
NAtIVe GOddess
 
Posts: 3348
Joined: Tue Aug 15, 2006 6:46 am

Post » Sat Oct 17, 2009 9:50 pm

Try it with the "dead" flag check, but put the "set dead to 1" before the moveto.

edit: silly thought occurred to me: You don't have Streamline running with it's Crucifixion fix enabled, do you?
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am

Post » Sun Oct 18, 2009 8:23 am

I got this one to work now (Y) I changed the location of the "moveto" command ;)
But here's another problem I have:

scn 0tfrBlackguardScriptbegin OnDeathset tfrBlackbladeGlobal to +1end


This simply won't work :(
I have three other scripts like this one, which should make the total number of the BlackbladeGlobal to be 4, when all the creatures are killed. I also have a quest script checking the global's value, executing some things when its value is 4. But this does not work :( If I manually use "set blackbladeglobal to 4", the script checking its value executes properly...
User avatar
Lauren Graves
 
Posts: 3343
Joined: Fri Aug 04, 2006 6:03 pm

Post » Sun Oct 18, 2009 8:46 am

shouldn't it be "set tfrBlackbladeGlobal to tfrBlackbladeGlobal + 1"
User avatar
Kitana Lucas
 
Posts: 3421
Joined: Sat Aug 12, 2006 1:24 pm

Post » Sun Oct 18, 2009 10:57 am

shouldn't it be "set tfrBlackbladeGlobal to tfrBlackbladeGlobal + 1"

woops :P that did the trick! Thanks ;)
User avatar
Sammygirl500
 
Posts: 3511
Joined: Wed Jun 14, 2006 4:46 pm


Return to IV - Oblivion