Teleport/Mark query

Post » Fri May 27, 2011 7:59 am

Has there been any work around discovered for the inability to use global variables in setpos, position, or postiioncell that doesn't involve MWSE? Failing that, is there a way to gain the use of more than one mark spell without having to inventory every cell in the game?

Not that I object to inventorying the entire world (if I get more than 7 days...), but then there is no way to account for mods that create new cells...
User avatar
Elizabeth Falvey
 
Posts: 3347
Joined: Fri Oct 26, 2007 1:37 am

Post » Fri May 27, 2011 9:07 pm

In some circumstances it's simply a matter of using the best tools for the job, and MWSE happens to be the best tool for this kind of thing. Melian has already made an awesome teleportation mod though (Melian's Teleportation Mod), that outdoes Multi Mark and Improved Teleportation in my opinion. There's really no need to re-invent the wheel at this point, unless future versions of MWSE contain new functions that can somehow create a better menu system. (Or you make a "TARDIS" type cell with activators that can teleport you anywhere, solving the menu problem).

I'm afraid non-MWSE scripting is just not up to the task, leaving you with a clunky mod that can only do half of what you want to in this case.
User avatar
Mistress trades Melissa
 
Posts: 3464
Joined: Mon Jun 19, 2006 9:28 pm

Post » Fri May 27, 2011 9:08 pm

I was kinda afraid of that... the mod probably isn't worth too much effort (or at least the small part that I was hoping to cur), and definitely not so grand that anyone would want to install MWSE just for it.

I had this stupid little ashlander tent I wanted to pack around, and I can get into it easy enough, I just have to use my mark/recall to get out of it.... I was just looking for a better solution. :)
User avatar
Angelina Mayo
 
Posts: 3427
Joined: Wed Jan 24, 2007 4:58 am

Post » Fri May 27, 2011 8:05 am

Ah, I see. Yes, it would require MWSE to store your current cell and position so that you could drop it absolutely anywhere, but the problem only really lies with interior cells.

If you limited dropping the tent to exterior cells (and Tribunal fake exteriors), then your scripting problems don't require MWSE, but they do require some careful scripting (or else you can obliterate whole landmasses in the game...I know, this happened to me once). Don't let me scare you though, adding that little FixMe at the right time to the script solves that problem completely and it's good and stable.

What you would do is store the player's x y z and angle, and position the player in Wilderness 0 0 0 0 and warp the player back to their co-ordinates. You have to use FixMe at the right time in the script in order to prevent what I mentioned above from happening. This is used in CD Cooley's Better Portable Containers (the non-MWSE version).

Here is the script I used to warp the player back to a stored exterior position:

