Scripting Errors

Post » Sun Jan 11, 2015 8:12 am

Hey guys I am working on an Activator Book that needs to teleport a new cell called TeleportArea which has a COC marker and MapMarker. It doesn't compile correctly, also it doesn't teleport me any where because it say the TeleportArea is undefined, it also doesn't work for Riften either. So I am guessing I am making an error somewhere.

Here is my script:

Scriptname Class01Script extends ObjectReference
Message Property Question Auto
Message Property yes Auto
Message Property No Auto
MiscObject Property Gold001 Auto
int Button
EVENT onActivate(objectReference akActionRef)
If akActionRef == Game.GetPlayer()
Button = question.show()
if Button == 0
yes.show()
Game.FastTravel(TeleportArea)
elseif Button == 1
No.show()
endif
EndIf
endEVENT
User avatar
Lawrence Armijo
 
Posts: 3446
Joined: Thu Sep 27, 2007 7:12 pm

Post » Sun Jan 11, 2015 4:55 pm

Game.FastTravel() has one parameter, which is an ObjectReference. So you need to pass an ObjectReference to the function call. The easiest way would be to add an ObjectReference property and fill it with a marker (or other item) in the cell that you want the player to be teleported to.

Scriptname Class01Script extends ObjectReferenceMessage Property Question  Auto   Message Property yes  Auto   Message Property No  Auto  ObjectReference Property TeleportArea Auto MiscObject Property Gold001  Auto   int Button EVENT onActivate(objectReference akActionRef) If akActionRef == Game.GetPlayer()Button = question.show()if Button == 0yes.show()Game.FastTravel(TeleportArea)elseif Button == 1No.show()endifEndIf endEVENT
User avatar
Angela Woods
 
Posts: 3336
Joined: Fri Feb 09, 2007 2:15 pm


Return to V - Skyrim