Sleepers, Awake! v1.1 by Von Djangos & Adul

Learn about OpenMW mod compatibility, check for problematic mods, discuss issues, and give us feedback about your experience with modded OpenMW.
Post Reply
User avatar
Atahualpa
Posts: 791
Joined: 09 Feb 2016, 20:03

Sleepers, Awake! v1.1 by Von Djangos & Adul

Post by Atahualpa » 04 Nov 2016, 20:20

This mod won't properly work in OpenMW because of the Say function which was implemented differently in our engine. Originally, you could invoke several Say commands on the same character at the same time. OpenMW only allows one of these at a time, leading to cut-off audio when using the mod. (See the thread Sleepers Awake Mod Bug w/ Video for reference.)

If you want to fix the issue, simply open the "Sleepers, Awake!.esp" file in OpenMW-CS, go to the Scripts table, sort the table by "Modified" status, and replace the "dreamvo_scr_X" scripts with the code snippets below, where X = a, b, c, d, z. Save the file and use the created .omwaddon file instead of the old .esp file.
This method, however, always displays the subtitles (because I used message boxes for the closed captions) -- if you want to remove them, modify my code by deleting all lines starting with "MessageBox".

Code: Select all

Begin dreamvo_scr_a

short doonce
float timer
float local_music_timer
float local_xpos
float local_ypos
float local_zpos
float local_zpos_new

if ( local_music_timer < 1 )
	StreamMusic, "dreamvo_s.mp3"
	set local_music_timer to 10
else
	set local_music_timer to ( local_music_timer - GetSecondsPassed )
endif

if ( doonce == 0 )
	if ( MenuMode == 1 )
		Return
	endif
	DisablePlayerControls
	ToggleMenus
	FadeOut, 0.5
	set timer to 0
	set doonce to 1
