Jump to content

Parse error prevents .tp2 installation


ericp07

Recommended Posts

Don't worry - you should have seen my first attempts. I swear, if there was something that i could have misunderstood, I managed to. It will work - what you are discovering is where you haven't learned the syntax yet. And it is quirky, because no matter how hard the bigg works to make it more refined, it is OCAML-based and apparently that means things are odd when it comes to making weidu do things. And on top of that, it has to be backwards-compatible all the way back to when Weimer first hacked it.

 

The good news is you are getting there! It will work, and you learn something about the way it works every time you get an error. I look at it as the ultimate do-it-yourself, unlimited reloads puzzle game :)

Link to comment
Hah! Now it (weidu) says my NPC's own .cre file is not a valid .cre file!

 

ERROR: [Meleryn/characters/EP#Mel.cre] -> [override] Patching Failed (COPY) (Failure("not a vaild CRE file"))
Stopping installation because of error.

You get that message if the first eight bytes (i.e. 8 bytes starting at offset 0) don't say e.g. "CRE V1.0"

 

Uh-oh...I may have found the problem (or one of them, anyway). Haven't even gotten this far to get another error yet, but I see that one of the ADD_CRE_ITEM lines references an item that, at that point in the install, hasn't been copied yet (said item being EP#DET2, her scimitar).

No, ADD_CRE_ITEM doesn't care about whether the item actually exists.

Link to comment
Don't worry - you should have seen my first attempts. I swear, if there was something that i could have misunderstood, I managed to. It will work - what you are discovering is where you haven't learned the syntax yet. And it is quirky, because no matter how hard the bigg works to make it more refined, it is OCAML-based and apparently that means things are odd when it comes to making weidu do things. And on top of that, it has to be backwards-compatible all the way back to when Weimer first hacked it.

 

The good news is you are getting there! It will work, and you learn something about the way it works every time you get an error. I look at it as the ultimate do-it-yourself, unlimited reloads puzzle game :)

 

Indeed, and I couldn't possibly have progressed this far without all the wonderful help! When I first set up the mod, it took the same kind of trial and error(s) to get the NPC to spawn, and more fumbling to get her to approach and talk to the party. Not being able to leave well enough alone, I later got the bright idea that this is a hunted person, so I had to bring the appropriate hunter creatures into the game and get them to hunt the NPC in a seemingly random manner. Then there was the issue of her custom scimitar, which itself took plenty of time on the anvil before testing properly in-game. Apparently needing to further complicate things, I then dreamed up some scenarios involving villains, and made sure that everything was thematic to the mod's concept. All the while, I've been reading on-line forum discussions about different approaches to certain kinds of dialogue, and customizing blocks of text into "real" NPC dialogue (but it isn't really dialogue at this point, as I've gotten as far as to have the NPC SAY a bunch of descriptive text, but haven't done much about giving PC or other NPC feedback yet).

 

Very tricky stuff, all right! I'm glad I'm packing as much into this mod as I am, for my first go, because of all I'll have learned by the time it gets tested and released. Hmmm, that reminds me that I'll need to issue a call for playtesters shortly after I can get the mod to install successfully again.

 

Thanks!

Eric

Link to comment

As expected, WeiDU chokes on my NPC's .cre file, so my mod still won't install :) How can the .cre not be a valid .cre file? I created it following the "How_To_Make_An_NPC_If_You_Are_A_N00B" guide. When I open the file in NI, all appears as it should, and I've never seen this particular error before (I've successfully installed the NPC in the past).

 

Once again, I find myself dead in the water.

Please help!

Thanks,

Eric

Link to comment
Can you post the code where you are copying the CRE, naming it, and giving it items? I've found that when I get an invalid CRE error, I've usually put something in the wrong order. It happens more than you'd think.

 

I suspect that's what's happening here. My past successes happened before I came up with the scimitar idea. Let's examine the following:

 

// Meleryn creature copying and naming
COPY ~Meleryn/characters/EP#Mel.cre~ ~override~
 ADD_CRE_ITEM ~leat02~ #0 #0 #0 ~IDENTIFIED~ ~ARMOR~ // Leather armor +1
 ADD_CRE_ITEM ~EP#MELAM~ #0 #0 #0 ~IDENTIFIED~ ~AMULET~ // Unicorn Pendant
 ADD_CRE_ITEM ~ax1h02~ #0 #0 #0 ~IDENTIFIED~ ~SHIELD~ // Battle axe +1
 ADD_CRE_ITEM ~EP#DET2~ #0 #0 #0 ~IDENTIFIED~ ~WEAPON1~ EQUIP // Dagnir en Tigin +2
 ADD_CRE_ITEM ~bow01~ #0 #0 #0 ~IDENTIFIED~ ~INV1~ // Composite long bow
 ADD_CRE_ITEM ~arow02~ #12 #0 #0 ~IDENTIFIED~ ~QUIVER1~ // Arrows +1
 ADD_CRE_ITEM ~arow05~ #7 #0 #0 ~IDENTIFIED~ ~QUIVER2~ // Arrows of Biting
 SAY NAME1 ~Meleryn Gwaithoron~
 SAY NAME2 ~Meleryn Gwaithoron~
 WRITE_SHORT 0x244 0 // doesn't change
 WRITE_BYTE  0x246 ~%EP#Needl%~ // the internal name of my kit, surrounded by %
 WRITE_BYTE  0x247 0x40 // doesn't change

 

