Positioncell / scripting help

Post » Sat May 28, 2011 10:13 am

Since I've gotten back into Morrowind lately, I've been reminded of the fact that I really need to update my http://planetelderscrolls.gamespy.com/View.php?view=Mods.Detail&id=7313. Mostly I'd like to add support for http://www.gamesas.com/index.php?/topic/1069365-havish-ctd/page__p__15550866__hl__havish+%2Bctd__fromsearch__1#entry15550866--but like before I took my hiatus, I'm stumped on how to fix this one.

The other two were easy enough to fix--just create a clone copy of the problem-causing NPC to use for the duration of the quest, thus avoiding the positioncell command that's causing the crashes. (Previously, the NPC would be teleported all over the place with positioncell--and for whatever reason, at a certain point in each quest, the game would trip over a single positioncell command and crash.) Now with the third crash, during the Havish Mages' Guild's teleporter quest...the trouble's not with an NPC, it's with a set of activators:

Journal ZH_MG_Teleporter 50ZH_Tele_Anchor1->Positioncell 59048, 180767, 617, 45, "Dagon Fel"ZH_Tele_Anchor2->Positioncell -84196, 90856, 1033, 0,  "Gnisis"ZH_Tele_Anchor3->Positioncell 53158, -48269, 610, 45,  "Suran" ZH_Tele_Anchor4->Positioncell 84799, 118448, 3030, 0, "Tel Vos"Choice "You're welcome" 7


In Havish currently, JOG has those activators hidden "off-screen" in the Havish Mages' Guild. The positioncell command would, in theory, remove them to their assigned cells. The trouble is that if the player hasn't visited all those cells and returned to Havish within a 72-hr timeframe, the game CTDs. The 72-hr bug strikes again, I guess.

So...I'm not sure how to fix this one. I've thought of removing the activators to somewhere hidden in the cells where they're supposed to end up, but that seems to be tempting conflicts with city overhaul mods (Suran Extended especially)--and I'm not sure it would resolve the CTD anyway. The other thought I had was to place the activators in their intended destinations, with a script attached disabling them until Journal ZH_MG_Teleporter equals or is greater than 50.

In that case, unfortunately, scripting for MW has and always will be my Achilles' heel...so I haven't the slightest idea how to write that one. Any scripting gurus out there who'd care to help me with that one? Or is there a better option?
User avatar
Jeffrey Lawson
 
Posts: 3485
Joined: Tue Oct 16, 2007 5:36 pm

Post » Sat May 28, 2011 8:47 am

I looked at Havish in the construction set and I cannot see any obstacle to your idea of setting the four teleport markers in their target locations disabled until the journal condition is satisfied. There could be no conflict with other mods that did not already exist. JOG writes specific coordinates for the crystals to be located. If a mod plants a new structure in the same spot the teleport marker would not be available in either case. Here is a script that you could attach to the crystals (ZH_Tele_Anchor1, etc.). They do not already have a script attached to them so this will be easy. The crystals no longer require reference persists if the reference to them in Valeria Nistrus' (ZH_MG_GuildGuide) dialog results is commented out.

Begin ZH_TeleAnchorScript; Attached to ZH_Tele_Anchor1, 2, 3 and 4short doOnceif ( doOnce == 2 )    returnendifif ( doOnce == 1 )    if ( ( GetJournalIndex "ZH_MG_Teleporter" ) >= 50 )        set doOnce to 2        Enable    endifendifif ( doOnce == 0 )    set doOnce to 1    DisableendifEnd ZH_TeleAnchorScript


Edit: clarification
User avatar
Nicole Kraus
 
Posts: 3432
Joined: Sat Apr 14, 2007 11:34 pm

Post » Fri May 27, 2011 11:39 pm

:clap:

Many thanks, cyran0! I shall have to give this a whirl.
User avatar
carley moss
 
Posts: 3331
Joined: Tue Jun 20, 2006 5:05 pm

Post » Sat May 28, 2011 1:01 am

Hey, I'm wanting to do the same thing basically for Pelagiad Expanded. I have an NPC in an interior cell. I want him to teleport to outside the front door at 2000 and then walk to his house.

I asked Arcimaestro Anteres and he said to place a scripted item somewhere outdoor in the exterior cell so that it checks what time of the day it is.

Would it be something like this:

NpcName->PositionCell 2200, -56900, 1300, 0 "ExteriorCellName"

