Jump to content
Kulyok

Code for mod NPCs

Recommended Posts

if you've already done the work, why not just combine everybody's stuff, test it, and present it as a gift to the mod maintainer?
Well like I said, I haven't done all the work. I did most of the earlier NPCs but not the DSotSC, Bonehill or CA ones. Though it appears I did add them to code structures such as fj_join_dlg_xp. So it's mainly a matter of coding the NPC components at the end. If you're bored and want to code those, be my guest :). I'm being summoned to the beach anyway, so it's not something I'm gonna get done today even if I put it next on my project list.

Share this post


Link to post

I wasn't even thinking about the big mods, TBH. Something is better than nothing, which is what is currently included in the mod. Maybe one of these days if somebody has the time, sure, but I don't know if it's a good idea waiting for time and inspiration to coincide. I'd go with what you've already got and if someone has time to worry about SDotSC, Bonehill, and CA another time, that can be added later.

Share this post


Link to post

Well I'll probably have to do DSotSC at least, since I'm the only one with the current Tutu sourcecode (something else I should do something about I suppose). But I think Jarno should code the CA and BH NPCs, since he suggested it :).

Share this post


Link to post

Well, I'm willing to help out with the packaging, etc., but anything that's included must be tested. I cannot test BH or CA, or DSotSC, etc., so somebody else is going to have to test that.

Share this post


Link to post
I cannot test BH or CA, or DSotSC, etc., so somebody else is going to have to test that.
I can easily do the CA testings...

 

I added the code for most "approved" mod NPCs locally, including Gavin etc. but I don't think I got through all the CA NPCs. Think I changed the pdialog.2da check to something better also, but all that was with a previous version
Hmm, I would like to see the solution... cause if it's some exact requirement stuff, it might change between the CA's versions... although, as the WeiDU already has the .are identifier which makes the game_is(x) -function flag CA, it could work well... :) ... so it might be best to use in this, never the less, I have to see the solution, as I coded up a version that had 1 CA NPC working... but then again I broke the whole other parts of the mod to do it. :laugh::):(

 

So if anyone have a semi-working improvement(to include the CA's npc's), I will certainly like to try it, and I'll then be able to provide you some help even in the rest of the coding... the NPC variables for CA's NPCs etc minor stuff.

Edited by Jarno Mikkola

Share this post


Link to post
as the WeiDU already has the .are identifier which makes the game_is(x) -function flag CA, it could work well...
I coded such a check already even before I requested the GAME_IS WeiDU addition for CA, so that should work the same. But I did notice that some of the variables you provided can't possible be right. TCAESDALE and TCALEIGHA for example, are 9 characters whereas the maximum is 8 in the game engine. I suspect cutting off the last character would produce the valid names, but I'll double check in CA unless you want to save me the trouble.

Share this post


Link to post
I coded such a check already even before I requested the GAME_IS WeiDU addition for CA, so that should work the same. But I did notice that some of the variables you provided can't possible be right. TCAESDALE and TCALEIGHA for example, are 9 characters whereas the maximum is 8 in the game engine. I suspect cutting off the last character would produce the valid names, but I'll double check in CA unless you want to save me the trouble.
Well, those variables can have 9 letters as the pdialog.2da is a text file from where the variables are taken, as the variable is not a file itself within the game.
...
REQUIRE_PREDICATE (FILE_CONTAINS ~override/pdialog.2da~ ~SUFINCH~)
...

You can use the pdialog.2da variable as a predicate for the component...

Edited by Jarno Mikkola

Share this post


Link to post
Well, those variables can have 9 letters as the pdialog.2da is a text file from where the variables are taken, as the variable is not a file itself within the game.
Huh, they're death/scripting variables? For some reason I thought they were dialogue files, though as I've said before, I'm not a dialogue whiz. In that case then they could be 32 characters instead of 8, yes. But then I also recoded it not to use the pdialog values due to errors with it being biffed, so I'll have to double-check the .dlg or .cre names anyway (which can only be 8 characters max).

Share this post


Link to post
Well, those variables can have 9 letters as the pdialog.2da is a text file from where the variables are taken, as the variable is not a file itself within the game.
Huh, they're death/scripting variables? For some reason I thought they were dialogue files, though as I've said before, I'm not a dialogue whiz. In that case then they could be 32 characters instead of 8, yes. But then I also recoded it not to use the pdialog values due to errors with it being biffed, so I'll have to double-check the .dlg or .cre names anyway (which can only be 8 characters max).
I don't exactly even know what they are, but the death variable sounds right... see, if you open the pdialog.2da in the normal game(with Near Infinity), you can see a lot what's what in the npc dialogs, and you can see that there is "HAERDALIS" in the first row or column, or whatever you call it, which is more than 8 letters, so there... and the CA doesn't have any of the normal identifiers there, cause the NPCs have been replaced.... plah plah... this would take hours to complete, si O dno't. :) Edited by Jarno Mikkola

