Jump to content


Photo

Help with first mod ideas


  • Please log in to reply
40 replies to this topic

#1 Alonso

Alonso
  • Member
  • 35 posts

Posted 10 May 2019 - 10:28 PM

I have an awful lot of mod ideas. I have published the list here. As I say in that thread, many of them are not very suitable for a complete beginner, so I would like to start with one of the easiest ones. From the conversation in that thread it looks like some easy ones are:

 

- Combat log: Say when a character uses a wand or some other magical item.

- Fix Zone of Sweet Air.

- Improve the descriptions of some spells.

 

Looks like the last one would be the easiest one, I imagine it's just changing a piece of text.


Edited by Alonso, 10 May 2019 - 10:29 PM.


#2 jastey

jastey
  • Administrator
  • 3218 posts

Posted 11 May 2019 - 12:01 AM

I'm not much help with the first two.

 

For the improving spell descriptions, there would be two way of doing it.

 

First is to replace the string in the dialogue.tlk with something else. This is usually frowned upon (REPLACE in general is, as it is quite destructive compatibility-wise).

 

Second would be to patch the existing spell with a different description, which seems the way to go.

 

If I search for Blur spels I see SPIN943.spl which doesn't have a description (so it's probably used silently.) Then there is SPWI201.spl, and there is the scroll SCRL85.itm. EDIT: Oh, for BGII:EE there is also SPDM102.spl which I didn't consider in my example below yet.

As far as I can see, spells do not have a description for "identified". Scrolls do not have a general description but only for "identified".

 

So, the actual patching in the tp2-file should look something like this:

 

COPY_EXISTING ~SPWI201.spl~ ~override~

SAY UNIDENTIFIED_DESC ~Your new description goes here~

 

COPY_EXISTING ~SCRL85.itm~ ~override~

SAY DESC ~Your new description goes here~


Edited by jastey, 11 May 2019 - 12:03 AM.


#3 Alonso

Alonso
  • Member
  • 35 posts

Posted 13 May 2019 - 03:28 PM

Thanks, that looks promising. So what would be the full contents of the tp2 file?



#4 jastey

jastey
  • Administrator
  • 3218 posts

Posted 13 May 2019 - 08:51 PM

Something like this:
BACKUP ~AlonsosMod/backup~  //place to put the backup files to
AUTHOR ~[your email address or other means to reach you in case the install fails]~ 

VERSION ~1~ //version displayed in the weidu.log

README ~%MOD_FOLDER%/documentation/readme.alonso.%LANGUAGE%.txt~ ~%MOD_FOLDER%/documentation/readme.alonso.english.txt~

AUTO_TRA ~%MOD_FOLDER%/tra/%s~ //%MOD_FOLDER% is what is defined above for backup, "%s" is for the languages folders (if present)

ALWAYS