Begin BOH_Script_Telvanni; updated based on CDCooley's Better Portable Containers.; if the bag can't open the container because of a reload or the 72 hour cleanup, the player will be temporarily teleported back to the tower; if the player activates the back after being teleported back to the tower, the player will return to the original position; the warp script only works in exterior cells or trib fake exteriorsShort OnPCEquipShort controlvarShort buttonfloat portTimerfloat player_xfloat player_yfloat player_zfloat pafloat timershort player_zoneshort playerWarpIf ( OnPCEquip == 1 )	If ( BagOfHoldingC_Telvanni->GetScale > 2 ) ;checks to see if the bag's scale has been set back to 2 on a reload			MessageBox "You opened the Bag of Holding"			BagOfHoldingC_Telvanni->Activate Player			Set OnPCEquip to 0	Else						; the container cannot be detected		MessageBox "You need to summon the bag to restore its magical link. Would you like to do this now?" "Yes" "No"		Set controlvar to 1		Set OnPCEquip to 2	EndifEndifIf ( MenuMode == 1 )	ReturnEndifIf ( controlvar == 1 )	Set button to GetButtonPressed	If ( button == -1 )		Return	Elseif ( button == 0 )		Set controlvar to 2	Elseif ( button == 1 )		Set controlvar to 0	EndifElseif ( controlvar == 2 ) ;check for exterior cell or trib fake exteriors	If ( GetInterior == 0 )		Set controlvar to 3	Elseif ( GetPCCell "Mournhold, Godsreach" == 1 )		Set controlvar to 3	Elseif ( GetPCCell "Mournhold, Great Bazaar" == 1 )		Set controlvar to 3	Elseif ( GetPCCell "Mournhold, Plaza Brindisi Dorom" == 1 )		Set controlvar to 3	Elseif ( GetPCCell "Mournhold, Temple Courtyard" == 1 )		Set controlvar to 3	Elseif ( GetPCCell "Mournhold, Royal Palace: Courtyard" == 1 )		Set controlvar to 3	Else		MessageBox "You need to go outside to restore the connection."		Set controlvar to 0	Endif	Set OnPCEquip to 0Elseif ( controlvar == 3 )	Set PlayerWarp to 1	Set controlvar to 0EndifIf ( PlayerWarp == 0 )	ReturnEndif; Begin Player Warp ScriptIf ( MenuMode == 0 )	If ( PlayerWarp == 1 )		If ( GetInterior == 0 )			Set player_zone to 1		Elseif ( GetPCCell "Mournhold, Godsreach" == 1 )			Set player_zone to 2		Elseif ( GetPCCell "Mournhold, Great Bazaar" == 1 )			Set player_zone to 3		Elseif ( GetPCCell "Mournhold, Plaza Brindisi Dorom" == 1 )			Set player_zone to 4		Elseif ( GetPCCell "Mournhold, Temple Courtyard" == 1 )			Set player_zone to 5		Elseif ( GetPCCell "Mournhold, Royal Palace: Courtyard" == 1 )			Set player_zone to 6		Else			Set PlayerWarp to 0 ; just double-check to make sure the player isn't in an interior cell before teleporting			Return		Endif		Set PlayerWarp to 5	Elseif ( PlayerWarp == 5 ) ;store the player's current position		Set pa to ( Player->GetAngle z )		Set player_x to ( Player->GetPos x )		Set player_y to ( Player->GetPos y )		Set player_z to ( Player->GetPos z )		Set PlayerWarp to 10	Elseif ( PlayerWarp == 10 )		FadeOut 2		MessageBox "As you reach into the bottomless bag, you find yourself being pulled inside."		Set timer to 0		Set PlayerWarp to 15		Return	Elseif ( PlayerWarp == 15 )		Set timer to ( timer + GetSecondsPassed )		If ( timer > 5 )			Player->coc "Tel Uvirith, Tower Upper"			Set PlayerWarp to 20		Endif	If ( PlayerWarp == 20 ) ;position the player in front of the container			Player->PositionCell -645, -230, -950, 270 "Tel Uvirith, Tower Upper"			Set PlayerWarp to 25	Endif	Elseif ( PlayerWarp == 25 )		FadeIn 2		Set timer to 0		Set PlayerWarp to 30	Elseif ( PlayerWarp == 30 )		MessageBox "You now need to climb back into the bag to get to where you were last."		Set PlayerWarp to 35		Return	EndifEndifIf ( PlayerWarp == 35 ) ;wait for the player to activate the container before continuing	If ( BagOfHoldingC_Telvanni->OnActivate == 1 )		Set PlayerWarp to 40	Else		Return	EndifEndifIf ( PlayerWarp == 40 )	FadeOut 2		MessageBox "You climb back into the bag to return to your former position."		Set PlayerWarp to 45		ReturnElseif ( PlayerWarp == 45 ) ;take the player back to the previous location	Set timer to ( timer + GetSecondsPassed )	If ( timer > 5 )		If ( player_zone == 1 ) ;true exteriors			ToggleMenus		 ;temporarily disable menus while warping the player			Set PlayerWarp to 55		Elseif ( player_zone == 2 )			ToggleMenus			Player->coc "Mournhold, Godsreach"			Set PlayerWarp to 50		Elseif ( player_zone == 3 )			ToggleMenus			Player->coc "Mournhold, Great Bazaar"			Set PlayerWarp to 50		Elseif ( player_zone == 4 )			ToggleMenus			Player->coc "Mournhold, Plaza Brindisi Dorom"			Set PlayerWarp to 50		Elseif ( player_zone == 5 )			ToggleMenus			Player->coc "Mournhold, Temple Courtyard"			Set PlayerWarp to 50		Elseif ( player_zone == 3 )			ToggleMenus			Player->coc "Mournhold, Temple Courtyard"			Set PlayerWarp to 50		Elseif ( player_zone == 3 )			ToggleMenus			Player->coc "Mournhold, Royal Palace: Courtyard"			Set PlayerWarp to 50		Endif	EndifElseif ( PlayerWarp == 50 )		;trib fake exteriors	Player->SetPos x player_x	Player->SetPos y player_y	Player->SetPos z player_z	Player->SetAngle to pa	ToggleMenus					;re-enable menus	MenuTest	MenuTest	Set timer to 0	Set PlayerWarp to 70Elseif ( PlayerWarp == 55 )		;true exteriors	Player->coe 0 -17				;return the player outside	Player->SetPos x player_x	;return to original position	Player->SetPos y player_y	Player->SetPos z player_z	FixMe							;get cell to reload properly OR ELSE IT WILL DESTROY WHOLE TOWNS AND STUFF	Set PlayerWarp to 60EndifIf ( PlayerWarp == 60 )			;reset position again	Player->SetPos x player_x	Player->SetPos y player_y	Player->SetPos z player_z	Player->SetAngle to pa	Set timer to 0	ToggleMenus					;re-enable menus	MenuTest	MenuTest	Set PlayerWarp to 70EndifIf ( PlayerWarp == 70 )	FadeIn 2	Set PlayerWarp to 75Elseif ( PlayerWarp == 75 )	Set PlayerWarp to 0EndifEnd BOH_Script_Telvanni


