2 Weird Bugs

Post » Thu Aug 20, 2009 2:00 am

Hi there. I suppose I should introduce myself but I really need this help. I'm fairly new to modding, but I've done a fair bit in Oblivion. Lately I've switched to Morrowind and I've been building a short quest. It is now complete, but is made unplayable by two bugs that I've been turning my scripts upside-down over. I've combed Morrowind Scripting for Dummies and I've double checked everything in UESP's Function List.

Basically, the quest runs thus: Your asked to find a stolen staff, discover it's the work of a staff theif, set a trap by pretending to be a staff merchant, sleep in a specific bed, get attacked by thief, kill him, return staff. However, these are the two bugs:

Bug 1:

When you sleep in the bed you are asked to (it's in the Gateway in Sadrith Mora) you should be woken and you will find that the staff thief (named Harvel Draylan) is attacking you. All this works fine, exept that instead of attacking you he just stands there. Everything else in the same 'if' statement works; you're woken up, he's moved to you, you receive a little message, he even shouts like he's about to attack you ('die!' and such), but he just stands there. Another problem is you can now walk through him as well. It seems something in my script messes him up.

One of the strangest thing about this bug is that it only appeared after I moved Harvel-before he worked fine but got stuck behind a staircase, so I moved him into the centre of the room and suddenly he didn't work. Although admittidly, even in his old place you could still walk through him, even if he did attack. Here's the script that should do this, which is attached to the bed:

begin TRS_AmbushBedScriptshort DoOnceIf ( DoOnce == 0 ) ;I added this to make sure that it's not being repeatedly acitvated.If ( GetPCSleep == 1 ) ;when the PC sleeps	If ( GetPCCell "Sadrith Mora, Gateway Inn" == 1 ) ;but only if they're in the Gateway (and therefor sleeping in the only bed in the cell)		If ( GetJournalIndex "TRS_StolenStaff" == 40 ) ;and if the quest is at the right stage			Set DoOnce to 1			MessageBox "You are woken by a sound." ;a message box, which works			"harvel_draylan"->PositionCell, 3810.070, 4386.288, 1293.371, 0, "Sadrith Mora, Gateway Inn" ;move my thief to the cell. The position is next to the bed. I've checked many times to make sure it's not sunk into the floor or walls. This also works			WakeUpPC ;self-explanatory			Set harvel_draylan.GatewayFight to 1 ;a variable used to decide if the PC did the suggested action to decide on what journal update to use			"harvel_draylan"->StartCombat Player ;and now make him attack! He shouts like he's about to attack, but then just stands there and the music is still normal music, not attacking music. He is also not stuck as attacking him will cause him to attack you back		endif	endifendifendif;below is the standard bed script to make sure you can still use the bed normallyif ( MenuMode == 0 )	if ( OnActivate == 1 )		ShowRestMenu	endifendifend

There you have it. My only thoughts are that the 'PositionCell' function is broken and makes my NPC really buggy, which would explain the ablilty to walk through him. If this is known to be true, can anyone think of a work-around.

Bug 2

When you get the staff and take it back to its owner (Dalyne Arvel) she is supposed to give you a 200 gold reward, remove the staff, add one to her own inventory and update your quest to make it complete. Instead, choosing the topic (stolen staff) with the staff causes a rapidly repeating noise that sounds like a standard click on a topic for a few seconds before the game closes itself without an error message. Here is the dialogue that should result in your reward:
"You found my staff? Oh, I couldn't possibly thank you enough! Here's 200 gold for your trouble, but I will always be in your debt."
ID: dalyne arvel

Function/Variable:
Item: dalynes_staff = 1 (has the player got the staff?)
Journal: TRS_StolenStaff >= 10 (has the player begun the quest so this won't be the first thing she says if you steal the staff)
Journal: TRS_StolenStaff < 100 (has the player not completed this quest, to stop them from stealing the staff and giving it back for a reward)

Result:
player->RemoveItem, "daltnes_staff", 1 ;take the staffdalyne arvel->AddItem, "dalynes_staff", 1 ;give dalyne a staffplayer->AddItem, "Gold_001", 200 ;give the player their rewardJournal TRS_StolenStaff 100 ;update the journal

I have no idea about this one, it's puzzled me for ages. Any thoughts?

Please help, this is driving me mad, and thanks for taking the time to read this massive post. I ought to mention I have cleaned the quest with TESAME, including removing GMSTs, and tried it again but the problems persisted.
User avatar
Kari Depp
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:19 pm

Post » Wed Aug 19, 2009 10:52 pm

For the first script, you can get rid of the cell check if that script is only attached to that particular bed. As for your NPC, I would put him in the cell and disable him, then enable him before he attacks; this will only work if the player doesn't see him when they first enter the cell. Use this script on the NPC:

Begin tg_harvel ;or whatever you want to call the scriptshort doOnceif ( doOnce == 0 )    disable    set doOnce to 1endifEnd

Change "harvel_draylan"->PositionCell, 3810.070, 4386.288, 1293.371, 0, "Sadrith Mora, Gateway Inn" to "harvel_dryalan"->enable. Everything else should work the same. Conversely, you could put him in the wall somewhere that he's not visible to the player so he'll initialize when the player enters the cell.

For the second problem, I think the issue is that "dalyne arvel" isn't in quotes. Morrowind requires ids that are more than one word (underscores between words count as one word total ->dalyne_arvel is one word, not two) be incased in quotes. Because you're adding the item to an NPC that's already "talking", you can do away with the id and just use AddItem, "dalynes_staff", 1 ;give dalyne a staff. If you want to keep the NPC's id, put it in quotes.
User avatar
Ilona Neumann
 
Posts: 3308
Joined: Sat Aug 19, 2006 3:30 am

Post » Thu Aug 20, 2009 2:03 am

Thank you! You have just saved my life! I changed my script to enable a disabled clone and it worked a treat!

As for the second problem... Well, that's my fault. Somehow, in the billion times I checked the result script I managed to overlook the fact that I had mispelt 'dalynes_staff' with a 't'. Removed 't', problem solved. I'm never going to live this one down.

Anyway, thanks again! I was scarily close to giving up there.
User avatar
Jeremy Kenney
 
Posts: 3293
Joined: Sun Aug 05, 2007 5:36 pm

Post » Thu Aug 20, 2009 4:51 am

You're welcome. Just remember that small mistakes like the misspelling happen to even the most experienced of modders so don't let them get you down. Sometimes the best thing to do is to put it down for a bit and ask if you're still having problems when coming back to it. :)
User avatar
Connie Thomas
 
Posts: 3362
Joined: Sun Nov 19, 2006 9:58 am

Post » Thu Aug 20, 2009 8:46 am

Good luck with TR, when you are accepted, the greatness
User avatar
suniti
 
Posts: 3176
Joined: Mon Sep 25, 2006 4:22 pm


Return to III - Morrowind