Author Topic: Error reading null - wtf?  (Read 3411 times)

Offline Phobossus

  • Planewalker
  • *****
  • Posts: 34
Error reading null - wtf?
« on: February 27, 2009, 04:58:05 PM »
Hello,
Here I am with a new error to demonstrate =.=

This time I have finally managed to create a .d file that was successfully compiled into a .dlg
Even though there were some "parsing error" problems (and it was my first .d file ever made), after several tries I did it, so do not think that I'm asking for help having a first error encounter  ;)

Delighted and full of vigor I opened NI and associated the .DLG to my creature, then saved and launched BG II.
I CLUACONSOLED him in and talked to him. The beginning looked to work, so this:

BEGIN darkknight

IF ~NumTimesTalkedTo(0)
Global("DarkKnightSpeaks","GLOBAL",0)~ THEN BEGIN DK0
SAY ~Ha ha ha! To na niego czekaliśmy! To <CHARNAME>!~
IF ~~ THEN REPLY ~Upiorny rycerz! Szykuj się na śmierć!~ GOTO DK1
IF ~~ THEN REPLY ~Ja natomiast nie ukrywam zdumienia widząc UPIORNEGO RYCERZA, w siedzibie MOJEJ gildii. Powinieneś wiedzieć, że za każdym rogiem kryją się w cieniu utalentowani zabójcy, gotów na jedno moje skinienie usunąć WSZELKICH intruzów!~ GOTO DK2
IF ~~ THEN REPLY ~Eee .. co demon taki jak ty robi w mojej piwnicy?~ GOTO DK3
END


But after I choose any of those replies, the dialog is over and if I talk to him again, it says that he has nothing to tell me. I'll paste the DK1, DK2 and DK3 as well. If .d file has been compiled without any errors, I thought it would be alright.


IF ~~ THEN BEGIN DK1
SAY ~Nie wiem, czy Renal byłby zadowolony, gdyby dowiedział się, że zaatakowałeś swoich własnych ochroniarzy, których ci powierzył! A to dobre! No tak, nie przedstawiłem się, mój błąd. Nazywam się Asmon i pochodzę, cóż, na pewno nie z tego wymiaru. Przysłał mnie Renal Krwawy Skalp, ja i moi pobratyńcy mamy zostać twoimi osobistymi obrońcami.~
IF ~~ THEN GOTO DK4
END

IF ~~ THEN BEGIN DK2
SAY ~Ha! Potrzeba więcej niż kilku złodziejaszków, żeby powalić pozasferowca jak ja! Ciesz się <CHARNAME>, nie chciałbyś, żeby całe legiony demonów deptały ci po piętach! A niewielu mieszkańców otchłani ma ochotę na rozmowę ze śmiertelnikami, ja jestem wyjątkiem - i pewnie dlatego tu jestem, ha! A przy okazji..~
IF ~~ THEN GOTO DK1
END

IF ~~ THEN BEGIN DK3
SAY ~Zabija śmiertelników! Ha, ha! Hm, zapomniałem, przedstawiciele Twojej rasy rzadko kiedy rozumieją moje poczucie humoru. Wystarczy więc, jeśli powiem, że nazywam się Asmon i zostałem przysłany przez Renala Krwawego Skalpa, aby zająć stanowisko osobistego kapitana obronnego nowego szefa gildii, czyli ciebie.~
IF ~~ THEN GOTO DK4
END


Checking in NI, if I press "select" button (that is connected to the replies on the DLG view screen), it should show me the message that is an answer to the chosen reply, but obviously this is something you all know.

My problem is that instead of showing me this reply, an annoying error window appears.

http://img161.imageshack.us/img161/4455/null.png

And when I click ok, the background becomes all white. What am I supposed to do with that? This is probably the last thing preventing my dialog from working >_>

Thank you for any answers.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: Error reading null - wtf?
« Reply #1 on: February 27, 2009, 08:19:11 PM »
BEGIN darkknight

IF ~NumTimesTalkedTo(0) Global("DarkKnightSpeaks","GLOBAL",0)~ THEN BEGIN DK0
    SAY ~Ha ha ha! To na niego czekaliśmy! To <CHARNAME>!~
    IF ~~ THEN REPLY ~Upiorny rycerz! Szykuj się na śmierć!~ GOTO DK1
    IF ~~ THEN REPLY ~Ja natomiast nie ukrywam zdumienia widząc UPIORNEGO RYCERZA, w siedzibie MOJEJ gildii. Powinieneś wiedzieć, że za każdym rogiem kryją się w cieniu utalentowani zabójcy, gotów na jedno moje skinienie usunąć WSZELKICH intruzów!~ GOTO DK2
    IF ~~ THEN REPLY ~Eee .. co demon taki jak ty robi w mojej piwnicy?~ GOTO DK3
