Jump to content

Quest Won't Advance After Killing NPC


RangerBoo

Recommended Posts

I have a quest where you are to kill a NPC and the NPC following you will then force greet the player after killing the NPC and end the quest. However, the quest doesn't progress for some reason. Here is the script I have:

 

; if [GetStage AAAMorganQuest == 90]
; if [AAACassiusRef.GetDead && AAALegionSpy01Ref.GetDead && AAALegionSpy02Ref.GetDead]
; SetStage AAAMorganQuest == 100
; endif
; endif

;end

 

Can someone tell me what I am doing wrong.

Link to comment
Share on other sites

First, rather than comment out your code in order to post it, look at the second row of icons at the top of the "Reply to this topic" window. In roughly the middle position your should see a blue "<>" symbol. That is the icon for placing the following text in a "code block" (similar to a "spoiler" or "quotation" block), which will preserve indenting on lines that begin with a space but will not wrap lines. Should save you some annoyance.

 

Do note that [square brackets] are not treated the same in GECK as (parentheses). You need parens in that script. See the GECK "Encapsulation" entry.

 

Other than that, the issue is not with that script logic (assuming it is supposed to be run as part of the Companion response), but rather that you need your Companion's dialog line in response (to the stage being set to 90) to recognize that the event has occurred. That might be something as simple as adding the condition to that topic of: "if (GetStage AAAMorganQuest == 90)". (I tend to use parentheses whenever a function call has a parameter so all the elements are parsed correctly to produce the boolean result. Doesn't hurt and avoids some confusing errors.)

 

-Dubious-

Link to comment
Share on other sites

Here is the full script:

scn VAAMorganQuestScript

short bLetterDelivered    
short bBrookGreeted
short bBrooksFollow        

;begin GameMode

;    if (GetStage AAAMorganQuest == 10)
;      AAACathyRef.Enable && AAAChaseRef.Enable
;       end

;     if (GetStage AAAMorganQuest == 50)
;        AAAByronRef.disable
;        AAAByronRef.MarkForDelete
;        end

;       If (GetStage AAAMorganQuest == 90])
;       AAACassiusRef.enable 
;       AAALegionSpy01Ref.enable
;       AAALegionSpy02.enable
;       end

;		if (AAACassiusRef.GetDead == 1 && AAALegionSpy01Ref.GetDead == 1 && AAALegionSpy02Ref.GetDead == 1)
;			Set bBrookGreeted to 1
;              SetStage AAAMorganQuest == 100
;		endif
;	endif

;end

Still nothing. I put the variables and everything in the conditions for my NPC's dialogue but she still won't force greet the player after I kill the target NPC's.

Link to comment
Share on other sites

I think you missed if condition after this line
if (AAACassiusRef.GetDead == 1 && AAALegionSpy01Ref.GetDead == 1 && AAALegionSpy02Ref.GetDead == 1)
there is an extra 'endif' after 'SetStage AAAMorganQuest == 100'
scn VAAMorganQuestScript

short bLetterDelivered    
short bBrookGreeted
short bBrooksFollow        

begin GameMode

	if (GetStage AAAMorganQuest == 10)
		AAACathyRef.Enable && AAAChaseRef.Enable --> this is more like validation rather than assign command
	end

	if (GetStage AAAMorganQuest == 50)
		AAAByronRef.disable
		AAAByronRef.MarkForDelete
	end

	If (GetStage AAAMorganQuest == 90]) --> there is extra bracket ']'
		AAACassiusRef.enable 
		AAALegionSpy01Ref.enable
		AAALegionSpy02.enable
	end

	if (AAACassiusRef.GetDead == 1 && AAALegionSpy01Ref.GetDead == 1 && AAALegionSpy02Ref.GetDead == 1)
		Set bBrookGreeted to 1
		SetStage AAAMorganQuest == 100 --> this looks like validation, it should go without '=='
		endif ---> this is an extra, error may stop the script from working
	endif

