Help with a bit of scripting?

Post » Tue May 17, 2011 10:46 am

How do i make a script that, when I talk to my NPC, the quest that I am on immediately updates to the next stage?

Ok I tried doing it myself, will this work?

SCN NameOfScript

Begin onActivate
if (getActionref == player)
if (getStage ABCquest < 20)
setStage ABCquest 20
endif
endif

end

or is there a function that will allow me to update the quest only after he says a specific line of dialog? because right now the quest will update immediately after just interacting with him, without even talking to him to get the info needed to advance in the quest.

I hope you guys understand what I am saying and thanks in advance for any help!
User avatar
Hairul Hafis
 
Posts: 3516
Joined: Mon Oct 29, 2007 12:22 am

Post » Tue May 17, 2011 6:58 am

Instead of the script try it with a Result Script directly on the dialogue window.

On the topic you want the quest update, go on Result Script (Begin) add:

if (getStage ABCquest < 20)
setStage ABCquest 20
endif

Not tested, but it should work and it should fire the script until the quest is < of 20.
User avatar
Oscar Vazquez
 
Posts: 3418
Joined: Sun Sep 30, 2007 12:08 pm

Post » Tue May 17, 2011 1:49 pm

Alright thanks! Now i have another problem.

There are 2 ways to get that info. One is by just paying 5000 caps directly, or the 2nd way is by bartering (need 50) then the price gets lower to 3500 caps.

Hence I created 2 topics for this, One before the barter and one after the barter.

How do I make sure the other one gets cancelled (not in the dialog menu) when I select either one?

Thanks a million for any help!

EDIT: Oh another problem. Why cant I compile this 'result script'? All 4 lines are in that small box.

player.removeitem caps001 4000
player.additem WeapABC
BOBNPC.removeitem WeapABC
BOBNPC.additem caps001 4000
User avatar
David Chambers
 
Posts: 3333
Joined: Fri May 18, 2007 4:30 am

Post » Tue May 17, 2011 9:58 am

Just use a condition on the topic related to the relevant quest stage. Something like if getstage MyQuest < 20.
User avatar
alicia hillier
 
Posts: 3387
Joined: Tue Feb 06, 2007 2:57 am

Post » Mon May 16, 2011 11:02 pm

as b3w4r3 sayd, to make sure the topic won't appear anymore you have to use a condition. So if you already have the quest advanced the topic won't appear.

As for the other problem, put it on Result Script (End). Do you get some kind of error?
User avatar
Dustin Brown
 
Posts: 3307
Joined: Sun Sep 30, 2007 6:55 am

Post » Tue May 17, 2011 9:42 am


EDIT: Oh another problem. Why cant I compile this 'result script'? All 4 lines are in that small box.

player.removeitem caps001 4000
player.additem WeapABC
BOBNPC.removeitem WeapABC
BOBNPC.additem caps001 4000


Additem, and remove item both need a count. Also be sure that BOBNPC is the reference ID and not the EditorID.
User avatar
Johnny
 
Posts: 3390
Joined: Fri Jul 06, 2007 11:32 am

Post » Tue May 17, 2011 12:15 pm

Ohhh okay I think I know it failed to compile....because I put the editor ID..my NPC doenst have a reference ID...okay I'll fix that.

Okay thanks, may I know what the condition is? I dont see any condition that checks whether you've selected that dialog or not, neither do I see any 'removetopic' function. =(

Sorry for being so......noobish.

EDIT: Oh and 1 more question..my quest doesnt show up in game when I start the game. I put 'start game enabled' and priority of 50, however my quest doesnt show up and notify you that you have a new quest to do. What gives?
User avatar
CHANONE
 
Posts: 3377
Joined: Fri Mar 30, 2007 10:04 am

Post » Tue May 17, 2011 2:01 am

Ohhh okay I think I know it failed to compile....because I put the editor ID..my NPC doenst have a reference ID...okay I'll fix that.

Okay thanks, may I know what the condition is? I dont see any condition that checks whether you've selected that dialog or not, neither do I see any 'removetopic' function. =(

Sorry for being so......noobish.

EDIT: Oh and 1 more question..my quest doesnt show up in game when I start the game. I put 'start game enabled' and priority of 50, however my quest doesnt show up and notify you that you have a new quest to do. What gives?


About the condition, on the topic you see there is a Conditions tab, there you have to put a new entry. On Condition Function select GetStage, then on Function Parameters you have to select your quest, then where you see the = symbol select the < and where you see 1.000 you have to put 20.

So basicly this will check if your quest stage is minor of 20, if it is the topic will be shown, if not the topic will not be shown.

Checking Start Game Enabled doesn't make it start the quest immediatly you enter the game, but it means is ready to be triggered. You can use this simple script to start the quest when you run the mod the first time:

scn MyQuestStartScriptbegin GameModeif getStage ABCQuest < 10    setStage ABCQUest 10  endifend


Save it as quest script and on the quest tab on the script add this. Now I've added 10, but you have to put any number your first quest stage is.
User avatar
Facebook me
 
Posts: 3442
Joined: Wed Nov 08, 2006 8:05 am

Post » Mon May 16, 2011 11:17 pm

Yeap, I figured that out by myself already. But thanks alot!

Now how do I update my quest when I pick up a note? (E.g. bob asks player to go collect a note for him. Note says that there is a rare weapon hidden behind some rocks, quest moves on from stage 10 to 20, and update the quest marker to the rare weapon)

I know you cant attach scripts to notes, so the only way is to use 'OnTrigger' right?

And of course use a cubic activator.
User avatar
Danel
 
Posts: 3417
Joined: Tue Feb 27, 2007 8:35 pm

Post » Mon May 16, 2011 11:24 pm

Yeap, I figured that out by myself already. But thanks alot!

Now how do I update my quest when I pick up a note? (E.g. bob asks player to go collect a note for him. Note says that there is a rare weapon hidden behind some rocks, quest moves on from stage 10 to 20, and update the quest marker to the rare weapon)

I know you cant attach scripts to notes, so the only way is to use 'OnTrigger' right?

And of course use a cubic activator.



Yeah, use a onTrigger.
User avatar
Amy Melissa
 
Posts: 3390
Joined: Fri Jun 23, 2006 2:35 pm

Post » Tue May 17, 2011 6:00 am

Alright, thanks pal!

Erm, how big does the activator need to be? Just big enough to totally cover the item right? Or must I cover the whole room that the object is in?
User avatar
Mackenzie
 
Posts: 3404
Joined: Tue Jan 23, 2007 9:18 pm

Post » Tue May 17, 2011 2:22 pm

Alright, thanks pal!

Erm, how big does the activator need to be? Just big enough to totally cover the item right? Or must I cover the whole room that the object is in?


Is only important that cover the player. So make a big activator around the item so that the player is inside when picking it up.
User avatar
Patrick Gordon
 
Posts: 3366
Joined: Thu May 31, 2007 5:38 am

Post » Tue May 17, 2011 11:31 am

Ah okay. Thanks for all your help!

+1 kudos to you, but sadly this website doesnt allow.
User avatar
Lavender Brown
 
Posts: 3448
Joined: Tue Jul 25, 2006 9:37 am

Post » Tue May 17, 2011 9:25 am

Ah okay. Thanks for all your help!

+1 kudos to you, but sadly this website doesnt allow.



No problem, for anything else feel free to ask.
User avatar
Raymond J. Ramirez
 
Posts: 3390
Joined: Sun Oct 14, 2007 8:28 am


Return to Fallout: New Vegas