This section concludes with the SAY BIO and all the audible responses that call .wav files. The NPC's .cre filename is all caps, but as you can see, it's not referenced that way here. Could it be as simple as that, or does something else here need changing?

 

Thanks!

Eric

Link to comment
The NPC's .cre filename is all caps, but as you can see, it's not referenced that way here. Could it be as simple as that, or does something else here need changing?
It doesn't matter on Windows, though it probably does on Mac/Linux (a good reason to lowercase everything in your files, folders and code).

 

I'd put the SAYs and WRITEs before functions like ADD_CRE_ITEM, though it shouldn't matter, in theory anyway. Incidentally, why are you adding stuff to your own CRE when you can do that directly in NI, or is NI being fussy with that too?

Link to comment
The NPC's .cre filename is all caps, but as you can see, it's not referenced that way here. Could it be as simple as that, or does something else here need changing?
It doesn't matter on Windows, though it probably does on Mac/Linux (a good reason to lowercase everything in your files, folders and code).

 

I'd put the SAYs and WRITEs before functions like ADD_CRE_ITEM, though it shouldn't matter, in theory anyway. Incidentally, why are you adding stuff to your own CRE when you can do that directly in NI, or is NI being fussy with that too?

 

I've discovered that case isn't an issue, thankfully, so that's one suspect eliminated.

 

NI will handle the gear with no problems, and that's how I had the .cre set up initially. At some point, I looked at another NPC mod's .tp2, and noticed that gear was assigned to the character the weidu way, rather than in the .cre itself, so I adopted that method. Now I see it might be to my advantage to switch back, and add all starting gear to the .cre with NI. I'll do it that way, and comment out those lines in the .tp2 till I'm satisfied with the results.

 

Thanks,

Eric

Link to comment

It was probably one of my mods that assigned gear in the tp2. I did it that way with BG1 Gavin because of cross-platform considerations. Later on, I kept doing it that way because I find it easier. If I wanted to change something, I only had to change the tp2, not change the CRE.

Link to comment
It was probably one of my mods that assigned gear in the tp2. I did it that way with BG1 Gavin because of cross-platform considerations. Later on, I kept doing it that way because I find it easier. If I wanted to change something, I only had to change the tp2, not change the CRE.

 

I did the same with Tyris. I really hate tinkering with the CRE files so I do as much as possible in the tp2 e.g., items and spells.

Link to comment
It was probably one of my mods that assigned gear in the tp2. I did it that way with BG1 Gavin because of cross-platform considerations. Later on, I kept doing it that way because I find it easier. If I wanted to change something, I only had to change the tp2, not change the CRE.

 

Indeed, berelinde, it was your Haldamir mod that gave me the idea. I didn't want to call you out on this issue :)

 

Fixed.

- E

Link to comment
Hah! Now it (weidu) says my NPC's own .cre file is not a valid .cre file!

 

ERROR: [Meleryn/characters/EP#Mel.cre] -> [override] Patching Failed (COPY) (Failure("not a vaild CRE file"))
Stopping installation because of error.

You get that message if the first eight bytes (i.e. 8 bytes starting at offset 0) don't say e.g. "CRE V1.0"

 

Uh-oh...I may have found the problem (or one of them, anyway). Haven't even gotten this far to get another error yet, but I see that one of the ADD_CRE_ITEM lines references an item that, at that point in the install, hasn't been copied yet (said item being EP#DET2, her scimitar).

No, ADD_CRE_ITEM doesn't care about whether the item actually exists.

 

The .cre file has Signature: CHR, Version: 2.0; Signature 2: CRE, Version2: 1.0.

 

- E

Link to comment

Naturally, adding items to the .CRE with NI results in a corrupted file, so I have to delete it and try again from another copy.

 

Strangely, when I clicked to add an item, NI displayed an Unknown line after the first four from the top, and added the item line right below that. I added each item, saved the file, quit and restarted NI. Then I told it to open the .cre, which resulted in an error reading the file.

 

So, I can't win with NI or with WeiDU. Still, I keep trying...

 

- E

Link to comment
The .cre file has Signature: CHR, Version: 2.0; Signature 2: CRE, Version2: 1.0.
Well, then it's a CHR (character) not a CRE (creature). You need to use NI's File > Convert CHR to CRE function. Make sure you turn off the "Export allowed" flag on the resulting file. I'm not crazy about building NPCs this way, as I think it's better to start with CRE files from the start, but maybe it'll work... just try not to corrupt it further.
Link to comment
The .cre file has Signature: CHR, Version: 2.0; Signature 2: CRE, Version2: 1.0.
Well, then it's a CHR (character) not a CRE (creature). You need to use NI's File > Convert CHR to CRE function. Make sure you turn off the "Export allowed" flag on the resulting file. I'm not crazy about building NPCs this way, as I think it's better to start with CRE files from the start, but maybe it'll work... just try not to corrupt it further.

 

That is exactly 100% the way I created the file in the first place. I wish there was a way to create a .cre without having to first create a .chr in the game, then convert it to a .cre.

 

I've found that changing the signature from CHR to CRE and the version from 2.0 to 1.0 also results in a corrupted file. Time to delete and build a new version in-game, then go from there. Wow.

 

- E

 

 

This stuff is doing my head in :)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...