Teleportation device

Post » Wed Nov 04, 2009 10:58 pm

Hello there fellow Morrowind players! :wavey:
I am quite new to modding so please have patience with me. :unsure:
I want a piece of wall to work as a teleportation device.
When you activate it you will get a riddle, if you choose the right answer you will be teleported inside. Pretty cool huh? :clap:
The problem is that it looks like I can't ad a script to the wall... I tried with a torch ring also but no succes :( How can I make my dreams come true? :sad:
This is how far I have gotten with the script itself.

Begin my_first_script
Short controlvar
Short button
If ( OnActivate == 1 )
If ( controlvar == 0 )
MessageBox "Here be riddle of D00M!", "Wrong answer", "Wrong", "Correct answer", "Not correct"
Set controlvar to 1
endif
endif
if ( controlvar == 1 )
set button to GetButtonPressed
if ( button == -1 )
return
elseif ( button == 2 )
MessageBox "Enter"
Player->PositionCell 4204 -2631 -14684 "Castle Solstheim entrance"
set controlvar to 2
else
MessageBox "You shall not pass or something"
set controlvar to -1
Endif
elseif ( controlvar == 2 )
Player->PositionCell 4204 -2631 -14684 "Castle Solstheim entrance"
Set controlvar to 3
endif
End

I am aware of the fact that you only have one try to get in and if you choose the wrong answer you wont be able to enter at all. But that way it is more exciting. :obliviongate:
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Wed Nov 04, 2009 8:47 pm

The script itself looks all right. As for attaching the script to a wall... this is what I would *try* to do (no idea whether it will work exactly as planned). First, look at the piece of wall you want to work as an activator. Find the static for this wall, and notice the name of the mesh it uses. For example, let's say that you've chosen the piece that is called ex_hlaalu_wall_01 - in the mesh button it has "x\Ex_hlaalu_wall_01.nif". This is the model that you will need for your activator, but you don't have it - it's packed into Morrowind.bsa, and CS can't take meshes from there. Load the CS disk that contains all meshes and textures in unpacked form, copy the Ex_hlaalu_wall_01.nif mesh into path ...Data Files\Meshes\x where your game is installed (in case there's no "x" folder in "Meshes", you'll have to create it). Now open "Activators" panel and create a new activator. Click on "Add Art File" button and find that file you've just copied. Into the "Script" field insert the name of your script - "my_first_script" in this case. Now you've cheated the CS, you can delete the copied Ex_hlaalu_wall_01.nif file - once the correct address is entered, CS *can* extract it from Morrowind.bsa.

That's it. Go to the cell, remove the static piece from the wall and replace it by your activator where you want it.
User avatar
Courtney Foren
 
Posts: 3418
Joined: Sun Mar 11, 2007 6:49 am

Post » Wed Nov 04, 2009 4:59 pm

I think you have the wrong number of arguments for PositionCell. It should be
Player->PositionCell 4204 -2631 -14684 0 "Castle Solstheim entrance"
User avatar
Jason White
 
Posts: 3531
Joined: Fri Jul 27, 2007 12:54 pm

Post » Wed Nov 04, 2009 11:05 am

The script itself looks all right. As for attaching the script to a wall... this is what I would *try* to do (no idea whether it will work exactly as planned). First, look at the piece of wall you want to work as an activator. Find the static for this wall, and notice the name of the mesh it uses. For example, let's say that you've chosen the piece that is called ex_hlaalu_wall_01 - in the mesh button it has "x\Ex_hlaalu_wall_01.nif". This is the model that you will need for your activator, but you don't have it - it's packed into Morrowind.bsa, and CS can't take meshes from there. Load the CS disk that contains all meshes and textures in unpacked form, copy the Ex_hlaalu_wall_01.nif mesh into path ...Data Files\Meshes\x where your game is installed (in case there's no "x" folder in "Meshes", you'll have to create it). Now open "Activators" panel and create a new activator. Click on "Add Art File" button and find that file you've just copied. Into the "Script" field insert the name of your script - "my_first_script" in this case. Now you've cheated the CS, you can delete the copied Ex_hlaalu_wall_01.nif file - once the correct address is entered, CS *can* extract it from Morrowind.bsa.