Share this post


Link to post

I checked for the J file. There will always be one, it will always be in pdialog.2da, and it will always be 8 characters or less.

Share this post


Link to post
Guest Guest_Sam_*

Does this mean that mod NPCs like Soulafain can be edited with L1NPC, or will the feature be included in a future release? The last FAQ seems to be about 3 years old so I thought I'd ask.

Share this post


Link to post
Does this mean that mod NPCs like Soulafain can be edited with L1NPC, or will the feature be included in a future release? The last FAQ seems to be about 3 years old so I thought I'd ask.
In a way, you just need to remove the /* */ 's from this in the .tp2 code, and put a random number on the designated spot:
////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
//																	\\
//   Solaufein	Solaufein	Solaufein	Solaufein	Solaufein	\\
//																	\\
//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\//////\\\\\\
////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\////\\\\

/*
BEGIN
DESIGNATED
REQUIRE_COMPONENT ~level1npcs.tp2~ "0"  @110600
REQUIRE_COMPONENT ~Setup-Solaufein.tp2~ "0" ~~

LAUNCH_ACTION_MACRO ~fj_install_component_variables~
COPY_EXISTING ~sola5.cre~   ~override~
		  ~sola7.cre~   ~override~
		  ~sola10.cre~  ~override~
		  ~sola12.cre~  ~override~
		  ~sola15.cre~  ~override~
		  ~sola17.cre~  ~override~
 PATCH_IF (SOURCE_SIZE > 0x2d3) THEN BEGIN
LAUNCH_PATCH_MACRO ~fj_modify_cre~
 END
BUT_ONLY
*/

Easy? I would say so! PS, the Solaufein, Keto, Valen, Finch and Kelsey are already in the .tp2 file, but like the above, quoted out, so you cannot use them without editing the .tp2 file.

But most of the other mod characters that are not actually already included in the current setup-Level1npcs.tp2 will probably be in the future, and they will then be also able to be used without editing the .tp2 file...

Edited by Jarno Mikkola

Share this post


Link to post

By the way, who's supporting Level1NPC now? Maybe someone could just add the code to the .tp2? You've got permissions, and you've got the code and filenames in this very thread, after all.

Share this post


Link to post
Guest Guest_Sam_*

Comparing the code to the regular NPC's code in the tp2 file seems to indicate that I'd need to fill in numbers after the "BEGIN @" and "DESIGNATED" lines. Can both be random? Or is there some special requirement for the "BEGIN @"? I'm a total programming noob.

Share this post


Link to post
Comparing the code to the regular NPC's code in the tp2 file seems to indicate that I'd need to fill in numbers after the "BEGIN @" and "DESIGNATED" lines. Can both be random? Or is there some special requirement for the "BEGIN @"? I'm a total programming noob.

After BEGIN goes the name of the component. This can be a string like ~Solaufein~, or a .tra reference like @123 that can be translated into other languages.

Share this post


Link to post
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×