END


IF ~~ THEN BEGIN DK1
    SAY ~Nie wiem, czy Renal byłby zadowolony, gdyby dowiedział się, że zaatakowałeś swoich własnych ochroniarzy, których ci powierzył! A to dobre! No tak, nie przedstawiłem się, mój błąd. Nazywam się Asmon i pochodzę, cóż, na pewno nie z tego wymiaru. Przysłał mnie Renal Krwawy Skalp, ja i moi pobratyńcy mamy zostać twoimi osobistymi obrońcami.~
    IF ~~ THEN GOTO DK4
END

IF ~~ THEN BEGIN DK2
    SAY ~Ha! Potrzeba więcej niż kilku złodziejaszków, żeby powalić pozasferowca jak ja! Ciesz się <CHARNAME>, nie chciałbyś, żeby całe legiony demonów deptały ci po piętach! A niewielu mieszkańców otchłani ma ochotę na rozmowę ze śmiertelnikami, ja jestem wyjątkiem - i pewnie dlatego tu jestem, ha! A przy okazji..~
    IF ~~ THEN GOTO DK1
END

IF ~~ THEN BEGIN DK3
    SAY ~Zabija śmiertelników! Ha, ha! Hm, zapomniałem, przedstawiciele Twojej rasy rzadko kiedy rozumieją moje poczucie humoru. Wystarczy więc, jeśli powiem, że nazywam się Asmon i zostałem przysłany przez Renala Krwawego Skalpa, aby zająć stanowisko osobistego kapitana obronnego nowego szefa gildii, czyli ciebie.~
    IF ~~ THEN GOTO DK4
END

is a closed loop - and will only play once (the first time it is played) due to the <<only talked to once>> condition.

IF  <<only talked to once>> AND <<Global("DarkKnightSpeaks","GLOBAL",0)>> DK0
  CHOICE 1 GOTO DK1
  CHOICE 2 GOTO DK2
  CHOICE 3 GOTO DK3

[presumably DK4 has a way out, like

IF ~~ THEN EXIT

or

IF ~~ THEN DO ~SetGlobal("DarkKnightSpeaks","GLOBAL",1)~ EXIT ]

but weidu would probably catch that. The first thing to check is that you don't have a "null" character or such  accidentally embedded in your file. Open up the file in NotePad++, TextPAD, ConTEXT, TextEdit, WordWrangler, PSP, heck, even good old "notepad" and check and make sure your file doesn't have hidden characters. I have had both OpenOffice and MS Word/Works add things that makes stuff go crazy.




Offline devSin

  • Planewalker
  • *****
  • Posts: 1632
  • Gender: Male
Re: Error reading null - wtf?
« Reply #2 on: February 27, 2009, 08:59:54 PM »
Quote
but weidu would probably catch that. The first thing to check is that you don't have a "null" character or such  accidentally embedded in your file. Open up the file in NotePad++, TextPAD, ConTEXT, TextEdit, WordWrangler, PSP, heck, even good old "notepad" and check and make sure your file doesn't have hidden characters. I have had both OpenOffice and MS Word/Works add things that makes stuff go crazy.
The "null" in the warning is just an unrecoverable error of unspecificity (it's not actually telling you anything besides "Error").

It either could be in loading (fetching StrRefs or ResRefs is common when you open up editor windows for the first time) or a problem with the dialogue (unlikely, as NI would refuse to load a truly improper file). Taimon has more experience with the dialogue viewer, although the current code doesn't have much in common with 1.32 and earlier IIRC.

Offline Phobossus

  • Planewalker
  • *****
  • Posts: 34
Re: Error reading null - wtf?
« Reply #3 on: February 28, 2009, 02:34:32 AM »
Actually DK4 has no way out.

IF ~~ THEN BEGIN DK4
SAY ~Nie patrz tak na mnie, może demony w piwnicy to nie do końca szczyt twoich marzeń, ale pomyśl inaczej - kto ośmieli się tu wejść, widząc jak potężna jest twoja straż?~
IF ~~ THEN REPLY ~Właśnie nikt - i to mnie martwi~ GOTO DK5
IF ~~ THEN REPLY ~W zasadzie to czemu nie. Witaj na pokładzie i, eh, postaraj się nie straszyć gości, dobrze?~ GOTO DK5
IF ~~ THEN REPLY ~Szczerze mówiąc nie potrzebuję twojej ochrony. Najlepiej będzie, jak opuścisz to miejsce. I twoi mroczni przyjaciele również.~ GOTO DK6
END

The first DK that allows a PC to end the dialogue is DK7. So I guess it's nothing wrong here, in other case weidu would say it.

So if the null error is just an error and we can't know why it occurs, what shall I do? (And if there is something like "null character", please explain me what you mean by this)

Offline Taimon

  • Planewalker
  • *****
  • Posts: 328
Re: Error reading null - wtf?
« Reply #4 on: February 28, 2009, 03:25:47 AM »
Your dialog name is too long (> 8 chars).
Try darkkngt instead.

Offline Phobossus

  • Planewalker
  • *****
  • Posts: 34
Re: Error reading null - wtf?
« Reply #5 on: February 28, 2009, 03:39:32 AM »
That was it. Thank you very much, you're a person that always knows how to kelp me :) And thanks to cmorgan and devSin for trying to solve my problem.

Thought I'd never understand how to make dialogs, now I see that it's simple :)


Just one small question, if I want to set NumTimesTalkedTo > 0 , how shall it be?

Offline Phobossus

  • Planewalker
  • *****
  • Posts: 34
Re: Error reading null - wtf?
« Reply #6 on: February 28, 2009, 04:03:37 AM »
Nevermind got it, forgot about the SetGlobal thing.

Well, so gonna make a first mod. See you later :)

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: Error reading null - wtf?
« Reply #7 on: February 28, 2009, 10:20:58 AM »
Heh - the little things that get you! 8 chars for resources. Good eyes, man.

Offline Phobossus

  • Planewalker
  • *****
  • Posts: 34
Re: Error reading null - wtf?
« Reply #8 on: February 28, 2009, 03:07:34 PM »
I do not want to spam with another topic, I'll post then a new question in this one:

Now this is something I completely don't understand. I've gotten a headache due to this thing therefore I can no longer think about it.

Here are the 4 last states in DARKKNGT:
Code: [Select]
IF ~~ THEN BEGIN DK14
SAY ~Dobrze, że się rozumiemy. Od dnia dzisiejszego możesz się uważać, za najbezpieczniejszego złodzieja w okolicy! Ha, do zobaczenia, <CHARNAME>.~
IF ~~ THEN DO ~SetGlobal("DarkKnightSpeaks","GLOBAL",1)~ EXIT
END


IF ~Global("DarkKnightSpeaks","GLOBAL",1)~ THEN BEGIN DK15
SAY ~Witaj znowu, <CHARNAME>. W gildii nic się nie zmieniło, nie masz żadnych nowych gości, nikt też nie próbował cię zabić. Jest dość nudno, postaraj się o większą ilość wrogów bo zapomnę jak się walczy! No, ale póki co czuj się jak u siebie ... bo to w końcu twoja gildia.~
IF ~~ THEN EXIT
END

