Teleport On Equip

Post » Tue May 17, 2011 2:16 pm

Hi guys,

I'm extremely new to scripting and would like to make a script for the following:
Once a player equips a shovel in their inventory when they are in a specific cell (this script does not work in any other cell), they are teleported to another cell.

This is my very hopeful attempt at the script so far:

scriptname UseShovelbegin OnEquipif player.IsIncell DarkCave01  *Feel free to laugh at this!*	player.unequipItem Shovel011	messagebox "Welcome to the Underworld!"          player.moveToMarker DarkCave02Marker  *I would prefer not to use a marker but do not know any other method.*elsemessagebox "You can't use that item here."end


Sorry.. I have literally been using the construction set for no more then half an hour and have literally no experience in coding. So, I had a pretty hopeful go at writing the script because I think it's unfair to expect others to do all the work when I haven't even tried.

Anyways, see if you can help me out!
Thanks!
User avatar
Lakyn Ellery
 
Posts: 3447
Joined: Sat Jan 27, 2007 1:02 pm

Post » Tue May 17, 2011 3:52 am

That's really good for a first script with no coding experience. I only see three problems with it (and one of them isn't really much of an issue):

1. Use Begin OnEquip Player as the starting point. Otherwise, this script will run whenever any actor equips the shovel. That's not really much of an issue in this instance, but it's a good scripting habit to get into. ;)

2. There is no IsInCell function. Use GetInCell instead.

3. There is no MoveToMarker function. Use MoveTo instead.

So the script will look like:

scriptname UseShovelbegin OnEquip Playerif player.GetIncell DarkCave01 == 1 ;make sure you enter the spaces.	player.unequipItem Shovel011	messagebox "Welcome to the Underworld!"          player.moveTo DarkCave02Markerelsemessagebox "You can't use that item here."end


There is a similar way of scripting this that uses doors instead of a marker, but it's been a while since I did it. I'll try to find the mod I did it with and post back with the results.
User avatar
Andres Lechuga
 
Posts: 3406
Joined: Sun Aug 12, 2007 8:47 pm

Post » Tue May 17, 2011 4:46 am

Thanks a lot, mate. Your help is really appreciated.

Just while I have you here, do you have any tips on navigating the Tamriel worldspace? I know a particular place I want to edit, but have no idea how to find it when everything is labeled as "Wilderness".

Cheers
User avatar
Luna Lovegood
 
Posts: 3325
Joined: Thu Sep 14, 2006 6:45 pm

Post » Tue May 17, 2011 6:02 am

Thanks a lot, mate. Your help is really appreciated.

Just while I have you here, do you have any tips on navigating the Tamriel worldspace? I know a particular place I want to edit, but have no idea how to find it when everything is labeled as "Wilderness".

Cheers


I would this http://www.tesnexus.com/downloads/file.php?id=5703 and then find the location on the map. Then you'll be able to quickly find it in the CS using the grid coordinates.
User avatar
luis ortiz
 
Posts: 3355
Joined: Sun Oct 07, 2007 8:21 pm

Post » Tue May 17, 2011 5:02 am

Thanks a lot, mate. Your help is really appreciated.

Just while I have you here, do you have any tips on navigating the Tamriel worldspace? I know a particular place I want to edit, but have no idea how to find it when everything is labeled as "Wilderness".

Cheers

If you're walking through the cell you want to mod, you can use the console to find out which cell you're in. First, type sdt 0 and press Enter (you only need to do this once), then type tdt and press enter. This will turn on the Debug Text. The ID of your current cell will be among the information on the right side of the screen (the 7th line from the top). Once you have the cell ID ( for example Wilderness 13, -24) you can find it in the CS pretty easily. In the cell view window, click on the bar titled Location (at the top of the column where the coordinates are listed) and they will automatically be arranged in numerical order. The all you have to do is scroll down until you find the desired cell. The grid mad that Cydonian_Knight linked to is also very useful. I wish I could find one for Fallout 3.
User avatar
Ross Zombie
 
Posts: 3328
Joined: Wed Jul 11, 2007 5:40 pm

Post » Tue May 17, 2011 7:32 am

I never have trouble finding cells. All you have to do is look at your map in-game and find a close by location.

Then in the Cell View window just type the name of the location. Then you use the arrow keys to move the cell towards the location you want based on which direction it was from the map view.

First, hit the 'B' key to turn cell borders on.
User avatar
Batricia Alele
 
Posts: 3360
Joined: Mon Jan 22, 2007 8:12 am

Post » Tue May 17, 2011 10:55 am

Additionally . . .

A trick I use when editing a fixed number of cells (interiors and/or exteriors) is creating an object and placing one reference of it on each cell I want to navigate to.
Then using the object 'Use Info' (right click on the objet window) to go directly to the desired cell.

Another, even more convenient way, when there are only two particular cells involved, is placing connecting doors on those two cells and clicking on the door marker to go back and forth.
User avatar
Lynette Wilson
 
Posts: 3424
Joined: Fri Jul 14, 2006 4:20 pm

Post » Tue May 17, 2011 4:14 am

Okay thanks a lot guys, I think I've got it now :)
User avatar
Laura Mclean
 
Posts: 3471
Joined: Mon Oct 30, 2006 12:15 pm


Return to IV - Oblivion