Author Topic: Noob with Need  (Read 31903 times)

0 Members and 1 Guest are viewing this topic.

Offline Smiling Imp

  • Eternal Apprentice
  • Modders
  • Level 1
  • *****
  • Posts: 290
  • Karma: +7/-0
  • Gender: Male
    • View Profile
    • Email
Noob with Need
« on: January 10, 2009, 06:01:49 PM »
Before I start working on CHAIN again, i have this hiccup with my parting dialog. It works fine if you reject the NPC when you first meet him. However, if you take him into the party and then dismiss him, when I want him to rejoin again, it gives me the dismiss dialog again instead of his come back dialog. It was working before, but I must have fiddled with something and now it doesn't.Here is what I have so far for his P dialog

BEGIN Z#LinkP

IF ~Global("LINKJoined","LOCALS",1)~ THEN BEGIN LEAVEGROUP
SAY ~What? You're kicking me out? I'm way buffer than those other guys. You sure about this?~
IF ~~ THEN REPLY ~My mistake Link, please stay.~ DO ~JoinParty()~ EXIT
IF ~~ THEN REPLY ~Sorry Link, you'll have to wait for me here.~ EXIT
END


IF ~Global("LINKJoined","LOCALS",0)~ THEN BEGIN ComeBack
SAY ~Let me guess, you want me in the party right? I knew you would come cralwing back.~
IF ~~ THEN REPLY ~Sure, but mind the attitude.~ DO ~SetGlobal("LINKJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~I don't think that's a good.~ EXIT
END

Please Help

Offline berelinde

  • Global Moderator
  • Level 3
  • *****
  • Posts: 1011
  • Karma: +102/-31
    • View Profile
Re: Noob with Need
« Reply #1 on: January 10, 2009, 07:42:19 PM »
You need to set the variable to allow the rejoining dialogue to play.

Try this

IF ~~ THEN REPLY ~Sorry Link, you'll have to wait for me here.~ DO ~SetGlobal("LINKJoined","LOCALS",0)~ EXIT

Also, you really, really need to use your prefix in your variables, as well. You should also be aware that Zyraen uses Z#. You might want to check the list at BWL and get your own unique prefix.

Offline Smiling Imp

  • Eternal Apprentice
  • Modders
  • Level 1
  • *****
  • Posts: 290
  • Karma: +7/-0
  • Gender: Male
    • View Profile
    • Email
Re: Noob with Need
« Reply #2 on: January 11, 2009, 06:47:22 AM »
Try this

IF ~~ THEN REPLY ~Sorry Link, you'll have to wait for me here.~ DO ~SetGlobal("LINKJoined","LOCALS",0)~ EXIT

Thanks that was just the trick.

Maybe you could help tell me what's wrong with the Moblin. Before I had him as an enemy and he was "okay" but I wanted to add more to the encounter, so I decided to give him a short dialog and portrait. At first, the dialog crashed the game. Now it works, but not until I provided a response for the PC. Why is that? 

I have turned the Moblin into a neutral creature and did the INITDLG.BCS so that he starts the dialog now, the only problem is that afterwards he just sits there. I don't know, maybe he is a friendly Moblin. Any hints? 

Oh, and here is some of my coding for the CHAIN (forgive the primitive dialog)

BEGIN BLINK

CHAIN
IF ~InParty("Jaheira")
See("Jaheira")
!StateCheck("Jaheira",STATE_SLEEPING)
Global("JaheiraLinkTalk","LOCALS",0)~ THEN BLINK Talk1
~So Jaheira, who's this husband I keep hearing about?~
DO ~SetGlobal("JaheiraLinkTalk","LOCALS",1)~
== BJAHEIR ~It is none of your concern brash one.~
== BLINK ~Oh contraire.~
EXIT

it uploads fine, but I hit control 'I' when the two of them are on screen, and still nothing? A man cannot live on annoying interjections alone. If he is truly going to make his mark on the woman of Amn, he needs banter!
« Last Edit: January 11, 2009, 07:24:15 AM by Smiling Imp »

Offline berelinde

  • Global Moderator
  • Level 3
  • *****
  • Posts: 1011
  • Karma: +102/-31
    • View Profile
Re: Noob with Need
« Reply #3 on: January 11, 2009, 07:35:39 AM »
You're beginning the file with BLINK (are you reading anything I'm writing about prefixes?), so it isn't that.

So that means there might be a problem with the tp2, or with the DV. Since you aren't checking Link's DV anywhere, and since Jaheira's is right, I'd look fo a problem with the tp2.

Can you post the part where you add Link's banter file to interdia.2da? It should look something like the following, but with Link's data in place of Gavin's.

APPEND ~interdia.2da~
~B!GAVIN   BB!GAVIN~
UNLESS ~B!GAVIN~

Offline Smiling Imp

  • Eternal Apprentice
  • Modders
  • Level 1
  • *****
  • Posts: 290
  • Karma: +7/-0
  • Gender: Male
    • View Profile
    • Email
Re: Noob with Need
« Reply #4 on: January 11, 2009, 02:45:28 PM »
Yeah, i hear you about about a prefix. To be honest, I've been too excited that this is actually coming together to check the list, and though it will cause me headache in the long run, I'm going going with it, until I get the basics down, and then go back and change what needs changing.

APPEND ~pdialog.2da~
~Z#Link Z#LinkP Z#LinkJ Z#LinkD Z#Lin25P Z#Lin25J Z#Lin25D Z#Link25~
UNLESS ~Z#Link~

APPEND ~interdia.2da~
~Z#Link BLink Z#LinB25~
UNLESS ~Z#Link~

This is what it looks like now, and the banter works, thank you. Yeah I had no idea about the APPEND. Most of the tutorials that I've read concerning that part of the just say copy this, but don't say why? Will I need to add any more stuff there? What about in the pdialog.2da portion?

Offline berelinde

  • Global Moderator
  • Level 3
  • *****
  • Posts: 1011
  • Karma: +102/-31
    • View Profile
Re: Noob with Need
« Reply #5 on: January 11, 2009, 03:17:09 PM »
Looks OK to me. But I knew your P file was working out OK, or your leaving-dialogue wouldn't work. ;)

By the way, every time you hit something that doesn't work right the first time (or even the 15th), and every time somebody posts something that makes it all look so obvious, the reason they know the answer is that they made the same mistake themselves. Just lettin' you know.

Offline Smiling Imp

  • Eternal Apprentice
  • Modders
  • Level 1
  • *****
  • Posts: 290
  • Karma: +7/-0
  • Gender: Male
    • View Profile
    • Email
Re: Noob with Need
« Reply #6 on: January 11, 2009, 05:52:17 PM »
every time somebody posts something that makes it all look so obvious, the reason they know the answer is that they made the same mistake themselves. Just lettin' you know.

Thanks.. I suddenly feel less ignorant and ashamed than before. You must have cast a spell of wisdom or something.  ;D

Oh, before I forget. How do I make sure my banter happens before a certain conversation in the game? B/c if it happens afterwards, the dialog is irrelevant. I was reading somewhere about setting conditions. Guess I need to go over that again

Offline berelinde

  • Global Moderator
  • Level 3
  • *****
  • Posts: 1011
  • Karma: +102/-31
    • View Profile
Re: Noob with Need
« Reply #7 on: January 11, 2009, 06:28:35 PM »
Now you're getting into some of the more advanced aspects of dialogue coding. Not that that's a bad thing, but it's something I have to look up myself every time I want to do it.

There are two ways to do it. The simplest way is just to allow Link to make an interjection into the appropriate dialogue state, and then use the state label of the interjection as a check variable for the NPC dialogue. All the interjection state labels are stored by the game as global variables, so you could use !Global("statelabel","GLOBAL",1) as a check.

The second, more complicated way is to ADD_TRANS_ACTION to the state (looking up the syntax in the WeiDU docs (which you should have bookmarked, because you'll be using them a lot), setting a global variable. It has to be a global, as opposed to a local, because you'll be using it with a different character later. Then you'd use the global as a check variable, like with the interjection state label.

Suppose I wanted to see if a dialogue with Aerie happened, and the dialogue began in Aerie's banter file, state 15.  I have no idea if this is an actual state, or that it's about her wings, since I haven't decompiled the file to check, but it will serve for illustration.

Using the first method:

INTERJECT_COPY_TRANS BAERIE 15 z#aeriewings
== Z#LINK IF ~InParty("Z#Link") InMyArea("Z#Link") !StateCheck("Z#Link",CD_STATE_NOTVALID)~ THEN ~Here we go again.~
END

CHAIN
IF ~InParty("Z#Link")
InParty("Aerie")
!StateCheck("Z#Link",CD_STATE_NOTVALID)
!StateCheck("Z#Link",CD_STATE_NOTVALID)
!Global("z#aeriewings","GLOBAL",1)
See("Aerie")
CombatCounter(0)
!See([ENEMY])~
THEN BLINK z#wingtalk
~Tough luck, kid.~
DO ~SetGlobal("z#aeriewings,"GLOBAL",1)~
//etc
EXIT

Note that this will also prevent the interjection, which would probably also be irrelevant, at this point.

Using the second method:

ADD_TRANS_ACTION BAERIE BEGIN 15 END BEGIN END
~SetGlobal("Z#WingTalk","GLOBAL",1)~

And then continue as above.

Offline Smiling Imp

  • Eternal Apprentice
  • Modders
  • Level 1
  • *****
  • Posts: 290
  • Karma: +7/-0
  • Gender: Male
    • View Profile
    • Email
Re: Noob with Need
« Reply #8 on: January 12, 2009, 08:57:45 PM »
 ???...say what? I'll have to go over that a few times. Thanks though, you've been a big help

Offline berelinde

  • Global Moderator
  • Level 3
  • *****
  • Posts: 1011
  • Karma: +102/-31
    • View Profile
Re: Noob with Need
« Reply #9 on: January 12, 2009, 10:05:46 PM »
Get the basics down. When you can get unscripted banters to run, you're half-way there. Once you get familiar with that, move on to scripted banters. By the time you figure out how to work them, you'll understand what I wrote.

I know that it's a lot to take in all at once. Fortunately, you don't have to.

Offline Smiling Imp

  • Eternal Apprentice
  • Modders
  • Level 1
  • *****
  • Posts: 290
  • Karma: +7/-0
  • Gender: Male
    • View Profile
    • Email
Re: Noob with Need
« Reply #10 on: January 15, 2009, 08:14:39 PM »
So... I was fooling around with the idea of giving Link a talking fairy item. I read Com Solaufein's tutorial about it, and while I haven't actually tried it yet, it seems pretty straight forward. However, I was wondering how to accomplish that feat without having to mess with the in-game files. You know, so it will unpackage with the rest of my mod. I have started studying the SilverStar mod's cryblade to try to figure it out, but so far, I haven't found the answer. Anyone that can help, it would be appreciated. 

Offline berelinde

  • Global Moderator
  • Level 3
  • *****
  • Posts: 1011
  • Karma: +102/-31
    • View Profile
Re: Noob with Need
« Reply #11 on: January 15, 2009, 10:09:28 PM »
Try this. It's a tutorial by Smoketest, a very helpful kind of guy who used to hang out a lot at G3, but who hasn't been around in a while. He was one of the guys who gave me lots of coding advice when I was just starting out.

Offline Smiling Imp

  • Eternal Apprentice
  • Modders
  • Level 1
  • *****
  • Posts: 290
  • Karma: +7/-0
  • Gender: Male
    • View Profile
    • Email
Re: Noob with Need
« Reply #12 on: January 16, 2009, 05:54:32 PM »
Once again Berelinde, your help has proved invaluable. I got the fairy to converse. Still working on the dialog though. My only concern is that this might be overridden by someone elses' mod.  I tried naming the file "fairy.2da" file or something similar, but it was not working until I named it "ItemDial.2da" . Right now I have everything being put in the override file via the .tp2 file. Is this going to be a problem?
« Last Edit: January 16, 2009, 05:56:33 PM by Smiling Imp »

Offline berelinde

  • Global Moderator
  • Level 3
  • *****
  • Posts: 1011
  • Karma: +102/-31
    • View Profile
Re: Noob with Need
« Reply #13 on: January 16, 2009, 09:56:47 PM »
It probably will be a problem, but you don't have to distribute a replacement itemdial.2da with your mod. You can add to the existing one, which preserves compatibility.

Remember when we were talking about dialogue files, and you were appending to pdialog.2da and interdia.2da? You can append to any 2da file in the game. That's how people add new kits.

In your case, you would stick this in your tp2, and it would do the job quite nicely.

Code: [Select]
APPEND ~itemdial.2da~
~##XXXX    5689  ##DIALOG~
UNLESS ~##XXXX~

Here, ##XXXX is the item code for your item (## is your prefix... use it!), 5689 is the "conversible" flag, and ##DIALOG is the diaogue file for your item. Nice, neat, and compatible with anything. Now I'm going to go post the code for this in the tutorial I linked, so that people start patching in changes, rather than overwriting the file and breaking everybody else's mods.

And don't forget that you have to BEGIN the dialogue file for the item, just like any other dialogue file. After that, it's just another dialogue.

Offline theacefes

  • Global Moderator
  • Level 3
  • *****
  • Posts: 1250
  • Karma: +3/-0
  • Gender: Female
  • XTREME METAL ROCKER PUNK CHICK WITH ULTRA SURFBOARD
    • MSN Messenger - bohdi2185@msn.com
    • AOL Instant Messenger - bohdi2185
    • Yahoo Instant Messenger - theacefes@yahoo.com
    • View Profile
    • My Personal Website
    • Email
Re: Noob with Need
« Reply #14 on: January 16, 2009, 11:33:17 PM »
Quote
just another dialogue.

Uh oh...sounds like the title of the new romantic comedy coming NEXT YEAR. :)

.2a stuff rocks. You can do epilogues, make kits...reset the starting point of the game... :whistle:
-Ace
NPC Creation Guide - Latest Version
My Music Reels (mod-related and others)


Magical Unicorns - Because ponies are so last year.

theacefes: People probably look at our pictures and think "hmm one admin looks psychotic and the other looks like Captain Picard..."
grimsqueaker: TOGETHER THEY FIGHT CRIME