Jump to content

Sleep ambush script help


pc67

Recommended Posts

Hello,

 

I am very new at modding, and i am trying to make a mod where the player is attacked in his sleep by the dark brotherhood. I have tried to base it on the "A knife in the Dark" script where Lucien Lahance visits the player in their sleep. The problem i am having is while the mod message and quest stage triggers properly, the Murderers dont show up.

 

here is the script:

 

Scriptname 1DarkB

 

short setstage

 

Begin MenuMode

 

if ( IsPCSleeping == 1 ) && ( GetStage HouseServant == 100 )

Dark19Murderer3REF.MoveTo Player 12

Dark19Murderer3REF.MoveTo Player 12

Dark19Murderer3REF.MoveTo Player 12

Message "You hear a loud sound as someone stumbles while drawing a weapon..."

WakeUpPC 1

setstage 1DarkB 10

endif

 

end

 

I am sure i've done something wrong with the Dark19Murderer3REF.MoveTo Player 12 command, but i couldn't see it from the mod tutorials available.

 

Also, how would i make this event only occur once?

 

Thanks!

Link to comment
Share on other sites

Hello,

 

I am very new at modding, and i am trying to make a mod where the player is attacked in his sleep by the dark brotherhood. I have tried to base it on the "A knife in the Dark" script where Lucien Lahance visits the player in their sleep. The problem i am having is while the mod message and quest stage triggers properly, the Murderers dont show up.

 

here is the script:

 

Scriptname 1DarkB

 

short setstage

 

Begin MenuMode

 

if ( IsPCSleeping == 1 ) && ( GetStage HouseServant == 100 )

Dark19Murderer3REF.MoveTo Player 12

Dark19Murderer3REF.MoveTo Player 12

Dark19Murderer3REF.MoveTo Player 12

Message "You hear a loud sound as someone stumbles while drawing a weapon..."

WakeUpPC 1

setstage 1DarkB 10

endif

 

end

 

I am sure i've done something wrong with the Dark19Murderer3REF.MoveTo Player 12 command, but i couldn't see it from the mod tutorials available.

 

Also, how would i make this event only occur once?

 

Thanks!

 

I'm not sure about the numerical parameters but it looks like you have 2 quests here: HouseServant & 1DarkB. I think you only need one. Also, I don't think the IsPCSleeping command is 100% reliable except for where used in vanilla quests for some reason. Maybe something is broken in the hard code, I'm not sure. (Just like RPG XV having some broken variables in it and they want $60 for it, jerks! Anyway I digress...)

 

You don't need a 'doonce' variable when the quest stage is updated, but both refs need to be from the same quest.

Link to comment
Share on other sites

I'm not sure about the numerical parameters but it looks like you have 2 quests here: HouseServant & 1DarkB. I think you only need one. Also, I don't think the IsPCSleeping command is 100% reliable except for where used in vanilla quests for some reason. Maybe something is broken in the hard code, I'm not sure. (Just like RPG XV having some broken variables in it and they want $60 for it, jerks! Anyway I digress...)

 

You don't need a 'doonce' variable when the quest stage is updated, but both refs need to be from the same quest.

 

I put the houseservant quest at stage 100 in the if statement so that the mod doesnt trigger until the player has hired eyja (the vanilla oblivion quest called "helping hands", the 100 is the queststage). 1DarkB is the one i made that is supposed to start once the player has been attacked in their sleep.

 

I reran it a few times and the message doesnt trigger each time you sleep, so you are right about the sleep code. That said, the murderers never show up no matter how often the player sleeps.

 

The script command "Dark19Murderer3REF.moveto player 12" is adapted from "a knife in the dark" that moves lucien lahance to the player. the only thing i changed was the name to reference the DB murderers (whose aggression is set to 100, so they should attack on sight). So i assume i'm not using that command properly.

Link to comment
Share on other sites

(EDIT)

 

