Jump to content

Quest & Script Help???


t3hf4ll0ut

Recommended Posts

Hi, I've been trying to make my own personal little new start mod. To do so, I made a new Quest ( we'll call it altCG00 ) and I ticked Start Game Enabled, while at the same time unticking Start Game Enabled for the original VCG01 where you wake up in front of Doc. I then added a script to altCG00 along the lines of this:

 

scn SCRIPTYDIPTY

int iButton

BEGIN GameMode

ShowMessage altCG00message

END

BEGIN GameMode

set iButton to GetButtonPressed

if iButton == -1
	Return
elseif iButton == 0
	startQuest altCG00Assassin

endif
END

Which I initially intended to make a menu pop up before the game starts asking you to pick an option ( in this example there's only one ) which starts another quest ( in this example altCG00Assassin ).

and for Quest Stage 0, I put under result script; StopQuest VCG01. To stop the original quest where you wake up infront of doc.

 

The script attached to altCG00Assassin:

 

scn altCG00AssassinScript

int iStage

BEGIN GameMode

if iStage == 0
	player.additem OutfitBoSScribe 1
set iStage to 1
		elseif iStage == 1
	player.additem WeapNVThrowingKnife 23
set iStage to 2
		elseif iStage == 2
	player.additem WeapKnifeAssassin 1
set iStage to 3

endif
END

 

Which simply adds weapons/items to the player upon arrival of the new location. (or should anyhow) and under index 0 in the Quest Stages for the quest altCG00Assassin, I put player.moveto XMarkerAssassinLocation.

 

 

NOW TO THE POINT:

 

None of this works. The menu shows up, but I still go to the bed where you get up in front of Doc. The menu shows and when I press Assassin it continues the Doc quest for awhile and the menu pops up again. Press it again. Same results. For some reason it's not wanting to start my Assassin quest which SHOULD, if I scripted it correctly, move my player to the new location. So what's wrong here? Why is the Doc quest still going rather than my new one???

 

Thank-you in advance to anyone who took the time to read my thread, I hope you have a solution!

Link to comment
Share on other sites

I It could be that something else is starting VCG01 as a failsafe if the scripts fails to start or something like that, plus stoping quest will do nothing if in doctors quest refernces because it would start it again
Link to comment
Share on other sites

I It could be that something else is starting VCG01 as a failsafe if the scripts fails to start or something like that, plus stoping quest will do nothing if in doctors quest refernces because it would start it again

I've checked, but haven't found anything that would be a failsafe for the Quest yet.

Link to comment
Share on other sites

A few things...

 

Wrap your message in a conditional 'DoOnce' to stop it popping up every 5 seconds.

 

You only need 'one' GameMode block.

 

I've not seen menu option handling used in a quest script before so not sure if it works for that type of script.

Nothing in the GECK wiki to suggest it wouldn't.

Maybe it does and the second gamemode block never ran???

 

Oh... and you should stop your original quest once it has done its' business.

 

scn SCRIPTYDIPTY

int iButton
int iDoOnce

BEGIN GameMode
 if iDoOnce == 0
   set iDoOnce to 1
   ShowMessage altCG00message
 endif

 set iButton to GetButtonPressed
 if iButton == -1
   Return
 elseif iButton == 0
   startQuest altCG00Assassin
   stopQuest altCG00
 endif 
END

 

 

Edit: What was probably happening is that calling ShowMessage was setting the result of GetButtonPressed back to -1 before you had chance to read the previous value.

Edited by tunaisafish
Link to comment
Share on other sites

I use quest scripts for message box menus a lot. Usually with a quest delay of .033, so there's no problem there. But in the gamemode block of any script, you have to guard sections of it like tunaisafish said.

 

As far as VCG01 starting back up - I think by referencing it also includes if there is another script or dialog result script that sets a stage for VCG01 - it will start back up if not running.

 

In the Geck, try searching for VCG01 and see where it turns up.

Link to comment
Share on other sites

Perhaps a dumb question, but... can you even HAVE 2 GameMode blocks in the same script?

 

 

I think it will compile but you are begging for problems if you do it ;)

Link to comment
Share on other sites

Perhaps a dumb question, but... can you even HAVE 2 GameMode blocks in the same script?

 

 

I think it will compile but you are begging for problems if you do it ;)

 

That's kinda what I was thinking; it seems to make more sense if you have one GameMode block with stages controlled by a state machine, or "entrypoints" controlled by conditional guards. If the engine is being "dumb" about multiple blocks, it would execute both blocks, and you'd end up with re-entrance issues even on the same thread. Or, if it's taking only the last declared block, you'd get no message at all, in this case. I guess we'd need to know How the engine actually deals with this situation.

Link to comment
Share on other sites

The two GameMode blocks are fixed, but the main problem has yet to be fixed. I still have the VCG01 starting up and my menu shows up but it when I click Assassin it doesn't do what I'm wanting it to do. It just continues the original doc mission. Only difference now is that the menu shows up once thanks to DoOnce.
Link to comment
Share on other sites

The two GameMode blocks are fixed, but the main problem has yet to be fixed. I still have the VCG01 starting up and my menu shows up but it when I click Assassin it doesn't do what I'm wanting it to do. It just continues the original doc mission. Only difference now is that the menu shows up once thanks to DoOnce.

 

Did you read and follow the instructions to search for VCG01 as suggested by RickerHK above?

 

"I use quest scripts for message box menus a lot. Usually with a quest delay of .033, so there's no problem there. But in the gamemode block of any script, you have to guard sections of it like tunaisafish said.

 

As far as VCG01 starting back up - I think by referencing it also includes if there is another script or dialog result script that sets a stage for VCG01 - it will start back up if not running.

 

In the Geck, try searching for VCG01 and see where it turns up."

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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