That's it. Go to the cell, remove the static piece from the wall and replace it by your activator where you want it.

Alright! That sounds wicked awesome! But also very logical. Thanks a lot for the in depth answer. I greatly appriciate it! Will try it this evening when I get home. :foodndrink:

I think you have the wrong number of arguments for PositionCell. It should be
Player->PositionCell 4204 -2631 -14684 0 "Castle Solstheim entrance"

Ooh really... I have seen that in a lot of places but never really understood why it is supposed to be there... If I may bother you further with a simple question, why? :cookie:
Thank you for looking through the script and everything! :foodndrink:


Will update the thread when I have results! :goodjob:
User avatar
CORY
 
Posts: 3335
Joined: Sat Oct 13, 2007 9:54 pm

Post » Wed Nov 04, 2009 10:52 am

Ooh really... I have seen that in a lot of places but never really understood why it is supposed to be there... If I may bother you further with a simple question, why?
The fourth number is angle at which object looks. In theory, it should be 0=North, 90=East, 180=South, and 270=West. Unfortunately, between vanilla Morrowind and Bloodmoon it was changed to accept radians instead of degrees, so with old mods running on machines with Bloodmoon and new mods created with CS v1.60 and loaded by people with vanilla Morrowind only, assigning it anything but 0 is unreliable. But the syntax of the command still requires it.
User avatar
Victor Oropeza
 
Posts: 3362
Joined: Sun Aug 12, 2007 4:23 pm

Post » Wed Nov 04, 2009 3:51 pm

The fourth number is angle at which object looks. In theory, it should be 0=North, 90=East, 180=South, and 270=West. Unfortunately, between vanilla Morrowind and Bloodmoon it was changed to accept radians instead of degrees, so with old mods running on machines with Bloodmoon and new mods created with CS v1.60 and loaded by people with vanilla Morrowind only, assigning it anything but 0 is unreliable. But the syntax of the command still requires it.


Alright. Thank you for the update. That is certainly something I'm going to write down for the future!

Alright! That sounds wicked awesome! But also very logical. Thanks a lot for the in depth answer. I greatly appriciate it! Will try it this evening when I get home. :foodndrink:


Ooh really... I have seen that in a lot of places but never really understood why it is supposed to be there... If I may bother you further with a simple question, why? :cookie:
Thank you for looking through the script and everything! :foodndrink:


Will update the thread when I have results! :goodjob:


I just realised. I don't have my cs cd in my apartment... My brother have the whole box except for the morrowind cd itself. Typical... Will update next week when I meet him.
Thank you all for very good replies!
User avatar
BrEezy Baby
 
Posts: 3478
Joined: Sun Mar 11, 2007 4:22 am

Post » Wed Nov 04, 2009 5:09 pm

Alright. So far I was able to add a script in the way Kir so neatly explained. Thanks a lot for that! And the script seems to be working as intended, thank you all for having a look through it. But there seems to be something wrong with the coordinates. So my question, may be a simple one (I hope...), is there a way to see if the coordinates are wrong/right? Mabye I gave the wrong coordinates... :whistling: I got them by looking what coordinates it was in the bottom left corner in Tes while I was in there working. It wouldn't surprise me if that is the cause of the problem... If so, how else do I get the right coordinates?
User avatar
Josh Dagreat
 
Posts: 3438
Joined: Fri Oct 19, 2007 3:07 am

Post » Wed Nov 04, 2009 2:14 pm

Hmm, bottom left corner is where right coordinates are. There are two simple errors easy to make: one is to write down coordinates of a wrong place. For example, you *think* that you're writing down coordinates of a place you see, but the item selected is somewhere else. I usually open two CS windows - one with the mod I edit, and another with simple Morrowind.esm. In the second CS, I place a random NPC where the teleportation should lead, and write down his coordinates while he's enclosed into a selected item's frame and his name is written along with coordinates in the bottom left corner.