How did you write yours Tyraa? I want the NPC to do this everyday. To teleport to 2200, -56900, 1300, walk along grid path to house, teleport to interior cell house. Then at 0700 the next morning, teleport outside interior cell house, walk along same grid path to original starting cell 2200, -56900, 1300, and teleport from outside to the original interior cell. Sounds a little complicated, I guess. How would you write the teleporting and timers? Would I just need one activator hidden outside somewhere to do all of these commands?
User avatar
P PoLlo
 
Posts: 3408
Joined: Wed Oct 31, 2007 10:05 am

Post » Sat May 28, 2011 6:08 am

How did you write yours Tyraa? I want the NPC to do this everyday. To teleport to 2200, -56900, 1300, walk along grid path to house, teleport to interior cell house. Then at 0700 the next morning, teleport outside interior cell house, walk along same grid path to original starting cell 2200, -56900, 1300, and teleport from outside to the original interior cell. Sounds a little complicated, I guess. How would you write the teleporting and timers? Would I just need one activator hidden outside somewhere to do all of these commands?


Hmm. I may not be the best person to ask for help--my experience with Positioncell mostly boils down to trouble-shooting. ;) I will share what I've learned with Havish, though; some of it may help:

First of all...positioncell has caused a lot of grief for me, obviously. The trouble with a select few of Havish's quests seems to be some bizarre, unholy combination of positioncell and the 72-hr bug, and/or attempting to move an NPC into an 'uninitialized' cell--IE, one the player hasn't visited within 72hrs, or has yet to visit in the game at all.

For instance, at the end of the "Fighters Guild: A Visitor From Havish" quest, the game attempts to move a Havish NPC (Artemis) from the Balmora, Lucky Lockup cell back into his Havish home. At this point the player has not been to Havish (since this is one of the mod's intro quests), and has not been into that interior cell. When the game attempts to reposition that NPC, it CTDs consistently, I think because it's trying to move the NPC into a cell the player hasn't been in yet. That the "Mages Guild: Teleporter Crystals" quest only develops problems if the player doesn't complete it within a 72-hr timeframe (because the game has cleared data for cells it then attempts to positioncell some activators into) lends support to that theory, for me.

(Of course, it also doesn't explain why Havish is stuffed full of other positioncell commands that work perfectly fine no matter what you do. And why some people never experience any problems at all, even with the aforementioned quests. This is one I'm never going to figure out. :ahhh: )

So...in my personal, inexperienced opinion--I would be leery of using a positioncell for what you're proposing. Given what I've dealt with in Havish, moving NPCs between cells in that fashion just seems to be opening a window for trouble to waltz in. An alternative would be to do something like I've done with the fixes for the "A Visitor from Havish" and "The Damsel in Distress" Havish quests: create clone NPCs. Two NPCs, perfectly alike--one stays in the interior of the house and one follows the pathgrid you described in your post on the exterior. Attach a script to each one enabling and/or disabling them at the appropriate times.

You can start your own thread and ask around...maybe someone less likely to run screaming from a positioncell command might be able to suggest a script like you want. :shrug: It could still work, and I could just be paranoid, but...I still wouldn't recommend it myself.
User avatar
Alyce Argabright
 
Posts: 3403
Joined: Mon Aug 20, 2007 8:11 pm

Post » Fri May 27, 2011 11:53 pm

So...in my personal, inexperienced opinion--I would be leery of using a positioncell for what you're proposing. Given what I've dealt with in Havish, moving NPCs between cells in that fashion just seems to be opening a window for trouble to waltz in. An alternative would be to do something like I've done with the fixes for the "A Visitor from Havish" and "The Damsel in Distress" Havish quests: create clone NPCs. Two NPCs, perfectly alike--one stays in the interior of the house and one follows the pathgrid you described in your post on the exterior. Attach a script to each one enabling and/or disabling them at the appropriate times.

You can start your own thread and ask around...maybe someone less likely to run screaming from a positioncell command might be able to suggest a script like you want. :shrug: It could still work, and I could just be paranoid, but...I still wouldn't recommend it myself.
Ah yes, the enabling/disabling trick. I'm using that with activators and whatnot. That's a good idea. Good god, Pelagiad Expanded already has over 120 custom NPCs. That'll mean well over 200. Thanks. I'll post a new topic.
User avatar
Bloomer
 
Posts: 3435
Joined: Sun May 27, 2007 9:23 pm


Return to III - Morrowind