Jump to content

Quest help needed


ChrisPydtank

Recommended Posts

Hey guys I was wondering if I can write up everything for my mini Quest and hopefully if someone can point out why it dont work when I test it... Ill write up my issue at the end of it...

 

Quest: Get Your Motor Runnin!!!

 

Start to quest is the Backup Generator.

 

script in Generator:

 

scn PowerGeneratorStart

 

 

short power

short off

short on

short Active

short Quest

short Stop

short Done

 

begin onActivate

 

set power to off

 

showmessage powergeneratoroffmessage ; Message says "Generator won't start"

setStage Vault74MotorQuest 10 ; This starts the quest to get fuel.

set power to Done ; This is suppose to get rid of power being set to off

set Quest to Active ; This for next bit.

 

end

 

begin OnActivate

 

if Quest == Active && power == Done

showmessage powergeneratoroffmessageTest ;This is to make sure this command worked by adding in note "Quest Active Test"

 

 

elseif GetObjectiveCompleted Vault74MotorQuest 10 && getStage Vault74MotorQuest == 11 && GetHasNote V74FuelQuestManual

set Power to on

set Quest to Stop

setObjectiveCompleted Vault74MotorQuest 11 1

player.removeitem Fuel 1

GeneratorGoing.enable

Generatorgoing.activate

playsound AMBGeneratorPowerStart

playsound SoundGeneratorStarting

setStage Vault74MotorQuest 100

 

 

endif

endif

 

end

 

To be added later is to basically unlock the elevator switch to be able to go down to next area. before that... we gotta unlock the Storage Room door using computer in another room.

 

When this is done the quest obviously points 2 quest compass markers at the Fuel Can and the manual.

 

when you goto pick up Can this script goes as follows...

 

scn FuelForThoughtMotorQuest

 

begin OnAdd player

 

setObjectiveCompleted Vault74MotorQuest 10 1

setStage Vault74MotorQuest 11

 

endif

end

 

The Objective markers do not go away and doesnt start pointing back at the generator with Objective Displayed with "Bring Fuel back to Generator"

 

The Generator does not start showing the message with Test in it... just the first starting of the script...

 

therefore the Quest cannot be completed nor can I get elevator going...

 

what have I done wrong to not do what I want?

 

I might be just being an idiot and the error could be obvious but yeah help is needed... if you dont understand then please tell me so I can help you more...

Link to comment
Share on other sites

short Quest <-- I'm surprised the script even compiled, as I though "Quest" was a reserved word. Maybe not...

 

if Quest == Active && power == Done <--This is true all the time because Active and Done are never set to anything but the default of zero. So "Set Quest to Active" = "Set Quest to 0" and its useless anyway. Just do "If Quest == 0" and skip the rest. The same applies to Done.

 

 

elseif GetObjectiveCompleted Vault74MotorQuest 10 && getStage Vault74MotorQuest == 11 && GetHasNote V74FuelQuestManual

^ You used gethasnote implicitly here. This means that the generator needs to have the note for this to evaluate true. You need to check if a reference has the note, like: Player.gethasnote

 

Also, you have two OnActivate blocks, you should only have one. You can move all the stuff from one to the other.

 

Set Power to On and Set power to Off are the same thing becasue Off and On are never set to anything other than the default of zero (again). In both cases you are setting Power to zero. Try Setting Power to 1 for "On" and Setting Power to 0 for "off". At least that would be using different values for on and off.

 

 

 

 

scn FuelForThoughtMotorQuest
begin OnAdd player

 setObjectiveCompleted Vault74MotorQuest 10 1
 setStage Vault74MotorQuest 11

 endif
end

 

^You have an endif without an if.

 

Also, use the "wrap in code tags" to keep the code indented. It is so much easier to read that way.

Link to comment
Share on other sites

Well no I actually didnt realize about the values... now I see why it was continuing to show the first message... and the OnActivate was in one but I thought that might of been the problem so I put 2... so ill remove one then... thanks heaps for your help... I suppose Ill update this topic if it works or not... thanks buddy...
Link to comment
Share on other sites

hey hey it worked!!! sorta... it now has changed the values correctly but now I still have a problem with this bit...

 

if Quest == Active && power == Done

showmessage powergeneratoroffmessageTest ;This is to make sure this command worked by adding in note "Quest Active Test"

 

now without the can nor the note the above command will continue to play... but when I get the can and note... the script on the can works and the markers disappears and the quest objective gets completed and the new one to bring back to generator occurs, but when pressing the generator again it dont do the bottom, still the top remark...

 

elseif GetObjectiveCompleted Vault74MotorQuest 10 && getStage Vault74MotorQuest == 11 && player.GetHasNote V74FuelQuestManual

set Power to on

set Quest to Stop

setObjectiveCompleted Vault74MotorQuest 11 1

player.removeitem Fuel 1

GeneratorGoing.enable

Generatorgoing.activate

playsound AMBGeneratorPowerStart

playsound SoundGeneratorStarting

setStage Vault74MotorQuest 100

 

 

endif

endif

 

end

 

I did make the "if" correctly... yes??

 

that should equal

 

"if the quest index 10 is completed & if the current index/quest stage is 11 & the player has the note"

 

blah blah blah will happen... so in turn the "can" script makes the first 2 true and I had the note... whats going on???

Link to comment
Share on other sites

You are still not using the "Wrap in code tags" feature which makes it hard to read your code. Its the 5th icon under the "Fonts" drop down box on the post toolbar.

 

To check if the player has a note, use:

 

GethasNote <notename>

 

To check if a quest is running, use:

 

GetQuestRunning <Quest name>

 

To check if the player has your "can" use:

 

Player.getItemcount <object name> > 0

 

If you already setup a quest stage for the case that the player has the "can" then use

 

GetStageDone <quest name> <Stage#>

 

set Power to on

set Quest to Stop

These two lines are useless as all they do is set the variables to zer, which they already are.

 

 

You still have one too many EndIf lines. You don't need an extra Endif when using Else or Elseif, like this:

 

If blah blah
  stuff
Elseif blah blah
  stuff
Else
  stuff
Endif

 

I hope this helps.

Link to comment
Share on other sites

sorry i was kinda lazy and copy pasted the code again... forgot to change the "short" "on" and "done" to the actual numbers etc.... here is better version for you...

 

if Quest == 1 && power == 1
showmessage powergeneratoroffmessageTest ;This is to make sure this command worked by adding in note "Quest Active Test"

 

elseif GetObjectiveCompleted Vault74MotorQuest 10 && getStage Vault74MotorQuest == 11 && player.GetHasNote V74FuelQuestManual
set Power to 2
set Quest to 2
setObjectiveCompleted Vault74MotorQuest 11 1
player.removeitem Fuel 1
GeneratorGoing.enable
Generatorgoing.activate
playsound AMBGeneratorPowerStart
playsound SoundGeneratorStarting
setStage Vault74MotorQuest 100

endif
end

 

So what your saying is I should change "GetObjectiveCompleted" to "GetStageDone" to check if stage "10" of getting the Fuel can is completed and rather checking if stage "11" is active to check for the note which I have and check for Fuel Can instead?

 

So like this:

 

 

elseif GetStageDone Vault74MotorQuest 10 && Player.getItemcount FuelCan 1 && player.GetHasNote V74FuelQuestManual
set Power to 2
set Quest to 2
setObjectiveCompleted Vault74MotorQuest 11 1
player.removeitem Fuel 1
GeneratorGoing.enable
Generatorgoing.activate
playsound AMBGeneratorPowerStart
playsound SoundGeneratorStarting
setStage Vault74MotorQuest 100

endif
end

Link to comment
Share on other sites

Like this: (i only changed the getitemcount part)

 

   elseif GetStageDone Vault74MotorQuest 10 && Player.getItemcount FuelCan >=1 && player.GetHasNote V74FuelQuestManual
  set Power to 2
  set Quest to 2
  setObjectiveCompleted Vault74MotorQuest 11 1
  player.removeitem Fuel 1
  GeneratorGoing.enable
  Generatorgoing.activate
  playsound AMBGeneratorPowerStart
  playsound SoundGeneratorStarting
  setStage Vault74MotorQuest 100
  endif
end

Link to comment
Share on other sites

  • 2 weeks later...

I had issues working it... the script wouldn't run the message separately but rather on first press... but I fixed it and well it didn't keep saying Generator won't start the second time +<... but I thought about it and came up with this...

 

scn PowerGeneratorStart


short power ; off= 1 on= 2 ;default= 0 done=3
short Quest ; active= 1 done= 2


begin onActivate

		if power == 0
				showmessage powergeneratoroffmessage
				setStage Vault74MotorQuest 10
				set Power to 1

	
  		elseif  player.GetItemCount Fuel == 1 && player.GetHasNote V74FuelQuestManual
				set Power to 2
				set Quest to 2
				setObjectiveCompleted Vault74MotorQuest 11 1
				player.removeitem Fuel 1
				GeneratorGoing.enable
				Generatorgoing.activate
				playsound AMBGeneratorPowerStart
				playsound SoundGeneratorStarting
				setStage Vault74MotorQuest 100


	else
			showmessage powergeneratoroffmessage

endif

end


 

I know I have useless "Quest" reference but it will be needed later... so thanks everyone whom helped me out... you guys got me thinking and I managed to get a code script that finally works...

 

Praise to pkleiss for the best help...

Link to comment
Share on other sites

  • Recently Browsing   0 members

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