elseif ( doonce == 1 )
	if ( timer < 1 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	set local_xpos to ( "player"->GetPos, X )
	set local_ypos to ( "player"->GetPos, Y )
	set local_zpos to ( ( "player"->GetPos, Z ) + 10 )
	set local_zpos_new to ( local_zpos + 30000 )
	"player"->AddSpell, "dreamvo_sp"
	"player"->SetPos, Z, local_zpos_new
	"player"->Say, "vo\dreamvo\dream01.mp3", ""
	set timer to 0
	set doonce to 2
elseif ( doonce == 2 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 8.9 )
		Return
	endif
	MessageBox "Omnipotent."
	set doonce to 3
elseif ( doonce == 3 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 11.9 )
		Return
	endif
	MessageBox "Omniscient."
	set doonce to 4
elseif ( doonce == 4 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 15 )
		Return
	endif
	MessageBox "Sovereign."
	set doonce to 5
elseif ( doonce == 5 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 18 )
		Return
	endif
	MessageBox "Immutable."
	set doonce to 6
elseif ( doonce == 6 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 20 )
		Return
	endif
	MessageBox "How sweet it is to be a god."
	set doonce to 7
elseif ( doonce == 7 )
	if ( timer < 30.249 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	"player"->SetPos, X, local_xpos
	"player"->SetPos, Y, local_ypos
	"player"->SetPos, Z, local_zpos
	"player"->RemoveSpell, "dreamvo_sp"
	set timer to 0
	set doonce to 8
elseif ( doonce == 8 )
	if ( MenuMode == 1 )
		Return
	elseif ( timer < 0.5 )
		set timer to ( timer + GetSecondsPassed )
		Return
	endif
	FadeIn, 2
	set timer to 0
	set doonce to 9
elseif ( doonce == 9 )
	if ( timer < 2 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	ToggleMenus
	EnablePlayerControls
	Journal, "A1_Dreams", 1
	set doonce to 10
else
	set doonce to 0
	set local_music_timer to 0
	StopScript, "dreamvo_scr_a"
endif

End

Code: Select all

Begin dreamvo_scr_b

short doonce
float timer
float local_music_timer
float local_xpos
float local_ypos
float local_zpos
float local_zpos_new

if ( local_music_timer < 1 )
	StreamMusic, "dreamvo_s.mp3"
	set local_music_timer to 10
else
	set local_music_timer to ( local_music_timer - GetSecondsPassed )
endif

if ( doonce == 0 )
	if ( MenuMode == 1 )
		Return
	endif
	DisablePlayerControls
	ToggleMenus
	FadeOut, 0.5
	set timer to 0
	set doonce to 1
elseif ( doonce == 1 )
	if ( timer < 1 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	set local_xpos to ( "player"->GetPos, X )
	set local_ypos to ( "player"->GetPos, Y )
	set local_zpos to ( ( "player"->GetPos, Z ) + 10 )
	set local_zpos_new to ( local_zpos + 30000 )
	"player"->AddSpell, "dreamvo_sp"
	"player"->SetPos, Z, local_zpos_new
	"player"->Say, "vo\dreamvo\dream02.mp3", ""
	set timer to 0
	set doonce to 2
elseif ( doonce == 2 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 4.1 )
		Return
	endif
	MessageBox "Who knows what we may be capable of, once we no longer fear death?"
	set doonce to 3
elseif ( doonce == 3 )
	if ( timer < 15.281 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	"player"->SetPos, X, local_xpos
	"player"->SetPos, Y, local_ypos
	"player"->SetPos, Z, local_zpos
	"player"->RemoveSpell, "dreamvo_sp"
	set timer to 0
	set doonce to 4
elseif ( doonce == 4 )
	if ( MenuMode == 1 )
		Return
	elseif ( timer < 0.5 )
		set timer to ( timer + GetSecondsPassed )
		Return
	endif
	FadeIn, 2
	set timer to 0
	set doonce to 5
elseif ( doonce == 5 )
	if ( timer < 2 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	ToggleMenus
	EnablePlayerControls
	Journal, "A1_Dreams", 5
	set doonce to 6
else
	set doonce to 0
	set local_music_timer to 0
	StopScript, "dreamvo_scr_b"
endif

End

Code: Select all

Begin dreamvo_scr_c

short doonce
float timer
float local_music_timer
float local_xpos
float local_ypos
float local_zpos
float local_zpos_new

if ( local_music_timer < 1 )
	StreamMusic, "dreamvo_s.mp3"
	set local_music_timer to 10
else
	set local_music_timer to ( local_music_timer - GetSecondsPassed )
endif

if ( doonce == 0 )
	if ( MenuMode == 1 )
		Return
	endif
	DisablePlayerControls
	ToggleMenus
	FadeOut, 0.5
	set timer to 0
	set doonce to 1
elseif ( doonce == 1 )
	if ( timer < 1 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	set local_xpos to ( "player"->GetPos, X )
	set local_ypos to ( "player"->GetPos, Y )
	set local_zpos to ( ( "player"->GetPos, Z ) + 10 )
	set local_zpos_new to ( local_zpos + 30000 )
	"player"->AddSpell, "dreamvo_sp"
	"player"->SetPos, Z, local_zpos_new
	"player"->Say, "vo\dreamvo\dream03.mp3", ""
	set timer to 0
	set doonce to 2
elseif ( doonce == 2 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 4.8 )
		Return
	endif
	MessageBox "I will free the Dunmer from the Imperial yoke, and cast down the false Gods of the Temple."
	set doonce to 3
elseif ( doonce == 3 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 12.4 )
		Return
	endif
	MessageBox, "I will lead them out of their ancient superstition, and gift them with intimate knowledge of the divine."
	set doonce to 4
elseif ( doonce == 4 )
	if ( timer < 21.342 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	"player"->SetPos, X, local_xpos
	"player"->SetPos, Y, local_ypos
	"player"->SetPos, Z, local_zpos
	"player"->RemoveSpell, "dreamvo_sp"
	set timer to 0
	set doonce to 5
elseif ( doonce == 5 )
	if ( MenuMode == 1 )
		Return
	elseif ( timer < 0.5 )
		set timer to ( timer + GetSecondsPassed )
		Return
	endif
	FadeIn, 2
	set timer to 0
	set doonce to 6
elseif ( doonce == 6 )
	if ( timer < 2 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	ToggleMenus
	EnablePlayerControls
	Journal, "A1_Dreams", 10
	set doonce to 7
else
	set doonce to 0
	set local_music_timer to 0
	StopScript, "dreamvo_scr_c"
endif

End

Code: Select all

Begin dreamvo_scr_d

short doonce
float timer
float local_music_timer
float local_xpos
float local_ypos
float local_zpos
float local_zpos_new

if ( local_music_timer < 1 )
	StreamMusic, "dreamvo_s.mp3"
	set local_music_timer to 10
else
	set local_music_timer to ( local_music_timer - GetSecondsPassed )
endif

if ( doonce == 0 )
	if ( MenuMode == 1 )
		Return
	endif
	DisablePlayerControls
	ToggleMenus
	FadeOut, 0.5
	set timer to 0
	set doonce to 1
elseif ( doonce == 1 )
	if ( timer < 1 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	set local_xpos to ( "player"->GetPos, X )
	set local_ypos to ( "player"->GetPos, Y )
	set local_zpos to ( ( "player"->GetPos, Z ) + 10 )
	set local_zpos_new to ( local_zpos + 30000 )
	"player"->AddSpell, "dreamvo_sp"
	"player"->SetPos, Z, local_zpos_new
	"player"->Say, "vo\dreamvo\dream04.mp3", ""
	set timer to 0
	set doonce to 2
elseif ( doonce == 2 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 3 )
		Return
	endif
	MessageBox "The gods and fates are cruel. I served you faithfully once, Lord Nerevar, and you repaid me with death!"
	set doonce to 3
elseif ( doonce == 3 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 12 )
		Return
	endif
	MessageBox, "Come, lay down your weapons. It is not too late for my mercy."
	set doonce to 4
elseif ( doonce == 4 )
	set timer to ( timer + GetSecondsPassed )
	if ( timer < 18.4 )
		Return
	endif
	MessageBox "Together we shall speak for the law and the land, and shall drive the mongrel dogs of the Empire from Morrowind."
	set doonce to 5
elseif ( doonce == 5 )
	if ( timer < 29.675 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	"player"->SetPos, X, local_xpos
	"player"->SetPos, Y, local_ypos
	"player"->SetPos, Z, local_zpos
	"player"->RemoveSpell, "dreamvo_sp"
	set timer to 0
	set doonce to 6
elseif ( doonce == 6 )
	if ( MenuMode == 1 )
		Return
	elseif ( timer < 0.5 )
		set timer to ( timer + GetSecondsPassed )
		Return
	endif
	FadeIn, 2
	set timer to 0
	set doonce to 7
elseif ( doonce == 7 )
	if ( timer < 2 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	ToggleMenus
	EnablePlayerControls
	Journal, "A1_Dreams", 15
	set doonce to 8
else
	set doonce to 0
	set local_music_timer to 0
	StopScript, "dreamvo_scr_d"
endif

End

Code: Select all

Begin dreamvo_scr_z

short doonce
float timer
float local_music_timer
float local_xpos
float local_ypos
float local_zpos
float local_zpos_new

if ( local_music_timer < 1 )
	StreamMusic, "dreamvo_s.mp3"
	set local_music_timer to 10
else
	set local_music_timer to ( local_music_timer - GetSecondsPassed )
endif

if ( doonce == 0 )
	if ( MenuMode == 1 )
		Return
	endif
	DisablePlayerControls
	ToggleMenus
	FadeOut, 0.5
	set timer to 0
	set doonce to 1
elseif ( doonce == 1 )
	if ( timer < 1 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	set local_xpos to ( "player"->GetPos, X )
	set local_ypos to ( "player"->GetPos, Y )
	set local_zpos to ( ( "player"->GetPos, Z ) + 10 )
	set local_zpos_new to ( local_zpos + 30000 )
	"player"->AddSpell, "dreamvo_sp"
	"player"->SetPos, Z, local_zpos_new
	"player"->Say, "vo\dreamvo\dream_att.mp3", ""
	set timer to 0
	set doonce to 2
elseif ( doonce == 2 )
	if ( timer < 14.158 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	"player"->SetPos, X, local_xpos
	"player"->SetPos, Y, local_ypos
	"player"->SetPos, Z, local_zpos
	"player"->RemoveSpell, "dreamvo_sp"
	set timer to 0
	set doonce to 3
elseif ( doonce == 3 )
	if ( MenuMode == 1 )
		Return
	elseif ( timer < 0.5 )
		set timer to ( timer + GetSecondsPassed )
		Return
	endif
	PlaceAtPC, "dreamvo_zombie", 1, 128, 1
	FadeIn, 2
	set timer to 0
	set doonce to 4
elseif ( doonce == 4 )
	if ( timer < 2 )
		set timer to ( timer + GetSecondsPassed )
		Return
	elseif ( MenuMode == 1 )
		Return
	endif
	ToggleMenus
	EnablePlayerControls
	set doonce to 5
else
	set doonce to 0
	set local_music_timer to 0
	StopScript, "dreamvo_scr_z"
endif

End

User avatar
Atahualpa
Posts: 791
Joined: 09 Feb 2016, 20:03

Re: Sleepers, Awake! v1.1 by Von Djangos & Adul

Post by Atahualpa » 04 Nov 2016, 20:59

Update:

1. I've also fixed the in-game menu to be toggled one time at the beginning and one time at the end of the script (instead of being toggled twice in the beginning, making the GUI elements visible the whole time).

2. Moreover, I've deleted several empty MessageBox function calls.

3. The initial Say commands now take an empty subtitles argument instead of "@". The latter lead to a subtitle containing the @ sign -- not very surprising after all. If anyone knows the meaning of this in the original game, please let me know.

Every dream sequence should work as intended now.

EvilEye
Posts: 9
Joined: 12 Feb 2014, 13:45

Re: Sleepers, Awake! v1.1 by Von Djangos & Adul

Post by EvilEye » 05 Nov 2016, 10:47

Atahualpa wrote:2. Moreover, I've deleted several empty MessageBox function calls.
Those were probably intended to push out the previous box.
Atahualpa wrote:3. The initial Say commands now take an empty subtitles argument instead of "@". The latter lead to a subtitle containing the @ sign -- not very surprising after all. If anyone knows the meaning of this in the original game, please let me know.
Vanilla doesn't accept an empty string for Say, so I guess it's just a stand in. It just displays as @ in any case.

User avatar
Atahualpa
Posts: 791
Joined: 09 Feb 2016, 20:03

Re: Sleepers, Awake! v1.1 by Von Djangos & Adul

Post by Atahualpa » 05 Nov 2016, 13:44

Makes sense. I'll leave my script code as is -- of anyone wants the boxes to be pushed out, they can simply add some empty MessageBox calls. (Although I consider this a rather hacky solution. It would be better to implement a display time for message boxes, or a clearDisplay function to remove all active boxes.)

argonvegell
Posts: 173
Joined: 08 Dec 2015, 23:45

Re: Sleepers, Awake! v1.1 by Von Djangos & Adul

Post by argonvegell » 05 Sep 2017, 13:49

I found a workaround to the no audio issue in Sleepers Awake: http://www.dailymotion.com/video/x5zk48r

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests