Pocket Plane Group

Miscellany, Inc. => Infinity Engine Modding Q&A => Topic started by: Bill Bisco on June 13, 2015, 11:16:28 AM

Title: Simple Question: D file Dialog multiple requirements
Post by: Bill Bisco on June 13, 2015, 11:16:28 AM
Simple question here.  I have a .D file which states the following:

Code: [Select]
IF ~NumTimesTalkedToGT(0)
Global("Erevain_Jerk", "GLOBAL", 1)~ THEN BEGIN 11 // from:

Now, from experience, I can tell that it checks for both of these variables.  The Number of Times Talked to must be more than 0 and the Erevain_Jerk global must be 1.  Can the code be written such that both requirements are on one line of code?

For example:

Code: [Select]
IF ~NumTimesTalkedToGT(0) Global("Erevain_Jerk", "GLOBAL", 1)~ THEN BEGIN 11 // from:
Thanks,

Bill
Title: Re: Simple Question: D file Dialog multiple requirements
Post by: CrevsDaak on June 16, 2015, 07:28:40 PM
Yes.

I personally put each on a line of it's own because you can see exactly what it is checking for much easily.
Title: Re: Simple Question: D file Dialog multiple requirements
Post by: Bill Bisco on June 16, 2015, 10:45:55 PM
Great.  Thank you and the syntax above is correct?  Just a space between the variables?
Title: Re: Simple Question: D file Dialog multiple requirements
Post by: CrevsDaak on June 19, 2015, 06:24:36 PM
Thank you and the syntax above is correct?
Your welcome. I guess it is (I'm not a parser but hey). You can omit the THEN if you want.
Just a space between the variables?
Variables within the Infinity Engine shouldn't have spaces AFAIK (In your script there are two variables being checked--a LOCAL (to the creature running that is being talked to) is used by NumsTalkedTo, but I won't get on that--and the Erevain_Jerk variable, this one's alright since it doesn't have a space). Also mind that variables inside the engine aren't case sensitive (dunno how the BAF->BCS compiler handles it, but I guess it just puts them in caps).