Second mistake is even more simple - you might forget or misplace a minus - write something like PositionCell -294 160 52 173 instead of PositionCell -294 160 -52 173.
User avatar
Marina Leigh
 
Posts: 3339
Joined: Wed Jun 21, 2006 7:59 pm

Post » Wed Nov 04, 2009 2:57 pm

Hmm, bottom left corner is where right coordinates are. There are two simple errors easy to make: one is to write down coordinates of a wrong place. For example, you *think* that you're writing down coordinates of a place you see, but the item selected is somewhere else. I usually open two CS windows - one with the mod I edit, and another with simple Morrowind.esm. In the second CS, I place a random NPC where the teleportation should lead, and write down his coordinates while he's enclosed into a selected item's frame and his name is written along with coordinates in the bottom left corner.

Second mistake is even more simple - you might forget or misplace a minus - write something like PositionCell -294 160 52 173 instead of PositionCell -294 160 -52 173.


It's working! IT'S WORKING! :celebrate:
or
It's alive! IT'S ALIVE! :intergalactic:

Thanks a lot for the help! :icecream: I rechecked the coordinates and they where fine, but since I had the "-" before I guess the numbers became negative, and the coordinates are not! :facepalm:

Now the next step in my scripting carrier will be rescripting a propylon :celebration: , but that will be when I'm all done with the rest of the castle :huh: , and that is still far aways :dead: . (I'm not to fond of the teleportation items, it's simply to easy. :cheat: )

Once again, thank you! :wub:
User avatar
[Bounty][Ben]
 
Posts: 3352
Joined: Mon Jul 30, 2007 2:11 pm

Post » Wed Nov 04, 2009 6:46 pm

Reviving this old thread of mine.
I stumbled upon a problem with my "teleportation device".
After I answer correct and all that I teleport in to the room. But when I walk out of the door and try to use it AGAIN to get inside my castle I can't activate it.
So I can't use the teleportation wall more than once.
I know it is because I set the control variable to "3". But what kind of code do I have to type in to make the player be able to enter once again?
I will copy the whole script again so you can see:

Begin my_first_script
Short controlvar
Short button
If ( onactivate == 1 )
If ( controlvar == 0 )
MessageBox "Beginning of Eternety. From the beginning of Eternety. To the end of time and space. To the beginning of every end. And the end of every place.", "Timetravelling", "A book", "The letter E", "An Ogrims dinner"
Set controlvar to 1
endif
endif
if ( controlvar == 1 )
set button to GetButtonPressed
if ( button == -1 )
return
elseif ( button == 2 )
MessageBox "Enter"
Player->PositionCell 4204 2631 14684 0 "Castle Solstheim entrance"
set controlvar to 2
else
MessageBox "You shall not pass"
set controlvar to -1
Endif
elseif ( controlvar == 2 )
Player->PositionCell 4204 2631 14684 0 "Castle Solstheim entrance"
Set controlvar to 3
endif
End

I tried to type in

If ( controlvar == 3 )
If ( onactivate == 1 )
Player->PositionCell 4204 2631 14684 0 "Castle Solstheim entrance"
endif
endif

after
"Set controlvar to 3
endif"
And before
"End"

But that didn't work. I got out once and could use it only one more time to get inside the castle. And the third time I tried to use the teleportation wall I was unable to.
So I can use it once and twice but not thrice... :(
User avatar
Kate Schofield
 
Posts: 3556
Joined: Mon Sep 18, 2006 11:58 am

Post » Wed Nov 04, 2009 4:47 pm

Okey I fixed the problem.
I just (simply enough) added
"Set controlvar to 0" after the "Player->PositionCell 4204 2631 14684 0 "Castle Solstheim entrance""
Really easy... Glad I thought about it :)
User avatar
Catherine Harte
 
