Conversation restrictions

Moderator: Event DM

Post Reply
User avatar
Final Shinryuu
Sage
Posts: 2060
Joined: Thu Jun 24, 2004 3:20 am
Location: http://hades.mercuric.net/

Conversation restrictions

Post by Final Shinryuu » Sat Aug 06, 2005 8:56 pm

I'm trying to make a conversation option only appear for characters of fifth level or under.
Here is what I managed to come up with, and attach in the conversation editor.

Code: Select all

 int StartingConditional()
 {
     if(GetHitDice(GetPCSpeaker()) < 6)
         return FALSE;
     return TRUE;
 }
And as you can see, I have very little idea of what I am doing.
Could someone point out what I need to do to make this work?
User avatar
Grunt
Team Member; Retired with Honors
Posts: 9579
Joined: Sat Jun 05, 2004 12:37 am
Timezone: I AM A TIME LORD
Location: Boston, MA

Re: Conversation restrictions

Post by Grunt » Sat Aug 06, 2005 9:02 pm

Final Shinryuu wrote:I'm trying to make a conversation option only appear for characters of fifth level or under.
Here is what I managed to come up with, and attach in the conversation editor.

Code: Select all

 int StartingConditional()
 {
     if(GetHitDice(GetPCSpeaker()) < 6)
         return FALSE;
     return TRUE;
 }
And as you can see, I have very little idea of what I am doing.
Could someone point out what I need to do to make this work?
...can you use an ELSE statement in there?

it looks like it is saying

if HD < 6 return false.
Now return true.

...you need something to say if hd <6 choose false, Else return true... I think?

Thaylis Beign: Morgan, did you cast recitation?
Morgan Thornheart: Yes
Thaylis Beign: *nods*
Morgan Thornheart: Aarilax blesses you all. Now get the fuck out of here.
User avatar
Final Shinryuu
Sage
Posts: 2060
Joined: Thu Jun 24, 2004 3:20 am
Location: http://hades.mercuric.net/

Post by Final Shinryuu » Sat Aug 06, 2005 9:07 pm

Hehe, maybe. I don't quite understand it myself, so I'm hoping that someone around here knows how to do this right and can just write up a fixed version of it for me. :)
User avatar
Final Shinryuu
Sage
Posts: 2060
Joined: Thu Jun 24, 2004 3:20 am
Location: http://hades.mercuric.net/

Post by Final Shinryuu » Sat Aug 06, 2005 9:48 pm

I've got it working, thanks!
User avatar
xarthna
Team Member; Retired with Honors
Posts: 3213
Joined: Thu Jan 20, 2005 5:55 pm
Location: OH GMT-5 (-4:DST)

Post by xarthna » Sat Aug 06, 2005 11:41 pm

*facepalms*

once a function has encountered a Return statement, control is "returned" back to the calling function. No further statements in that function will be executed.

At least that is how the several computer languages I know operate. :)

I'd hope that NWN scripting would not make up different rules.
Post Reply