Actually, 'GetStageDone' would be more accurate if the quest stops itself at that point. If it does stop itself, then GetStage == 100 would no longer be true -- it's only true when the quest is ACTIVE. Also, make sure your assassins have your unique ref names in their ref windows as they will need to be placed somewhere in the game, even if initally disabled. Then you will have to enable them in the script when they appear. Also, your ref names need to be different from one another -- you cannot place two or more refs of the same base object and have the same ref name. Try this: (I also added a 'doonce' type thing with the quest stage)

 

Scriptname 1DarkB

Begin MenuMode

if GetStage 1DarkB < 10
 if ( IsPCSleeping == 1 ) && ( GetStageDone HouseServant >= 100 )
Dark19Murderer1REF.enable
Dark19Murderer2REF.enable
Dark19Murderer3REF.enable
Dark19Murderer1REF.MoveTo Player 12
Dark19Murderer2REF.MoveTo Player 12
Dark19Murderer3REF.MoveTo Player 12
Message "You hear a loud sound as someone stumbles while drawing a weapon..."
WakeUpPC
setstage 1DarkB 10
 endif
endif

end

 

The only thing is the nested if statement might make it even harder for the quest script to pick up that the PC is sleeping. Make sure you set your quest priority high, at least 40 I'd say.

Link to comment
Share on other sites

You have a variable which has the same name as a function (setstage). This will prevent the script from working entirely.

 

You're using the same reference 3 times... Moveto also only works of a placed, persistent reference. If you want 3 actors, you will need to use three different, placed, named, persistent actors to be moved.

Edited by Vagrant0
Link to comment
Share on other sites

I tried to simplify this by creating a single assassin actor called Rothar (ID 11rothar). I then placed him in the DB sanctuary and put him to initially disabled. I changed my script to the following:

 

if GetStage 1DarkB < 10

if ( IsPCSleeping == 1 ) && ( GetStageDone HouseServant >= 100 )

11rotharREF.enable

11RotharREF.MoveTo Player 12

Message "You hear a loud sound as someone stumbles while drawing a weapon..."

WakeUpPC

setstage 1DarkB 10

endif

endif

 

when i try to save the script i get this error message:

 

Script command "11RotharRef.enable" not found.

 

do i need to define 11rotharREF somewhere?

Link to comment
Share on other sites

I tried to simplify this by creating a single assassin actor called Rothar (ID 11rothar). I then placed him in the DB sanctuary and put him to initially disabled. I changed my script to the following:

 

if GetStage 1DarkB < 10

if ( IsPCSleeping == 1 ) && ( GetStageDone HouseServant >= 100 )

11rotharREF.enable

11RotharREF.MoveTo Player 12

Message "You hear a loud sound as someone stumbles while drawing a weapon..."

WakeUpPC

setstage 1DarkB 10

endif

endif

 

when i try to save the script i get this error message:

 

Script command "11RotharRef.enable" not found.

 

do i need to define 11rotharREF somewhere?

 

Once you place the object in the game world double-click on the object to get the ref window for it. In the top blank line you need to put the Ref name, like "MyAssassinRef" or whatever. This is also where you disable the object via check box. Once you do all these things you reference the ref name in the script so it would look like this: "MyAssassinRef.enable" Just to be clear, you cannot use the object ID for certain commands like 'disable' and 'moveto'. In those cases you have to place objects in the game world and give them a ref name.

Link to comment
Share on other sites

Once you place the object in the game world double-click on the object to get the ref window for it. In the top blank line you need to put the Ref name, like "MyAssassinRef" or whatever. This is also where you disable the object via check box. Once you do all these things you reference the ref name in the script so it would look like this: "MyAssassinRef.enable" Just to be clear, you cannot use the object ID for certain commands like 'disable' and 'moveto'. In those cases you have to place objects in the game world and give them a ref name.

 

 

That did the trick! Thanks so much for your help!!

Link to comment
Share on other sites

  • Recently Browsing   0 members

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