Intelligence block in dialogue nodes

Sirren67

Look, Ma! Two Heads!
Is there a way to have a given dialogue line showed using MAX intelligence, instead of using min iq? I mean, a given line showed only if the Pc has a iq lower, not equal or higer than a given value...
Something like NOption(123, Node002, 004); ... But if your Pc's int is 5 or higer the line does not pop up.
I got the feeling that it's possible, but my experiments did not produce working dialogues. Is this possible?
 
Well I think I know what you are asking about and this should easily be done by just inserting an if statement before the line. Example code follows:

Code:
NOption(122, Node001, 004);    
if ( dude_iq <= 5 ) then   
    NOption(123, Node002, 004);   <-- will only show if the player has an intelligence less than or equal to 5   
NOption(124, Node003, 004);    
NOption(125, Node004, 004);
 
Wasn't there something about negative min-IQ requirement? I vaguely remember seeing something like this:
Code:
NOption(124, Node003, -3);
in some scripts - the text indexes indicated these were the "dumb" responses.
 
Shadowbird said:
Wasn't there something about negative min-IQ requirement? I vaguely remember seeing something like this:
Code:
NOption(124, Node003, -3);
in some scripts - the text indexes indicated these were the "dumb" responses.

Yes, those are for dumb characters only. (intelligence of 3 and below) I believe Sirren67 wanted to have the int a bit higher then that though.
 
Nope, this '-' statement can be used with any number.
So you can use:
Code:
   NOption(123, Node002, -5);
will show if INT is less than or equal to 5 .
 
In my opinion best way to do dialogue options is use code:

Code:
if (stat_success(dude_obj, STAT_iq, 0)) then begin

or

Code:
if (not stat_success(dude_obj, STAT_iq, 0)) then begin


Because you got some chances, higher or less convince someone. Otherwise if your stats are below, you will never able to do something in game using character which that stats.

Different stat test may be: (from Define.h)

STAT_st
STAT_pe
STAT_en
STAT_ch
STAT_iq
STAT_ag
STAT_lu
STAT_age

From command.h
#define stat_success(x,y,z) (is_success(do_check(x,y,z)))

From commands.doc
is_success Returns True if a given contest roll result value is a success, otherwise False.
do_check Do a check/test-roll versus one of the various basic traits (strength, perception, etc.). who (ObjectPtr) check (int) modifier (int)
 
jargo said:
Nope, this '-' statement can be used with any number.
So you can use:
Code:
   NOption(123, Node002, -5);
will show if INT is less than or equal to 5 .
Oh, my mistake then. I did not realize that. Thanks jargo!
 
jargo said:
Nope, this '-' statement can be used with any number.
So you can use:
Code:
   NOption(123, Node002, -5);
will show if INT is less than or equal to 5 .

The practical use would be limited, though, since you always or nearly always want to keep smart and stupid sets of replies separate. Any "semi-stupid" reply granted to an IN 4-5 character by -5 would be given to IN 1-3 chars as well.
 
Yes.
To made that semi-stupid character you will need to use additional if statement.
Code:
if (get_critter_stat(dude_obj,STAT_iq) > 3) then 
NOption(123, Node002, -5);
And not much real use for it i guess.
 
Uhm, when I use something like:
NOption(123, Node002, -5);
then the script stops working... I have to put a iq var block, or use the usual method. I've used the "-x" trick in a couple of scripts where the critters give and get timed events. Could this be related in any way?
Thanks
 
hmm i don't know why it does not work for you.
Here this is a test:

Code:
procedure talk_p_proc 
begin
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
   call Node001;
gSay_End;
end_dialogue;
end
 
procedure node001
begin
Reply(102);
NOption(106,Node999,-6);
NOption(107,Node002,-5);
NOption(110,Node999,-4); 
end 
 
procedure Node002
begin
set_critter_stat(Dude_obj,STAT_iq,1);
Reply(110);
NOption(106,Node999,-5);
NOption(107,Node999,-6);
end

procedure Node999
begin
 
end

It works just fine for me.
 
Jargo, I tested your sample and it worked just fine... This mechanic isn't essential but... It's odd it didn't work in my previous scripts. I must have made mistakes...
I'll test in more scripts and tell you what.
In the meantime have a nice time and work with your mod. Bye.
 
Back
Top