Jump to content

Need help understanding some scripts (SPOILERS!)


Zalmoxis

Recommended Posts

Hi everybody,

 

I've stumbled upon a problem while including karma rewards for the different PP results into EndingBinksScript for the "Free Play after MQ" mod. Those rewards can't be included in MQ11PPurityControlPanelScript, because FOMM can't handle that script, yet, and will mess it up when compiling it.

The problem is that no matter what you do, the game always gives you the bad karma "reward" for letting PP blow up.

 

 

What I've tried doing:

 

I've tried putting if/endif-constructs into EndingBinksScript, which shall reward the player with certain amounts of karma according to variables set throughout the last MQ.

 

These are the variables:

 

EndingBinks.EndDeath:

 

Set to 1 in MQ11PPurityControlPanelScript, if the player activates PP:

;Run the bink if the correct code is put in

if ( PanelActivated == 1 ) && GetStageDone MQ11 200 == 0

;fade sounds out before end bink  

	if (FadeSound == 0)
		if ( timer <= 4.15 )
			FadeSFX 4.0
			set FadeSound to 2
		endif
	endif
		
	if ( timer <= 0 )
		set EndingBinks.EndDeath to 1 ; HERE'S THE SWITCH
;			SetStage MQ11 200
		StartQuest EndingBinks			
	else
		set timer to ( timer - GetSecondsPassed )
	endif
endif

 

Set to 2 in the script included with the dialogue with Sarah that decides whether she or the player shall go in to activate PP, if the player sends her to activate PP.

 

Set to 3 in MQ11PPurityControlPanelScriptif the timer runs out that makes PP blow up:

;Scripting for handling MQ11.EndTimer
;added here because it needs to run every frame
;if time runs out before code gets put in, set EndDeath var so correct bink runs
;and run the binks
;Make sure PanelActivated is still 0 during this whole thing, so we don't bash one of the other endings


if ( PanelActivated == 0 )
	if ( MQ11.EndTimerInit == 1 )

		if ( MQ11.EndTimer <= 2.5 )
			if ( ExplosionStep == 0 )
				MQ11ExplosionMarker1.PlaceAtMe MQ05Explosion
				set ExplosionStep to 1
			endif

			DisablePlayerControls
			PipBoyRadioOff
			imod FadetoWhiteandBackISFX
			set MQ11.EndTimerInit to 2
		else
			set MQ11.EndTimer to ( MQ11.EndTimer - GetSecondsPassed )
		endif
	elseif ( MQ11.EndTimerInit == 2 ) 
		if ( ExplosionStep == 1 )
			if ( MQ11.EndTimer <=1.8 )
				MQ11ExplosionMarker4.PlaceAtMe MQ05Explosion
				set ExplosionStep to 2
			endif
		elseif ( ExplosionStep == 2 )
			if ( MQ11.EndTimer <= 0.6 )
				MQ11ExplosionMarker5.PlaceAtMe MQ05Explosion
				MQ11ExplosionMarker6.PlaceAtMe MQ05Explosion
				set ExplosionStep to 3
			endif				
		endif	
		if ( MQ11.EndTimer <= 0 )
			Set EndingBinks.EndDeath to 3; HERE'S THE SWITCH

			StartQuest EndingBinks
		else
			set MQ11.EndTimer to ( MQ11.EndTimer - GetSecondsPassed )
		endif
	endif
endif

 

 

EndingBinks.EndEden:

Normally used for deciding which Eden-related bink to play.

 

Set to 3 if player keeps Eden "alive" and uses "his" FEV.

 

Set to 1 or 2 if not. Where it's set to 1 or 2 and which results other than the bink videos those values are used for? - No idea.

 

 

Here's if if/endif-construct I've written for EndingBinksScript. That code is included inside each of the variants of the last bink video if/endif-constructs like this (the XP rewards mentioned in the comment are not in, yet):

If PlayClosingBink == 1
If GetPCIsSex Male == 1
	If GetPCIsRace AfricanAmerican == 1
		PlayBink "B19.bik" 0 1 0
		addachievement 13
	;ExitGame
		set PlayClosingBink to 2
		MQ01SarahREF.Disable
		SetNoActivationSound UIActivateNothing
		PPBulkhead02Ref.SetOpenState 1
	; Karma and XP rewards. - Zalmoxis
		if EndDeath == 1; player activates PP
			if EndEden == 3; player uses FEV
				StopQuest MQ11
				CompleteAllObjectives MQA
				CompleteQuest MQA
				RewardKarma -850
			elseif EndEden < 3; player doesn't use FEV and/or destroys Eden
				StopQuest MQA
				CompleteAllObjectives MQ11
				CompleteQuest MQ11
				RewardKarma 1150
			endif
		elseif EndDeath == 2; player sends Sarah
			if EndEden == 3; player uses FEV
				StopQuest MQ11
				CompleteAllObjectives MQA
				CompleteQuest MQA
				RewardKarma -1150
			elseif EndEden < 3; player doesn't use FEV and/or destroys Eden
				StopQuest MQA
				CompleteAllObjectives MQ11
				CompleteQuest MQ11
				RewardKarma 850
			endif
		else ; Player lets PP blow up
			StopQuest MQA
			StopQuest MQ11
			RewardKarma -500
		endif
		ResetQuest MQ11
	endif
endif
endif

 

 

What's the problem? Why does the game not acknowledge the "ifs" and always resorts to the "else"?

Since quite some time now I've noticed that the timer leading to the explosion of PP keeps ticking even if you've entered the code. You can notice that by hearing Dr. Li still urging you through the intercom to enter the code, even if the activation animation is already playing. That would mean the game even ignores it's original "if ( PanelActivated == 0 )" line in MQ11PPurityControlScript.

 

And, btw., what's with the brackets around the comparison statements in if-constructs? I can't see any pattern with when they are used and when they aren't. in EndingBinksScripts none are used at all - originally!

 

 

Thanks for any insight given,

-Zalmoxis.

Link to comment
Share on other sites

I don't know if it would make any difference at all, and it might just be the way I've been tought, but I'd change:

 

if ( PanelActivated == 1 ) && GetStageDone MQ11 200 == 0

 

to

 

if (( PanelActivated == 1 ) && (GetStageDone MQ11 200 == 0))

 

Edit:

Whilst, evidentally, the Fallout language doesn't require brackets for if statements, they are required for other languages, so it could just be that whoever wrote the specific lines of code had different programming experience.

 

But I'd try sticking brackets around all the comparisons, just to see if it makes a difference (and it makes the code easier to read).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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