Below is the code that starts a new quest, if GLOBAL is 2 (for now I'm getting it using console). This part works, it causes Senion guy to say what he should - so it is SE0 (Senion.d is posted below DARKKNGT)

Code: [Select]
IF ~Global("DarkKnightSpeaks","GLOBAL",2)~ THEN BEGIN DK18
SAY ~<CHARNAME>! W samą porę, kilka minut temu schwytaliśmy groźnego maga. Wdarł się tu tylnym wejściem, na szczęście moje cienie natychmiast dały mi znać.~
IF ~~ THEN DO ~SetGlobal("DarkKnightSpeaks","GLOBAL",3)~ EXTERN ~Senion~ 0
END

However, when Senion says SE0 (~Żądam [...]~), it doesn't go to DK19 (that from below), but to ..
Code: [Select]
IF ~Global("DarkKnightSpeaks","GLOBAL",4)~ THEN BEGIN DK19
SAY ~Ha! Żałosne sztuczki ci nie pomogą, śmiertelniku! Chciałeś zaskoczyć <CHARNAME> i puścić w niego kilka ognistych kul, a potem zmyć się tymi samymi drzwiami, którymi się tu dostałeś! <CHARNAME>, co z nim zrobimy? Chętnie uśmierciłbym go na miejscu albo uczynił niewolnikiem!~
IF ~~ THEN DO ~SetGlobal("DarkKnightSpeaks","GLOBAL",5)~ EXTERN ~Senion~ 1
END

.. this one. I'm out of ideas what is causing that. Globals seem to be allright, both conditions and setting actions, so what's the hell wrong?
Code: [Select]
IF ~Global("DarkKnightSpeaks","GLOBAL",6)~ THEN BEGIN DK20
SAY ~Szefie! Czy nie widzisz, że ten człowiek przyszedł cię zabić? Czuć od niego smród nekromanty!~
IF ~~ THEN DO ~SetGlobal("DarkKnightSpeaks","GLOBAL",8)~ EXTERN ~Senion~ 6
END
DK20 leads to SE6, as it should be.

----

And here is the whole Senion.d

I'll analogically repeat what I typed above. So,

The state from below should lead to DK19, but it isn't - instead it goes to DK20.
Code: [Select]
BEGIN senion

IF ~Global("DarkKnightSpeaks","GLOBAL",3)~ THEN BEGIN SE0
SAY ~Żądam, żeby mnie natychmiast wypuszczono! Po prostu pomyliłem drzwi!~
IF ~~ THEN DO ~SetGlobal("DarkKnightSpeaks","GLOBAL",4)~ EXTERN ~DARKKNGT~ 19
END

This part doesn't show cause of those jumps, but if I get the global with console, it works.
Code: [Select]
IF ~Global("DarkKnightSpeaks","GLOBAL",5)~ THEN BEGIN SE1
SAY ~Ostrzegam, nie ścierpię dłużej takiej bezczelności! Jeżeli zaraz mnie nie wypuścisz, wezwę swoich towarzyszy!~
IF ~~ THEN REPLY ~Nie miej pretensji do Asmona. Schwytał cię, bo zakradłeś się do mojej gildii, na dodatek tylnimi drzwiami. Powiesz mi po co tu przyszedłeś?~ GOTO SE2
IF ~~ THEN REPLY ~Głupi czarodzieju, teraz jesteś moim niewolnikiem! Trzeba było myśleć zanim zadarłeś ze mną i z moimi ludźmi!~ GOTO SE3
IF ~~ THEN REPLY ~Wypuszczę cię, jeżeli mi zapłacisz. Myślę, że 10000 sztuk złota wystarczy, a to i tak niewielka cena za życie.~ GOTO SE4
IF ~~ THEN REPLY ~Lepiej nie zadzierać z niebezpiecznymi magami. Możesz iść, Senion. Nie radzę ci jednak tu wracać~ GOTO SE5
END

Works.
Code: [Select]
IF ~~ THEN BEGIN SE2
SAY ~Pomyliłem drzwi! A gdzie tak naprawdę chciałem dotrzeć nie powinno cię już obchodzić! Nie interesujesz mnie ani ty, ani twój irytujący upiorny rycerz! Wypusć mnie, a nigdy się już nie zobaczymy! Przetrzymaj mnie jeszcze chwilę, a wszyscy skończycie martwi!~
IF ~~ THEN REPLY ~Głupi czarodzieju, teraz jesteś moim niewolnikiem! Trzeba było myśleć zanim zadarłeś ze mną i z moimi ludźmi!~ GOTO SE3
IF ~~ THEN REPLY ~Wypuszczę cię, jeżeli mi zapłacisz. Myślę, że 10000 sztuk złota wystarczy, a to i tak niewielka cena za życie.~ GOTO SE4
IF ~~ THEN REPLY ~Lepiej nie zadzierać z niebezpiecznymi magami. Możesz iść, Senion. Nie radzę ci jednak tu wracać.~ GOTO SE5
END

Works.
Code: [Select]
IF ~~ THEN BEGIN SE3
SAY ~Pożałujesz chwili, w której wypowiedziałeś te słowa! Mina, Gabriel - do mnie! Zasadzka się nie udała, ale wciąż mamy szansę na bezpośrednie uderzenie!~
IF ~~ THEN DO ~ChangeEnemyAlly(Myself,EVILCUTOFF)
SetGlobal("SenionAttacks","GLOBAL",1)
Enemy()~ EXIT
END

Works.
Code: [Select]
IF ~~ THEN BEGIN SE4
SAY ~Żądasz ode mnie zapłaty? Głupi <PRO_RACE>, będziesz błagał, abym i ja jej zażądał w zamian za twój marny żywot! Mina, Gabriel - do mnie!~
IF ~~ THEN DO ~ChangeEnemyAlly(Myself,EVILCUTOFF)
SetGlobal("SenionAttacks","GLOBAL",1)
Enemy()~ EXIT
END

But, this one doesn't - it should go to DK20. Continuing the dialog, after this state game shuts down.
Code: [Select]
IF ~~ THEN BEGIN SE5
SAY ~Zapewniam cię, że po dzisiejszym dniu nie będę miał po co tu wracać.~
IF ~~ THEN DO ~SetGlobal("DarkKnightSpeaks","GLOBAL",6)~ EXTERN ~DARKKNGT~ 20
END

And that one works, so appears after DK20.
Code: [Select]
IF ~Global("DarkKnightSpeaks","GLOBAL",8)~ THEN BEGIN SE6
SAY ~To prawda, jestem nekromantą. Żałuję, że nie mogę skorzystać z dobroci twojego serca <CHARNAME>, ale wysłano mnie tu z konkretnym zadaniem. Mina, Gabriel! Możecie się ujawnić! Skończmy z nimi, a Slythe nas wynagrodzi!~
IF ~~ THEN DO ~ChangeEnemyAlly(Myself,EVILCUTOFF)
SetGlobal("SenionAttacks","GLOBAL",1)
Enemy()~ EXIT
END

As you see it is a bit complicated and I cannot find any solution myself - Globals look right, but in fact they aren't.

Offline GeN1e

  • Planewalker
  • *****
  • Posts: 267
  • Gender: Male
Re: Error reading null - wtf?
« Reply #9 on: February 28, 2009, 05:09:23 PM »
So, you get 20 instead of 19 and nothing instead of 20, with 20 being the last, is that correct? Looks being shifted by 1. Could darkkngt be missing one entry along the way from 0 to 20? Nothing better comes to mind.

PS IIRC you can use state's name (dk19) instead of it's number (19) when linking to another dialog, it will compile okay.

PPS Wait, is their dialog supposed to be uninterruptable, without cutscenes, aka clicking "continue"? If yes, as I assume it is, then you don't have to use globals at all, as "DarkKnightSpeaks" currently has no impact onto the dialog.

IF ~Global("DarkKnightSpeaks","GLOBAL",2)~ THEN BEGIN DK18
SAY ~<CHARNAME>! W samą porę, kilka minut temu schwytaliśmy groźnego maga. Wdarł się tu tylnym wejściem, na szczęście moje cienie natychmiast dały mi znać.~
IF ~~ THEN DO ~SetGlobal("DarkKnightSpeaks","GLOBAL",3)~ EXTERN ~Senion~ 0
END

Bold part is used when starting dialog, once it's active you should put conditions there:

IF ~~ THEN BEGIN DK18
SAY ~<CHARNAME>! W samą porę, kilka minut temu schwytaliśmy groźnego maga. Wdarł się tu tylnym wejściem, na szczęście moje cienie natychmiast dały mi znać.~
IF ~Global("DarkKnightSpeaks","GLOBAL",2)~ THEN DO ~SetGlobal("DarkKnightSpeaks","GLOBAL",3)~ EXTERN ~Senion~ 0
END
« Last Edit: February 28, 2009, 05:25:49 PM by GeN1e »

Offline Phobossus

  • Planewalker
  • *****
  • Posts: 34
Re: Error reading null - wtf?
« Reply #10 on: March 01, 2009, 04:35:59 AM »
Yes, there are no cutscenes.

Quote
PS IIRC you can use state's name (dk19) instead of it's number (19) when linking to another dialog, it will compile okay.

That's what I did at first - but weidu said that he couldn't find label or something, after I changed it to a number it worked and got compiled.


Well, it looks like I got caught on an easy thing. It's just as u said at the beginning - darkknght was missing one entry, there were from 0 to 15, then 17,18,19,20. That was actually also the thing that caused shutdown, cuz if 20 was 19 and Senion.d was supposed to find state 20 while it didn't excist, all he could do is crash.

Everything works now. I still have got so much to learn, but I guess I'd never find this out by myself. Thank you.

 

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)?: