Author Topic: basic quest help (vars, object and dialog)  (Read 2635 times)

basic quest help (vars, object and dialog)
« on: March 17, 2015, 03:48:09 pm »
I'm working on a project I want to turn Single Player. Made the intro, a few encounters and the first location. Also a quest location.
But I'm kinda stuck in the next step. Which is adding the quest. It's really simple. But I've been looking everywhere in the SDK examples of quests and seems really dificult and I feel really lost. I know everything works with variables. But i really don't know how do they work.

The quest is basically: Some guy tells you to go to a non-visible location and pick up a case. Then bring it back to him. That's all.

This is a little example of what i have in mind:
-You talk to a guy who after cheking your charisma, inteligence and level, gives the hidden dialog line to have the quest.
( this activates quest stage #1)
-You go to the location and take the case.
( this activates quest stage #2)
When you go out, the location disappear ( maybe autogarbage?)
-Once you get back with the quest giver and retrieve the case the quest is completed.
( quest stage #3)

I can turn the location visible with no problem and also the stat checking (int, char, lvl etc) but not the variables and quest stages. I have absolutely no idea.
Could anyone please tell me briefly how to write the Vars and link them to the quest stages?

The most far i've gone with vars ever is making a npc memorize your name. Nothing further

Offline Ghosthack

  • Rotator
  • Bytecruncher
Re: basic quest help (vars, object and dialog)
« Reply #1 on: March 18, 2015, 01:49:01 pm »
You have to create a quest variable with the dialog editor. Then you simply set this variable to different values in the dialogs (or via script) when you want to change to a different strage.

Take a look at how https://github.com/rotators/fo2238/blob/master/Server/dialogs/ncr_trader_buster.fodlg this works for example, open in the the dialog editor and check how q_ncr_buster_smokes is used.

To get some text in the pipboy you have to edit https://github.com/rotators/fo2238/blob/master/Server/text/engl/FOQUEST.MSG accordingly to the format specified at the top:

Code: [Select]
#
# Number formula:
# VariableId * 1000 + Value (1-100) - The text that appears at a given value of the variable (current objective).
# VariableId * 1000 + 101 - Name of quest tab.
# VariableId * 1000 + 102 - Permanent quest description.

For my example with the buster quest (variable id is 6111)

Code: [Select]
#=======================================
# 6111
# NCR, pick up a few smokes for buster
#=======================================
{6111001}{}{Buster wants me to buy him some cigarettes from the Rawhide.}
{6111002}{}{I have to return the cigarettes to Buster.}
#{6111003}{}{Quest Completed.}
{6111003}{}{I've given the cigarettes to Buster.

If you haven't already, take a look at http://fodev.net/files/sdk/ArtOfDialogs.pdf - I wrote this a long time ago and it doesn't cover everything but it does go into how the dialog variables work a little bit.

I hope this makes some sense  :)

JovankaB

  • Guest
Re: basic quest help (vars, object and dialog)
« Reply #2 on: March 18, 2015, 06:17:15 pm »
I'm not sure why you want to track with var if someone took the case.
You can check if the player has the item in the inventory when he talks to the NPC.
So the var values may be:

0 - Quest not taken
1 - Quest taken
2 - Quest taken and completed

Just make the case a quest item with unique PID not a generic case.

Unless the quest is more sophisticated than it looks from the description.

Also I think it's easier and safer to delete the quest location when the
player completes the quest, not when he leaves the quest location.
« Last Edit: March 18, 2015, 06:22:11 pm by JovankaB »

Re: basic quest help (vars, object and dialog)
« Reply #3 on: March 18, 2015, 08:54:13 pm »
Thanks! I will check it out right now!

Anyway, JovankaB, firstly, I want to track with variable because exploits. Like, for example, taking the quest over and over and over again. And it's supposed to happen only once.
Also yeah, already thought about the unique PID and made the unique item with the PID.

Re: basic quest help (vars, object and dialog)
« Reply #4 on: March 19, 2015, 12:10:51 am »
Yay! made it!

Managed to work with the variables and quest stages PRETTY DAMN NICE, i had a lot of fun doing it and exploring different ways to do it.
BUT, can't make the Pipboy info show. I will explain down.

In _Vars.fos

Code: [Select]
#define LVAR_noob_case                   ( 8852 )

and then


Code: [Select]
   $ 8852 1 noob_case  0 0 3 0
**********
   ASDASD
**********


In the .DLG file:

start value: 0
max value: 3
min value: 0

Also ticked "quest"

In FOQUEST.MSG:

Code: [Select]
{8852001}{}{Ol' traders stuff}
{8852002}{}{I have to retrieve the briefcase to Daryl.}
{8852003}{}{I've given back the briefcase}



So, everything is working better than fine except the pip boy stuff and something else. I wanted to delete the location as Jov said but I can't find the function.
To spawn the location (only visible for me) i used dialog@r_ShowLocation (272) But i ccan't find a function to delete it back.

Anyway, thanks a lot for the help Ghosthack and JovankaB, this is already a big giant step and made me jump in my progress to understand things of FOnline SDK.

JovankaB

  • Guest
Re: basic quest help (vars, object and dialog)
« Reply #5 on: March 22, 2015, 04:17:57 pm »
I don't know if this will help, but for pipboy maybe also add quest title and description:

#   VariableId * 1000 + 101 - Name of quest tab.
#   VariableId * 1000 + 102 - Permanent quest description.

So in your case you would need something like this:

{8852101}{}{Daryl's briefcase}
{8852102}{}{Retrieve a briefcase for Daryl}
« Last Edit: March 24, 2015, 12:50:48 pm by JovankaB »