Jump to content

IsInterior function will not compile in my script


tonycubed2

Recommended Posts

Greetings,

 

I am getting the error that there is no such function as IsInterior when I know there is. Any help truly appreciated. Here is the short script:

 

Scriptname FtravelAmbush Extends ObjectReference  

import Game
import Utility

ObjectReference Property presentlocal Auto 


Event OnCellLoad()
presentlocal = (GetPlayer().GetCurrentLocation())
if presentlocal.IsInterior())
Utility.Wait(20)
GetPlayer().PlaceAtMe (LivingDead ,10)
EndIf
EndEvent

ActorBase Property LivingDead  Auto  

ActorBase Property Warlock  Auto  

Link to comment
Share on other sites

IsInterior is a function of the Cell script. You have 'presentlocal' as an object reference. Another thing that's wrong is that you set 'presentlocal' equal to a location. That won't compile because a location is neither a cell nor an object reference.
Link to comment
Share on other sites

Thanks for reply. I changed to extending cell, but can't find a papyrus script command to get the location as a cell to see if the payer is outdoors. Can I beg you To be more specific? My skills are average on a good day. But i am trying to learn. Here is my mod:

 

http://skyrim.nexusmods.com/downloads/file.php?id=12452

Link to comment
Share on other sites

Thank you, using that and correcting the quest extended got the script working, had to change a few more things. All I need now is the command for stopping the quest and resetting it. The wiki says to use Function Stop() native with the example being Funquest.Stop() but I cant get that to compile/work. The wiki link is : http://www.creationkit.com/Stop_-_Quest Please see the script below. What am I doing wrong now? The name of the quest is "FastTravelAmbushes2012" . This script is in the script section of the quest which is in turn part of the SM Event Node. The quest is firing off exactly as I want, I just need to reset teh quest so that it will fire off again the next fast travel time. The errors are "varialbe fasttravelambushes 2012 is undefined and none is not a known user-defined type.

 


Scriptname FtravelAmbush Extends Quest  

import Game
import Utility

ObjectReference Property presentlocal Auto 


Event OnStoryChangeLocation(ObjectReference akActor, Location akOldLocation, Location akNewLocation)
if !((GetPlayer().GetParentCell()).IsInterior())
Debug.MessageBox("is exterior")
Utility.Wait(20)
GetPlayer().PlaceAtMe (LivingDead ,10)
EndIf
FastTravelAmbushes2012.stop()
FastTravelAmbushes2012.reset()
EndEvent

ActorBase Property LivingDead  Auto  

ActorBase Property Warlock  Auto  





Link to comment
Share on other sites

Papyrus has no knowledge of the items in the game. If you want to refer to something then you need to tell it.

 

Quest Property FastTravelAmbushes2012 Auto

 

I noticed that this is a quest script, are you trying to stop and start the quest that this script is in?

If that's the case then you'd only need

 

Reset()

Link to comment
Share on other sites

tunaisafish: That worked great, I am very close to having it all work. The script below now compiles and when the player enters a new location the SM Event fires off the quest that fires off the script below. However, I only want the ambushers to be spawned on a major location change, like with FastTravel. Not just moving from one adjacent cell to another. But every couple of minutes running it fires off again. I guess a new location is being entered? the line if !akOldLocation == akNewLocation was supposed to fix that but it has not... Any ideas?

 

Scriptname FtravelAmbush Extends Quest  

import Game
import Utility

ObjectReference Property presentlocal Auto 


Event OnStoryChangeLocation(ObjectReference akActor, Location akOldLocation, Location akNewLocation)
if !akOldLocation == akNewLocation
if !((GetPlayer().GetParentCell()).IsInterior())
Debug.MessageBox("is exterior")
ObjectReference PlayerRef = Game.GetPlayer()
PlayerRef.PlaceActorAtMe (Ambushers1, RandomInt(1, 5)).StartCombat(Game.GetPlayer())
EndIf
EndIf
reset()
EndEvent

ActorBase Property Ambushers1  Auto  

ActorBase Property Warlock  Auto  





Quest Property FastTravelAmbushes2012  Auto  

Link to comment
Share on other sites

  • Recently Browsing   0 members

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