Page 1 of 1

Had an idea. Scripted Temple Teleport

PostPosted: Mon Apr 19, 2010 11:59 am
by Nodding Off
I started playing the Temple quest-line, working through the Pilgrimage, and started thinking. A scripted teleport ring for the temple, would be kind of nice. The "chart" i wrote down, looks something like this ...

[align=center]On equip, use global to set state (1,2,3, etc.).
Check player location in relation to nearest Temple.
cast "mark", or somehow keep players current position logged.
Check if player is member of the Temple (or if Expelled).
Teleport to nearest temple, add minor restore health for short period of time.
Change state.
On next equip, ask if player would like to return to previous location. if yes, change state to original, teleport, add minor sanctuary bonus for short period of time.[/align]

I'm not sure, but I think the divine intervention spell takes you to the nearest temple in the first place.

I don't think this would be too hard to do, and shouldn't need MWSE, and also, if I use standard spells, like mark and recall, should also cater to the very small percentage of the Morrowind community who don't have the expansions, for whatever reason.

I'll post my attempt at the script a little bit later, but for now, what are your thoughts on this? Is there a better way I can organize, and implement my idea?





Edit:  Well my attempt crashed Morrowind. :P Pretty quickly too.  Here's what I have

Code: Select all
Begin MSTT_TR

short OnPCEquip
short MSTT_TRG

if ( OnPCEquip == 1 )
       if ( GetPCRank "Temple" == -1 )
               MessageBox "Only one of the cloth may wear this."
       elseif ( PCExpelled "Temple" == 1)
               MessageBox "You must make peace with the Temple before you may wear this."
       elseif Cast, "MSTT_AI", Player
       set MSTT_TRG to 1
               set OnPCEquip to 0
endif
endif
endif
endif

if ( MSTT_TRG == 1 )
       if ( OnPCEquip == 1 )
       if ( GetPCRank "Temple" == -1 )
               MessageBox "Only one of the cloth may wear this."
       elseif ( PCExpelled "Temple" == 1)
               MessageBox "You must make peace with the Temple before you may wear this."
       elseif Cast, "MSTT_R", Player
       set MSTT_TRG to 0
endif
endif
endif
endif
endif

End MSTT_TR


The spells "MSTT_AI" and "MSTT_R" were created to save space. The first, by casting "mark" on the player, then Almisvi's Intervention, and finally a 10 second restore health spell for 5 points.  The second, MSTT_R, simply recalls the player, and casts a ten second sanctuary spell for 5 points.

Re: Had an idea. Scripted Temple Teleport

PostPosted: Mon Apr 19, 2010 2:27 pm
by Jac
I wouldn't cast mark because that would erase a mark that the player already has. You can save the player's current position via variables, I believe. The CTD could be caused by mark being an onself only spell and not one that can be cast on another actor. For example: I can't cast mark on an NPC, but I can cast it on myself. I'm not sure, but I wouldn't use mark to store the player's current position.

Re: Had an idea. Scripted Temple Teleport

PostPosted: Mon Apr 19, 2010 2:31 pm
by Nodding Off
So, how could I use a variable to register a location, and to get the player back to that location?

Re: Had an idea. Scripted Temple Teleport

PostPosted: Mon Apr 19, 2010 2:42 pm
by Jac
You would need to declare three floats and use the player->GetPos for x, y, & z. Then you could move them based on what cell they're currently in using player->SetPos x, y & z (note that all three have to be on a separate line). No, that wouldn't work because SetPos can't take variables. You might have to use MWSE for this unfortunately. Maybe Peachy Keen has better insight.

Re: Had an idea. Scripted Temple Teleport

PostPosted: Mon Apr 19, 2010 2:50 pm
by Nodding Off
What if, I had the script drop an item under the terrain, under the PCs feet, and used that as a marker? Would COC work for that?

Re: Had an idea. Scripted Temple Teleport

PostPosted: Mon Apr 19, 2010 3:04 pm
by Jac
COC is center on cell and won't work for an item. Plus COC is buggy and can cause crashes. I'm afraid that the only way you'll be able to get this to work is via MWSE.

Re: Had an idea. Scripted Temple Teleport

PostPosted: Mon Apr 19, 2010 3:17 pm
by Nodding Off
COC was a bad example.  What I'm thinking now is, "placeatpc" in conjunction with player-> position maybe?

EDIT: From how I am understanding this (Scripting for Dummies 9), I would very possibly have to set up a list of if ( getpccell == ) and possibly list each cell with a short (Scary. Lost of work there)

Re: Had an idea. Scripted Temple Teleport

PostPosted: Wed Apr 21, 2010 4:42 am
by Fliggerty
You can use Position to place the PC in a location using stored position variables in an exterior only.  To include support for interiors, you need to use MWSE.

Re: Had an idea. Scripted Temple Teleport

PostPosted: Wed Apr 21, 2010 10:54 am
by Nodding Off
That's not too bad, since the divine and alsmivsi intervention spells tend to drop you off just outside the Temple. Could possibly work it, to make a check if the player is in an interior ... this would be screw anyone in Mournhold though ... So what if I have it check if the player is in an interior, and use "positioncell" in those instances, instead?