Author Topic: Question on One Item of Xan's Coding  (Read 4338 times)

Offline Bill Bisco

  • Planewalker
  • *****
  • Posts: 30
Question on One Item of Xan's Coding
« on: July 09, 2015, 02:17:41 AM »
Code: [Select]
// Someone else initiates talk

IF ~!IsGabber(Player1)~ O#XanPIDNotPC1
SAY @1030
IF ~~ EXIT
END

I get the fact that if anyone talks to Xan other than Player1,  this code will reference O#XanJ.tra's line 1030. 

What does the bit of code do?

Code: [Select]
O#XanPIDNotPC1
There's no // there, so I assume that the Engine reads that and does, but I cannot figure it out.

Thanks,

Bill

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: Question on One Item of Xan's Coding
« Reply #1 on: July 09, 2015, 02:29:58 AM »
It is a bit of dialogue that plays if someone else clicks on Xan, not Player1. For example, Viconia is the active party member, she approaches Xan and clicks on him. If a flirt menu opens for Xan and Viconia, that'd be awkward, right? So I started a dialogue state

O#XanPIDNotPC1 - that's its name, and it means "somebody talks to Xan, and it's not PC".

!IsGabber means Not Player1.



Offline Bill Bisco

  • Planewalker
  • *****
  • Posts: 30
Re: Question on One Item of Xan's Coding
« Reply #2 on: July 09, 2015, 02:43:43 AM »
So you referenced that dialogue with O#XanPIDNotPC1.

That reference itself does nothing though? 

How would you use these dialogue references?  They're not like Globals which tend to have values of 0,1, & 2

Thanks,

Bill

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: Question on One Item of Xan's Coding
« Reply #3 on: July 09, 2015, 03:11:49 AM »
Those are called dialogue state names.

There are practically no restrictions on them, except in interjections - things that start with INTERJECT or I_C_T. If you are writing an interjection, you MUST be using a unique name, prefixed with your own prefix.

(By the way, I see you have registered a prefix? This is well done! So, all your I_C_T's have to start with BI(but please keep in mind that you'll be using this prefix for all your mods, and it might be wise to prefix it with your NPC's name, like I do with Xan's variables, which all start with O#Xan)).

Outside of interjections - in dialogue, banters, flirts and romance talks - feel free to use whichever labels you like! Heck, even a, b, c, d,e is fine!

But, and it is an important but: these dialogue states must have unique names within the file. It doesn't matter if some other mod has a dialogue state a1.1, you can have it, too. But you cannot have TWO states called a1.1 - you must use b1.1, or a1.2, or a2 instead.

I am using long, long dialogue state names, because I have thousands of those, and I don't want them to be mixed up. Also, sometimes I want the names to mean something(NotPC), so I immediately recall what the dialogue state is all about.

Offline jastey

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1524
  • Gender: Female
Re: Question on One Item of Xan's Coding
« Reply #4 on: July 13, 2015, 01:45:15 AM »
Bill Bisco: The dialogue state name is only the name in your .d file. It will be compiled to a dialogue state number if the mod is installed. The number then is depenedent on which state numbers are "free" in Xan's dlg file.
Thus, if there are already 45 dialogue states, this one will become number 46, etc.

But in your .d file, you give it names. (This is also an advice: Do not give your dialogue states in your .d-file plain numbers, as you do not know how the dlg looks like - another mod might have added some dialogue states, and yours would overwrite them.) The numbers are given upon installation, in a flexible way.

Try it out - install your mod, then decompile the dlg. You'll see how your dialogue states are added to the dlg.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: