Jump to content

Portal Scripting Help


Recommended Posts

Ok, so I've made a help room that contains chests with cool stuff and at the top of the stairs in said room is a door that leads to a house in the same cell. There is a solo trap door in the help room. This is the only way out. So what i need help with is: I want to make a extremely small portal thing and stick it on the exterior doorframe of every default in-game house. (Don't worry, I've taken into account the ArmoryLab Mod that does the same thing and made sure no incompatibility would occur.) Now what i would like to happen is when you activate the portal from within the help room a menu will pop up and ask you which city you would like to be teleported to. How would i script this to happen.

 

Thanks-

Link to comment
Share on other sites

I cannot tell how to make script for that, but it's like this:

- Place static markers outside of the portal, as well as inside. They will mark where you enter from or return to. (Do not forget to give them unique reference ID)

- Use player.moveto to teleport player when he/she activate the portal or choose destination from the menu.

Link to comment
Share on other sites

Thats something I've tried. I used the XMarker and scripted it all, but when you exit the room you go to that city and above the XMarker however you are a good 5000 feet above it. Dont know whats wrong I opened the ArmoryLab.esp file and copied the script from it and pasted it on the exit portal. Its promising but has some issues needs a little bit of work.

Heres the portal script.

 

ScriptName yaddayaddayadda

; TS 4/27/06 Created script to teleport to selected house.

; TS 5/6/06 Fixed which house in IC.

; TS 12/19/07 Deleted IC House exit option due to 1.2 patch bug.

 

short MenuItem

float x

float y

float z

float r

ref cell

ref mySelf

ref targetref

 

; get menu choice

begin onActivate

 

if IsActionRef player == 1

MessageBox "Exit which house?", "Anvil House", "Bravil House", "Bruma House", "Cheydinhal House", "Chorrol House", "Leyawiin House", "Skingrad House", "Cancel"

endif

 

end ; onActivate

 

begin gameMode

 

set MenuItem to getButtonPressed

 

if MenuItem > -1

if MenuItem == 0 ; Anvil

set x to -185075

set y to -30808

set z to 301

set r to -45 ; -90

set cell to AnvilExterior04

elseif MenuItem == 1 ; Bravil

set x to 65013

set y to -38663

set z to 592

set r to 0 ; 0

set cell to BravilSouth01

elseif MenuItem == 2 ; Bruma

set x to 26868

set y to 148179

set z to 25735

set r to 200 ; 283

set cell to BrumaExterior

elseif MenuItem == 3 ; Cheydinhal

set x to 117509

set y to 87518

set z to 7077

set r to 64 ; 64

set cell to CheydinhalExterior10Arena

elseif MenuItem == 4 ; Chorrol

set x to -66729

set y to 96176

set z to 14476

set r to 45 ; 50

set cell to ChorrolExterior10

elseif MenuItem == 5 ; Leyawiin

set x to 91000

set y to -142582

set z to 137

set r to 90 ; 90

set cell to LeyawiinExterior10

elseif MenuItem == 6 ; Skingrad

set x to -66244

set y to 6835

set z to 6590

set r to 0 ; 0

set cell to SkingradExteriorCC

; elseif MenuItem == 7 ; Cancel menuitem

else ; Cancel

return

endif

 

; Set up magic effect on player while teleporting

set targetref to GetActionRef

set mySelf to getSelf

targetref.pms effectshockshield

mySelf.pms effectshockshield

activate

PlaySound SPLAlterationCast

 

; Teleport player to selected house

player.PositionCell x, y, z, r, cell

PlaySound SPLAlterationCast

return

 

endif ; if > -1

 

end ; gameMode

 

 

Link to comment
Share on other sites

Ok this is my script for the teleportation spell:

 

 

Scn HelpRoomTeleSpellScript

 

Begin OnActivate

If GetActionRef player == 1 && player.getitemcount HelpRoomKey >= 1

player.moveto HelpRoom.HelpRoomPortalXREF

ElseIf

MessageBox "You do not have the Help Room Key in your possession."

EndIf

End

 

 

However on line 5 which is the MoveTo Line i get this error: Syntax error Reference not allowed in this context.

 

Whats wrong with it? And how do i fix it? Sorry I got it didn't need the HelpRoom. Prefix as its a persistent Reference

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...