Jump to content

Vanilla Script not Compiling in G.E.C.K.


Manan6619

Recommended Posts

So, I'm trying to make some changes to a script for the hostages in the Booted quest, but NVSE is giving me a block start/end error for this section of (vanilla, seemingly-working ingame) script, line 16:

 

BEGIN OnActivate player
if ( GetDead == 0 )
  if ( freed == 0 )
   if ( IsActionRef player == 1 )
    if ( Player.IsInCombat == 0 )
      ShowMessage TecMineHostageMSG
      ;NelsonCrux01REF.pushactoraway NelsonNCRHostage01REF 1
      ;NelsonCrux02REF.pushactoraway NelsonNCRHostage02REF 1
      ;NelsonCrux03REF.pushactoraway NelsonNCRHostage03REF 1
     endif
    ;else
     ;ShowMessage FFSupermutantCaptiveNoActivateMessage
    endif
   endif
  endif
elseIf ( GetDead == 1 )
  Activate
END

 


Any ideas?

EDIT: So I've figured that first bit out I think, actually (It seems to work correctly if "elseIf" is changed to just "if"). However, I could use some advice on the next part; I've added a new button to the menu that appears when you activate a hostage in hopes that you'll be able to trade items with them, but the button doesn't have any effect. Did I use the wrong function? It's on line 29.

 

 

BEGIN Menumode 1001
	if ( freed == 0 )
		set button to GetButtonPressed
		if ( button == 1 )
			SetRestrained 0
			;SayTo player GREETING
			set Freed to 1
			ignoreCrime 0
			set VNelson.NumHostages to VNelson.NumHostages + 1
			AddScriptPackage vNelsonHostageEscape
			;Addtofaction NCRFactionNV 1
	;Cripples both legs for all three
			NelsonNCRHostage01REF.DamageActorValue LeftMobilityCondition 5
			NelsonNCRHostage01REF.DamageActorValue	RightMobilityCondition 5

			NelsonNCRHostage02REF.DamageActorValue LeftMobilityCondition 5
			NelsonNCRHostage02REF.DamageActorValue	RightMobilityCondition 5

			NelsonNCRHostage03REF.DamageActorValue LeftMobilityCondition 5
			NelsonNCRHostage03REF.DamageActorValue	RightMobilityCondition 5
	;spawns backup
			NelsonLegion01REF.Enable 1
			NelsonLegion02REF.Enable 1
			NelsonLegion03REF.Enable 1
			setenemy caesarslegionnelsonfaction playerfaction
			;setenemy VCaesarsLegionfaction playerfaction
		endif
		elseIf ( button == 2 )
		OpenTeammateContainer 1
	endif
END

 

 

Edited by Manan6619
Link to comment
Share on other sites

An "EndIf" terminates a condition block. An "ElseIf" is a continuation of an "IF' block as the "If not true" stage, so you are not getting to your "elseIf ( button == 2 )" line. You want to move the "EndIf" after the "OpenTeammateContainer 1" line.

 

-Dubious-

Link to comment
Share on other sites

Hm, thanks. I think I see what you mean. I've changed the script as follows, but still no dice:

 

BEGIN Menumode 1001
	
	if ( freed == 0 )
		set button to GetButtonPressed
		if ( button == 1 )
			SetRestrained 0
			;SayTo player GREETING
			set Freed to 1
			ignoreCrime 0
			set VNelson.NumHostages to VNelson.NumHostages + 1
			AddScriptPackage vNelsonHostageEscape
			;Addtofaction NCRFactionNV 1
	;Cripples both legs for all three
			NelsonNCRHostage01REF.DamageActorValue LeftMobilityCondition 5
			NelsonNCRHostage01REF.DamageActorValue	RightMobilityCondition 5

			NelsonNCRHostage02REF.DamageActorValue LeftMobilityCondition 5
			NelsonNCRHostage02REF.DamageActorValue	RightMobilityCondition 5

			NelsonNCRHostage03REF.DamageActorValue LeftMobilityCondition 5
			NelsonNCRHostage03REF.DamageActorValue	RightMobilityCondition 5
	;spawns backup
			NelsonLegion01REF.Enable 1
			NelsonLegion02REF.Enable 1
			NelsonLegion03REF.Enable 1
			setenemy caesarslegionnelsonfaction playerfaction
			;setenemy VCaesarsLegionfaction playerfaction
		elseIf ( button == 2 )
		OpenTeammateContainer 1
		endif
	endif
END

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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