You could script the carried tent token so that it won't allow the player to drop the tent in an interior cell by using GetInterior, and that would completely eliminate the need for MWSE scripting. You could just use something like this instead.
User avatar
Max Van Morrison
 
Posts: 3503
Joined: Sat Jul 07, 2007 4:48 pm

Post » Fri May 27, 2011 5:25 pm

Hey, that is exactly what I was looking for! It'll take me a while to get it sorted out in my head as to what does what... I got a mind like a steel seive... Only the big chunks remain unless I really work at it. :)

I hope it's okay if I use some rather big chunks of this and ask a question or two once I figure out enough to ask a decent question.

This is really great, thanks!
User avatar
Phillip Hamilton
 
Posts: 3457
Joined: Wed Oct 10, 2007 3:07 pm

Post » Fri May 27, 2011 5:38 am

Use as much of it as you need. I adapted it from CD Cooley's scripting, and it's completely free to modify however you wish.
User avatar
Anne marie
 
Posts: 3454
Joined: Tue Jul 11, 2006 1:05 pm

Post » Fri May 27, 2011 8:00 am

Guess what? I modified the script, and it works like a charm. I do have a couple of questions though...

First, "BagOfHoldingC_Telvanni" is obviously a container, so what was the script attached to that allowed OnPCEquip to work? For the sake of convenience, I attached it to a vanilla "folded cloth" which I'll change later to something more appropriate... anyway, as it stands you equip the cloth to enter the tent and drop I on the floor and activate it to leave. A bit unweildy, but not unworkable.

I also had an issue where the script would run up to "playerwarp" 35 but it would not continue on activating the cloth. It acted as if the script just was not running beyond that point because the frame was long over by the time I was ready to leave the tent. My solution was to copy the snippet of code that sets playerwarp to 40 and put it at the front of the code, and it works well. I'm not sure though how well this is going to work on a reload or if I spend 3 days in the tent.

The note regarding that at the front of the code is still there, but not functional at this point.

Last, the script I use to pitch the tent won't allow it to be set up in an interior cell, and I decided I didn't see a point to allowing it to be set up in Mournhold, so I removed all of the code associated with that.

