Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Scripting a Monologue


ub3rman123
 Share

Recommended Posts

I'm attempting to make a monologue for an NPC. I have the dialogue written. Halfway through the monologue (After 3 'blocks' of text), the NPC speaking it changes, like a doppleganger. The style of it is very similar to Mankar Cameron's speech in Paradise, so I'm basing the scripting off of it. However, the script has proved indecipherable. Somehow it's all spoken from one topic. Can anyone point me in the right direction to timing and scripting it out correctly?

Link to comment
Share on other sites

An update: I went the low road and built a set of timers to make it say the next piece after a certain length of time. However, the script I've written isn't working. This is the quest script in its entirety, and the part involving the monologue itself is in bold. To begin the monologue, the player triggers a triggerbox which sets the variable MonologueOn to 1.

scn WSMAinQuestSCRIPT

short DooNce

short shadowdeadcount

short doonce2

short zombiecount

short doonce3

short doonce4

float timer

float timer2

float timersapper

short cavernknowspass

short sullyfollowing

short piratesfollowing

short MyriaMove

float ConvTimer ;This is the master timer for Myria's monologue

short MonologueOn

short monologuestage

begin gamemode

if doonce == 0

setstage wsmainquest 1

set doonce to 1

elseif gamedayspassed >= timer && getstage WSMainQuest == 25

setstage WSMainQuest 30

;beginning of the conversation timing here!

elseif MonologueOn == 1

set ConvTimer to ConvTimer + getsecondspassed

elseif monologuestage == 0 && monologueon == 1

player.message "Hey, I worked!"

WSMyriaRef.say WSMyriaSPeech1

set MonologueStage to 1

elseif Convtimer >= 5 && MonologueStage == 1

WSMyriaRef.sayto player WSMyriaSpeech2

WSHeraldREF.SAA 0.30

set monologuestage to 2

elseif Convtimer >= 10 && MonologueStage == 2

WSMyriaRef.sayto player WSMyriaSpeech3

WSHeraldREF.SAA 0.50

set monologuestage to 3

elseif Convtimer >= 15 && MonologueStage == 3

setstage WSMainQuest 147

WSHeraldREF.SAA 0.80

WSKrantzREF.enable

WSKRantzRef.moveto WSMyriaREF

WSMyriaREF.disable

WSKrantzREF.sayto player WSMyriaSpeech4

set monologuestage to 4

elseif Convtimer >= 20 && MonologueStage == 4

WSKrantzref.sayto player WSMyriaSpeech5

set monologuestage to 5

elseif Convtimer >= 25 && MonologueStage == 5

WSKrantzref.sayto player WSMyriaSpeech6

set monologuestage to 6

elseif Convtimer >= 30 && MonologueStage == 6

;Do the monologue end stuff. Kill Krantz and such.

set monologuestage to 7

set Monologueon to 0

endif

end

As for where it bugs up, I'm not sure. I put in that player.message on the first stage, and I never receive it ingame.

Edited by ub3rman123
Link to comment
Share on other sites

1. Try not to mix your IF/ELSEIF conditions. And some of them can be combined under each other. Remember, when you use 'ELSEIF', the very FIRST TRUE condition is the ONLY one that is executed, all the rest are ignored.

2. Why would you check if 'gameDaysPassed' is greater than 'timer'? It will 'always' be true first time through since 'gameDaysPassed' is a game updated variable and 'timer' would always equal 0. Especially since you never set it to any other value.

begin gamemode

if doonce == 0
setstage wsmainquest 1
set doonce to 1
endif

if gamedayspassed >= timer && getstage WSMainQuest == 25
setstage WSMainQuest 30
endif

;beginning of the conversation timing here!

if MonologueOn == 1
set ConvTimer to ConvTimer + getsecondspassed

if monologuestage == 0
player.message "Hey, I worked!"
WSMyriaRef.say WSMyriaSPeech1
set MonologueStage to 1
endif
endif

if Convtimer >= 5 && MonologueStage == 1
WSMyriaRef.sayto player WSMyriaSpeech2
WSHeraldREF.SAA 0.30
set monologuestage to 2

elseif Convtimer >= 10 && MonologueStage == 2
WSMyriaRef.sayto player WSMyriaSpeech3
WSHeraldREF.SAA 0.50
set monologuestage to 3

elseif Convtimer >= 15 && MonologueStage == 3
setstage WSMainQuest 147
WSHeraldREF.SAA 0.80
WSKrantzREF.enable
WSKRantzRef.moveto WSMyriaREF
WSMyriaREF.disable
WSKrantzREF.sayto player WSMyriaSpeech4
set monologuestage to 4

elseif Convtimer >= 20 && MonologueStage == 4
WSKrantzref.sayto player WSMyriaSpeech5
set monologuestage to 5

elseif Convtimer >= 25 && MonologueStage == 5
WSKrantzref.sayto player WSMyriaSpeech6
set monologuestage to 6

elseif Convtimer >= 30 && MonologueStage == 6
;Do the monologue end stuff. Kill Krantz and such.
set monologuestage to 7
set Monologueon to 0
endif

end[/code]

Link to comment
Share on other sites

I did some revising on the script in a conversation with Pronam, and here's what I have. The first part is actually unrelated, but I figured I'd include it in case something was screwing it up, like a Return I had in there earlier.

Currently, this revised script somewhat works. I receive the first message of 'Hey, it worked!', but nothing after that. My best guess is that there's something wrong with the timer.

begin gamemode


	if doonce == 0

		setstage wsmainquest 1

		set doonce to 1

	endif


if gamedayspassed >= timer && getstage WSMainQuest == 25

	setstage WSMainQuest 30

endif


;beginning of the conversation timing here!

if MonologueOn >= 1

        set ConvTimer to ConvTimer + getsecondspassed

        if MonologueOn == 1

                if monologuestage == 0 && monologueon == 1

                        message "Hey, I worked!"

                        WSMyriaRef.sayto player WSMyriaSPeech1

                        set MonologueStage to 1

                        set fQuestdelaytime to 0.1

                endif


        if Convtimer >= 5 && MonologueStage == 1

                WSMyriaRef.sayto player WSMyriaSpeech2

                WSHeraldREF.SAA 0.30

                message "MonologueStage at 2"

                set monologuestage to 2



        elseif Convtimer >= 10 && MonologueStage == 2

                WSMyriaRef.sayto player WSMyriaSpeech3

                WSHeraldREF.SAA 0.50

                message "MonologueStage at 3"

                set monologuestage to 3



        elseif Convtimer >= 15 && MonologueStage == 3

                setstage WSMainQuest 147

                WSHeraldREF.SAA 0.80

                WSKrantzREF.enable

                WSKRantzRef.moveto WSMyriaREF

                WSMyriaREF.disable

                WSKrantzREF.sayto player WSMyriaSpeech4

                message "MonologueStage at 4"

                set monologuestage to 4



        elseif Convtimer >= 20 && MonologueStage == 4

                WSKrantzref.sayto player WSMyriaSpeech5

                message "MonologueStage at 5" 

                set monologuestage to 5



        elseif Convtimer >= 25 && MonologueStage == 5

                WSKrantzref.sayto player WSMyriaSpeech6

                message "MonologueStage at  6"

                set monologuestage to 6



        elseif Convtimer >= 30 && MonologueStage == 6

;Do the monologue end stuff. Kill Krantz and such.

                message "MonologueStage at 7"

                set fQuestdelaytime to 0

                set monologuestage to 7

                set Monologueon to 0

        endif

endif


end

Edit: Thanks for pointing me towards the ElseIfs! Turns out there was one from the beginning of the monologue stages that wasn't running because the If earlier had turned out true! Now I have to figure out how to get the SayTos to function properly, I only get the messages. But that's a lesser concern; I could run the entire thing out of PlaySound and player.Messages from here if I need to.

Edited by ub3rman123
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...