/* conversion into the correct text format of the tra-files. Needs iconv.exe (only if you have tra-files)
  ACTION_DEFINE_ARRAY fl#noconvert BEGIN setup END
  ACTION_DEFINE_ARRAY fl#reload BEGIN game END

  LAF HANDLE_CHARSETS
    INT_VAR
      infer_charsets = 1
    STR_VAR
      tra_path = EVAL ~%MOD_FOLDER%/tra~
      noconvert_array = fl#noconvert
      reload_array = fl#reload
      default_language = english
  END

END //ALWAYS

LANGUAGE ~English~
         ~english~
         ~%MOD_FOLDER%/tra/english/game.tra~ //file with texts for the ingame content in the setup.tp2
         ~%MOD_FOLDER%/tra/english/setup.tra~ //file with texts for the install process only

BEGIN ~Alonso's First Mod~

COPY_EXISTING ~SPWI201.spl~ ~override~

SAY UNIDENTIFIED_DESC ~Your new description goes here~

 

COPY_EXISTING ~SCRL85.itm~ ~override~

SAY DESC ~Your new description goes here~




#5 jastey

jastey
  • Administrator
  • 3218 posts

Posted 13 May 2019 - 09:34 PM

OK, for the first mod and little experience, make it this:
Keep in mind that text formatting for EE is utf-8 without BOM, but the d- and baf-files are usually in ANSI. So you can write English without symbols, but if you use any other letters than Latin, you need to put the text lines into tra-files and transform them upon installation.

BACKUP ~AlonsosMod/backup~  //place to put the backup files to
AUTHOR ~[your email address or other means to reach you in case the install fails]~ 

VERSION ~1~ //version displayed in the weidu.log

BEGIN ~Alonso's First Mod~

COPY_EXISTING ~SPWI201.spl~ ~override~

SAY UNIDENTIFIED_DESC ~Your new description goes here~

 

COPY_EXISTING ~SCRL85.itm~ ~override~

SAY DESC ~Your new description goes here~

Edited by jastey, 13 May 2019 - 09:35 PM.


#6 Alonso

Alonso
  • Member
  • 35 posts

Posted 14 May 2019 - 04:10 PM

Yeeeeha! I have created my first mod! I'm the best! :D

 

At least in my computer it works. Would you like to check if it also works in yours?

Attached Files



#7 jastey

jastey
  • Administrator
  • 3218 posts

Posted 14 May 2019 - 08:18 PM

It does!

One note: you are patching the existing files of the game, so you don't have to provide them in your mod.



#8 Alonso

Alonso
  • Member
  • 35 posts

Posted 15 May 2019 - 05:17 PM

Will remove them.

 

Now that we've made it work, I'm wondering if we can make it a bit more handy. I want to do the same for many spells, and that can make the tp2 file grow a lot and become quite cumbersome. I'm wondering if we can store the improved descriptions in an external file and use references to that external file in the tp2. That would make the mod much easier to handle. Is it possible to do something like that?



#9 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 15 May 2019 - 07:40 PM

I want to do the same for many spells, and that can make the tp2 file grow a lot and become quite cumbersome. I'm wondering if we can store the improved descriptions in an external file and use references to that external file in the tp2. That would make the mod much easier to handle. Is it possible to do something like that?
That can be done. Enter the .tra -file, short for translation file, yes, very unique, there's no one alike.
The .tp2 file can store the entire ~text~ as @number ... @1 is then the first string and so forth.

Like so:
The .tp2:
BACKUP ~AlonsosMod/backup~ //place to put the backup files to 
AUTHOR ~[your email address or other means to reach you in case the install fails]~ 
VERSION ~1~ //version displayed in the weidu.log 
LANGUAGE ~English~ ~English~ ~AlonsosMod/Languages/English/setup.tra~

BEGIN @1
COPY_EXISTING ~SPWI201.spl~ ~override~
SAY UNIDENTIFIED_DESC @2

COPY_EXISTING ~SCRL85.itm~ ~override~
SAY DESC @3

...
While the setup.tra -file, in the AlonsosMod/Languages/English/ -folder contains:
@1 = ~Alonso's First Mod~
@2 = ~Your first spells description goes here~
@3 = ~Your second spells description goes here~
...
The .tra -file needs to be "coded" in the Latin code language(1252) characterset, because the EE games use that as English in the game, you can find this in Notepad++ for example. This is easier in the non-ee games as you don't need to care about codepages there... and you can write with Cyrillic if you want.

This is from a mod of mine, made for non EE games. So it doesn't contain everything required exactly to fully use in every scenario ... there are fuller examples in mods .tp2 files, you can go look at, that use .tpa file to convert characters etc.

Edited by The Imp, 15 May 2019 - 07:49 PM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#10 Alonso

Alonso
  • Member
  • 35 posts

Posted 16 May 2019 - 11:30 PM

I tried that, but I didn't manage to make it work. When I try to install, WeiDU says Install Component [UNDEFINED STRING:   @1]? I upload the updated version in case you want to have a look.

 

And, anticipating my next move even before the current one is completed: Is it possible to use more descriptive names for the string references in setup.tra? I'm thinking about something like @blur_description instead of @2.



#11 jastey

jastey
  • Administrator
  • 3218 posts

Posted 17 May 2019 - 08:28 AM

For the strings to show during install, you need to load the tra. The following needs to be in your tp2 header, above the "BEGIN ~modname~" (you also need to put the setup.tra into a folder "english" inside a folder"tra"):

LANGUAGE ~English~
         ~english~
         ~%MOD_FOLDER%/tra/english/setup.tra~ 

And no, the tra always have string numbers @0 @1 etc.



#12 Alonso

Alonso
  • Member
  • 35 posts

Posted 17 May 2019 - 10:39 AM

I tried that, but I still have the same problem. Anything else I might be missing? I attach the updated mod.

Attached Files



#13 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 17 May 2019 - 10:53 AM

Any chance you are on non-Windows Operation System ? This is cause the others don't accept capital and non-capital letters as the same ... without reducing them to not actually contain any.
And why the F do you jastey tell people to use %MOD_FOLDER% ... as "AlonsosMod" without the quotesd does quitewell. And I already said all this.

Edited by The Imp, 17 May 2019 - 10:55 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#14 jastey

jastey
  • Administrator
  • 3218 posts

Posted 17 May 2019 - 11:07 AM

Alonso: You called the folder "Languages", not "tra". Either rename the folder, or use the path "~%MOD_FOLDER%/Languages/english/setup.tra~

 

Imp: Don't swearword at me. I used %MOD_FOLDER% because it was easiest for example, and reduces copy&paste errors.



#15 Alonso

Alonso
  • Member
  • 35 posts

Posted 17 May 2019 - 04:55 PM

Thank you, jastey, don't know how that mistake crept in.

 

For the spell Protection from evil, 10’ radius I want to change the name of the spell, because it's actually a 15' radius. Will changing the name have any negative impact in the rest of the game? If not, what is the field name for the spell name?



#16 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5148 posts

Posted 17 May 2019 - 05:37 PM

...? If not, what is the field name for the spell name?

No. The spell names are just string references ... aka the file has a number assigned to a hex value.

 

The answer to the second question:
name1

If you want to verify that... use this link and scroll a few lines above.

 

I didn't see the mistake either, so...


Edited by The Imp, 17 May 2019 - 05:40 PM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#17 jastey

jastey
  • Administrator
  • 3218 posts

Posted 17 May 2019 - 09:41 PM

Changing the name is done by

COPY_EXISTING ~xxxx.spl~ ~override~
  SAY NAME1 ~blabla~

 

And you can just add it as another oine to the SAY UNIDENTIFIED_DESC patching.



#18 Alonso

Alonso
  • Member
  • 35 posts

Posted 18 May 2019 - 07:23 PM

Thank you, that worked. We're getting closer! :)

 

I have already edited thirteen spell descriptions, and I'm starting to realize that this is an awful lot of work. Eventually I'm gonna edit hundreds of descriptions, so I think it would save me a lot of time if I could export all those descriptions and their file names (SPIN943.spl and the like) to a big text file and work directly with that text file, instead of having to find and copy the spell descriptions and their file names one by one in NearInfinity. I have tried a couple of ideas in this sense, but none has helped:

 

- I tried the Mass export tool in NearInfinity, but it just exports a few thousand spl files in binary format. I guess the references to the dialog.tlk strings must be there somewhere, but I don't know how to find them (or even if they would be useful if I did).

 

- I had a look at the dialog.tlk file, and yes, the spell descriptions are there in plain text, which is nice. They are tangled in funny ways with other strings, but that shouldn't be a problem, I can untangle them. The problem is that I don't have a mapping of these descriptions to their file names (like SPIN943.spl), and without that mapping the descriptions are useless to me. I could still edit the dialog.tlk file directly, but you told me at the beginning of this thread that doing so is "frowned upon" because it is "destructive compatibility-wise", so that's a no-no.

 

So I'm wondering if there might be any way of exporting the text of the spell descriptions linked to their file names.


Edited by Alonso, 18 May 2019 - 07:24 PM.


#19 Gwendolyne

Gwendolyne
  • Administrator
  • 1016 posts

Posted 19 May 2019 - 08:11 AM

Many years ago, I wrote a WeiDU routine to fix the items description French translation (it extracted them and wrote them in a tra file for translators use). Let me a couple hours to dig it up from my external HD and you could adapt it to spells.


CARPE DIEM ....
 

In progress : Menace sur le Royaume de Diamant Éternel there.


#20 Alonso

Alonso
  • Member
  • 35 posts

Posted 19 May 2019 - 08:13 AM

That sounds great, Gwendolyne. Take your time.