Posts: 3379
Joined: Sat Aug 26, 2006 12:58 pm

Post » Wed Nov 04, 2009 8:33 am

Well, I have, once again, spent countless hours on the internet and in the CS desperatly looking for answers. :cry:

This is the current situation:
I am doing a escort quest (for the first time :banghead: ). (If you have any good guides for escort quests specifically you would totally rock my world, I have been looking for that too...) :sad:
I came to the part where the player finds the person whom he/she is going to escort, and I wrote the code for where he was going to be escorted. But when he gets to the point I told him to go to he just stands there. I don't know how to go from there. I'm guessing there should be a script or so that forces him to speak with the player? Or am I totally wrong? :shrug:
But the real question (witch also relates back to the topic of choice) is: After he sais his thanks I want to teleport him inside the house of witch he is standing outside. It is on a hill that you need to use levitate in order to reach so I figured the easiest way was to simply teleport him :nod:
So should I use the "PositionCell" command ("Matteus"->PositionCell, 4182, 4091, 12414, "Castle solstheim, top hut") or is there a better way? :unsure2: I have heard (or read) about the script that is used on the "Gateway haunting" quest which re spawns the ghost back whenever the player leaves, is it possible to do something similar like teleporting Matteus whenever he is out of sight for the player? :batman:

Help is greatly appreciated! :bowdown:
User avatar
Quick Draw III
 
Posts: 3372
Joined: Sat Oct 20, 2007 6:27 am

Post » Wed Nov 04, 2009 6:31 pm

Well, I have, once again, spent countless hours on the internet and in the CS desperatly looking for answers. :cry:

This is the current situation:
I am doing a escort quest (for the first time :banghead: ). (If you have any good guides for escort quests specifically you would totally rock my world, I have been looking for that too...) :sad:
I came to the part where the player finds the person whom he/she is going to escort, and I wrote the code for where he was going to be escorted. But when he gets to the point I told him to go to he just stands there. I don't know how to go from there. I'm guessing there should be a script or so that forces him to speak with the player? Or am I totally wrong? :shrug:
But the real question (witch also relates back to the topic of choice) is: After he sais his thanks I want to teleport him inside the house of witch he is standing outside. It is on a hill that you need to use levitate in order to reach so I figured the easiest way was to simply teleport him :nod:
So should I use the "PositionCell" command ("Matteus"->PositionCell, 4182, 4091, 12414, "Castle solstheim, top hut") or is there a better way? :unsure2: I have heard (or read) about the script that is used on the "Gateway haunting" quest which re spawns the ghost back whenever the player leaves, is it possible to do something similar like teleporting Matteus whenever he is out of sight for the player? :batman:

Help is greatly appreciated!


Okey, so I'm currently wokring on a script now. I don't know if it will work, but this is how far I got:

begin my_third_script
Short do_once

If ( do_once == 0 )
AiFollow, Player, 0, -224374, 193690, 688, 0
Set do_once to 1
endif
If ( do_once == 1 )
if ( GetAIPackageDone == 1 )
Journal "cs_top_hut" 80
MessageBox "Thank you ^PCName"
"castle_solstheim_top2hu"->PositionCell, 3937, 4034, 12414, 360, "Castle Solstheim Top Hut"
Set do_once to 2
endif
endif
End

The script is supposed to make the npc follow the player to a certain position, then update the players journal and teleport the npc to the house (as I priveously mentioned).
The question now is how I activate it... Is there a way for me to activate it via the topics section, in the result box? So when he askes if he should follow the player and the player answers "follow" it will automatically activate the script? Possible or not? If not, can I activate the script via the journal entry instead? :spotted owl:
Any help, as always, is greatly appriciated! I don't know how many hours I put down in this quest
Edit:
I just added the script to Matteus (the NPC) and now it is working flawlessly :dance: Well thank you for your help y'all :meh:
User avatar
Mariaa EM.
 
Posts: 3347
Joined: Fri Aug 10, 2007 3:28 am


Return to III - Morrowind