NeverwinterConnections.com

   NeverwinterConnections.com
   Main Topics
   Builders Discussion

   Oh so noob, scripting/conversation help needed
Pages: 1  
   Author  Topic: Oh so noob, scripting/conversation help needed  (Read 46 times)
crown75

Newbie Poster


Last On: 03/18/10
View Profile
Message Player

Australia

Posts: 3
Oh so noob, scripting/conversation help needed
Return To Top       

After returning to NWN after a fairly long absence. I am looking to start making my own mods for myself and my friends.

I have got a hold of the tutorial mod from bioware, and would like to expand on it now.

scripting is still a bit strange to me, it has been a long time since i've had to write any code, but its slowly coming back.

My question is though, if i have an NPC giving a quest, and concluding with the same NPC, how can you then branch a new conversation once the quest is completed? I mainly want this NPC to hand out quests, one after the other, but only when the previous quest is completed.

I.P. Logged
Zelknolf

Experienced User


Last On: 10/04/10
View Profile
Message Player

United States

Posts: 31

Return To Top       

There is a "Text Appears When" tab on the bottom of your conversation editor. These are a series of true/ false functions checked when a conversation is started. If the field is empty, it is treated as if it returned true; otherwise, the script is run and the conversation item it applies to appears if the function returns true, or checks the next one if it returns false.

The scripts should all be
int StartingConditional()
{
[[code goes here]]
}



So to get what you're looking for, the last quest your NPC should assign would go at the top of your conversation tree, with each quest before it on the lines before that, and a script that checks a variable (or persistent variable, if we're talking persistent world) on every quest except the first one (which would play first, because none of the ones above it could return true, because they haven't done anything. Right? Right.)


Not sure how helpful this is. Hard to say how proficient you are with scripting by the first post, but I'm happy to write some more if this isn't enough to get you started.

I.P. Logged
crown75

Newbie Poster


Last On: 03/18/10
View Profile
Message Player

Australia

Posts: 3

Return To Top       

So all conversations need to be worked out before hand? ie the last quest conversation needs to be written before the previous one etc.?
i have set up a local variable for first contact, that gives a speel on first try at conversation, then moves onto the quest giving portion.

Which works fine.

Now i want to add another quest, with items gained from 1st.
I would now place this conversation tree above the previous tree?
And how would one accomplish that? i have tried and any new parts from the root automatically go to the bottom. Should i just re-write the whole conversation?

EDIT: i have managed to rearrange all the needed branches. Thank you for your help. The read from top down, makes a lot of sense now.

One additional question though. is there anyway to check the status of the players journal in an "if" statement?
So if player has journal entry "X", therefore they have finished quest "Y" then return true?

i have looked through the conversation "Functions" but am unable to find anything journal related. I may be blind i admit.

« Last Edit: on: Mar 2, 2010, 6:13AM » I.P. Logged
Zelknolf

Experienced User


Last On: 10/04/10
View Profile
Message Player

United States

Posts: 31

Return To Top       

I would suggest using GetLocalInt/ SetLocalInt for single-player games, and some sort of persistent data storage for muliplayer games. I don't know of any way to directly get data from the player's journal.

I.P. Logged
Urk

Extreme Poster


Last On: 02/12/12
View Profile
Message Player

United States

Posts: 508

Return To Top       

You can't access the players journal, but you can set an integer variable on the PC with the same value of the journal entry.

An easier solution for MP mods than using persistent storage (MySQL databases give me a headache) is to set variables on the areas or on the module itself. This will work fine as long as you're writing a party co-op mod and not a PW setting.

I.P. Logged
crown75

Newbie Poster


Last On: 03/18/10
View Profile
Message Player

Australia

Posts: 3

Return To Top       

Thanks for the help guys. First module done. its basic, but its done.

I.P. Logged
Pages: 1  
Moderators: Rizzen, Shinji, Gilaun, Garnak, J'Dai Voisin, Lazybones, Ochobee, Eliandi
   NeverwinterConnections.com
   Main Topics
   Builders Discussion

   Oh so noob, scripting/conversation help needed

 
Copyright © 2002 Shawn Schultz. All rights reserved.
All trademarks are properties of their respective owners. Read our Terms of Use and our Privacy Policy.