In case you have suggestions or find a use for it, here's the new code:
Begin NDTentflap2Script;**********************************************************;'Neildarkstar's script;**********************************************************; 'script conversion based on Stuporstar's update of CDCooley's Better Portable Containers.;' if the bag can't open the container because of a reload or the 72 hour cleanup, the player will be temporarily teleported back to the tower;' if the player activates the back after being teleported back to the tower, the player will return to the original position;' the warp script only works in exterior cells Short OnPCEquipShort controlvarShort buttonfloat portTimerfloat player_xfloat player_yfloat player_zfloat pafloat timershort player_zoneshort playerWarpIf ( OnPCEquip == 1 )		MessageBox "Would you like to pass through the tent flap?" "Yes" "No"		Set controlvar to 1		Set OnPCEquip to 2	EndifEndifIf ( MenuMode == 1 )	ReturnEndifIf ( controlvar == 1 )	Set button to GetButtonPressed	If ( button == -1 )		Return	Elseif ( button == 0 )		Set controlvar to 2	Elseif ( button == 1 )		Set controlvar to 0	EndifElseif ( controlvar == 2 ) ;'check for exterior cell 	If ( GetInterior == 0 )		Set controlvar to 3	Else		MessageBox "You need to be outside to use the flap."		Set controlvar to 0	Endif	Set OnPCEquip to 0Elseif ( controlvar == 3 )	Set PlayerWarp to 1	Set controlvar to 0Endif; 'Begin Player Warp ScriptIf ( MenuMode == 0 )	If ( PlayerWarp == 1 )		If ( GetInterior == 0 )			Set player_zone to 1		Else			Set PlayerWarp to 0 ;' just double-check to make sure the player isn't in an interior cell before teleporting			Return		Endif		Set PlayerWarp to 5				Elseif ( PlayerWarp == 5 ) ;'store the player's current position			Set pa to ( Player->GetAngle z )			Set player_x to ( Player->GetPos x )			Set player_y to ( Player->GetPos y )			Set player_z to ( Player->GetPos z )			Set PlayerWarp to 10				Elseif ( PlayerWarp == 10 )			FadeOut 2			MessageBox "You pass through the tent flap"			Set timer to 0			Set PlayerWarp to 15			Return					Elseif ( PlayerWarp == 15 )				Set timer to ( timer + GetSecondsPassed )			If ( timer > 5 )				Player->coc "ND_Tent_Int"				Set PlayerWarp to 20		Endif				If ( PlayerWarp == 20 ) ;'position the player in front of the container			Player->PositionCell  4194, 2988, 15673, 0 "ND_Tent_Int"			Set PlayerWarp to 25		Endif				Elseif ( PlayerWarp == 25 )			FadeIn 2			Set timer to 0			Set PlayerWarp to 30					Elseif ( PlayerWarp == 30 )			MessageBox "You now need to move back through the flap to get to where you were last."			Set PlayerWarp to 35			Return		EndifEndifIf ( PlayerWarp == 35 ) ;'wait for the player to activate the container before continuing	If ( ND_TentFlap->onActivate == 1 )		Set PlayerWarp to 40	Else		Return	EndifEndifIf ( PlayerWarp == 40 )	FadeOut 2		MessageBox "You pass back through the flap to return to your former position."		Set PlayerWarp to 45		Return		Elseif ( PlayerWarp == 45 ) ;'take the player back to the previous location		Set timer to ( timer + GetSecondsPassed )	If ( timer > 5 )		If ( player_zone == 1 ) ;'true exteriors			ToggleMenus		 ;'temporarily disable menus while warping the player			Set PlayerWarp to 55		Endif	Endif	Elseif ( PlayerWarp == 55 )		;'true exteriors		Player->coe 0 -17				;'return the player outside		Player->SetPos x player_x	;'return to original position		Player->SetPos y player_y		Player->SetPos z player_z		FixMe							;'get cell to reload properly OR ELSE IT WILL DESTROY WHOLE TOWNS AND STUFF		Set PlayerWarp to 60EndifIf ( PlayerWarp == 60 )			;'reset position again		Player->SetPos x player_x		Player->SetPos y player_y		Player->SetPos z player_z		Player->SetAngle to pa		Set timer to 0		ToggleMenus					;'re-enable menus		MenuTest		MenuTest		Set PlayerWarp to 70EndifIf ( PlayerWarp == 70 )	FadeIn 2	Set PlayerWarp to 75Elseif ( PlayerWarp == 75 )	Set PlayerWarp to 0EndifEnd NDTentflap2Script

User avatar
SEXY QUEEN
 
Posts: 3417
Joined: Mon Aug 13, 2007 7:54 pm

Post » Fri May 27, 2011 12:18 pm

The script is attached to a token misc object that represents the container in the player's inventory. You have the right idea using a similar token for the tent. I'm glad you got the script to work for you. :)

There is a portable tent mod floating around as well that you might want to have a look at if you need to refine your script at all. I can't remember what it was called at the moment though.
User avatar
JeSsy ArEllano
 
Posts: 3369
Joined: Fri Oct 20, 2006 10:51 am

Post » Fri May 27, 2011 5:11 am

The script is attached to a token misc object that represents the container in the player's inventory. You have the right idea using a similar token for the tent. I'm glad you got the script to work for you. :)

There is a portable tent mod floating around as well that you might want to have a look at if you need to refine your script at all. I can't remember what it was called at the moment though.


Without your help, I'd have probably just given up on it. Thanks again!
User avatar
Naomi Ward
 
Posts: 3450
Joined: Fri Jul 14, 2006 8:37 pm

Post » Fri May 27, 2011 5:13 am

There's a portable yurt by Aragon (I think it's still on PES) - is that the one you're referring to? If so, I'm pretty sure it still uses the slow approach thing, but there's an example of the short method in SfD (written by Nigedo).

Edit: That was directed at Stuporstar...
User avatar
Chase McAbee
 
Posts: 3315
Joined: Sat Sep 08, 2007 5:59 am

Post » Fri May 27, 2011 6:09 am

Ah yes, that is the one.
User avatar
mollypop
 
Posts: 3420
Joined: Fri Jan 05, 2007 1:47 am


Return to III - Morrowind

cron