end

 

EDIT : oh...

I also noticed there's an extra bracket ']' in this line --> If (GetStage AAAMorganQuest == 90 ] )
probably that was what causing your script not working issue
I think it should go like this --> If (GetStage AAAMorganQuest == 90)
EDIT 2 : it seems there is other errors too, typo on 'end'... should be 'endif' instead. also there is wrong validation in this line --> AAACathyRef.Enable && AAAChaseRef.Enable
Edited by lubronbrons
Link to comment
Share on other sites

here's a script suggestion from me (I couldn't test it so I don't know if this is working or not)

I've removed some potential errors & streamlined the code for best performance (let's safe our precious FPS !)

scn VAAMorganQuestScript

short bLetterDelivered    
short bBrookGreeted
short bBrooksFollow     

short sh1

begin GameMode
	Set sh1 to GetStage AAAMorganQuest
	if sh1 == 10
		AAACathyRef.Enable
		AAAChaseRef.Enable
	elseif sh1 == 50
		AAAByronRef.disable
		AAAByronRef.MarkForDelete
	elseif sh1 == 90
		AAACassiusRef.enable 
		AAALegionSpy01Ref.enable
		AAALegionSpy02.enable
	endif

	if AAACassiusRef.GetDead * AAALegionSpy01Ref.GetDead * AAALegionSpy02Ref.GetDead
		Set bBrookGreeted to 1
		SetStage AAAMorganQuest 100
	endif
end
Edited by lubronbrons
Link to comment
Share on other sites

Just to clarify: A "Begin" block terminates when it hits an "End" statement. An "If" block is processed when "True" or it skips over to the next "ElseIf", or eventually the "Else" statement when all earlier are "False"; and terminates when it hits an "EndIf". The "Begin ... End" block surrounds the script of a type of "event" such as "GameMode", "OnActivate", "OnEquip", etc. If you put an "End" in the wrong place, it causes that block of code to abruptly terminate prematurely.

 

Such "syntax" errors are why script writers are advised to use an editor with syntax checking. They are easy mistakes to make as typos and missing "unmatched parens/brackets/braces", and a major pain to track down. Recommend "Notepad++" and DoctaSax's "language" plugin, both linked under "Scripting Tools" in the wiki "Getting started creating mods using GECK" article.

 

-Dubious-

Edited by dubiousintent
Link to comment
Share on other sites

well...

I've reviewed the script over & over again (my suggestion script, and I believe it should work fine)

so

I think the problem could be wrong stage progression

you should review this quest step by step, syntax PrintToConsole / printc may help you in debugging (to track quest stage & to check if the validation is working or not)

it should be something like this (in-game you should frequently check your console output message)

scn VAAMorganQuestScript

short bLetterDelivered    
short bBrookGreeted
short bBrooksFollow     

short sh1

begin GameMode
	Set sh1 to GetStage AAAMorganQuest
	printc "AAAMorganQuest stage %g" sh1
	if sh1 == 10
		printc "YAY ! now AAAMorganQuest is stage 10"
		AAACathyRef.Enable
		AAAChaseRef.Enable
	elseif sh1 == 50
		printc "YAY ! now AAAMorganQuest is stage 50"
		AAAByronRef.disable
		AAAByronRef.MarkForDelete
	elseif sh1 == 90
		printc "YAY ! now AAAMorganQuest is stage 90"
		AAACassiusRef.enable 
		AAALegionSpy01Ref.enable
		AAALegionSpy02.enable
	endif

	if AAACassiusRef.GetDead * AAALegionSpy01Ref.GetDead * AAALegionSpy02Ref.GetDead
		printc "YAY ! now AAAMorganQuest is stage 100"
		Set bBrookGreeted to 1
		SetStage AAAMorganQuest 100
	endif
end
Edited by lubronbrons
Link to comment
Share on other sites

  • Recently Browsing   0 members

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