Jump to content


Photo

Code for mod NPCs


81 replies to this topic

#31 Miloch

Miloch

    Barbarian

  • Modders
  • 4715 posts
  • Gender:Male
  • Location:At Large

Posted 24 April 2010 - 09:35 AM

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.
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#32 berelinde

berelinde

    The Typo Queen

  • Gibberlings
  • 8594 posts
  • Location:New Jersey, USA

Posted 24 April 2010 - 09:53 AM

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.
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#33 Miloch

Miloch

    Barbarian

  • Modders
  • 4715 posts
  • Gender:Male
  • Location:At Large

Posted 24 April 2010 - 10:04 AM

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 :).
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#34 berelinde

berelinde

    The Typo Queen

  • Gibberlings
  • 8594 posts
  • Location:New Jersey, USA

Posted 24 April 2010 - 10:10 AM

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.
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#35 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Members
  • 3632 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 25 April 2010 - 05:52 AM

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, 25 April 2010 - 05:54 AM.

Yes... I am probably still editing the post above.
FAQ for the Megamods. Frequently Answered Questions.

#36 Miloch

Miloch

    Barbarian

  • Modders
  • 4715 posts
  • Gender:Male
  • Location:At Large

Posted 25 April 2010 - 07:58 AM

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.
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#37 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Members
  • 3632 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 25 April 2010 - 08:33 AM

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, 25 April 2010 - 08:36 AM.

Yes... I am probably still editing the post above.
FAQ for the Megamods. Frequently Answered Questions.

#38 Miloch

Miloch

    Barbarian

  • Modders
  • 4715 posts
  • Gender:Male
  • Location:At Large

Posted 25 April 2010 - 01:51 PM

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).
Mod Contributions
Aurora (new release!) * BG1 NPC * Gnomes * Haiass * Level 1 NPCs * Lost Items * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * In Progress: Adjusted Portraits * DSotSC (Tutu)
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * PSPad Highlighters * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Wherefore do ye toil; is it not that ye may live and be happy? And if ye toil only that ye may toil more,
when shall happiness find you?" -H.P. Lovecraft, The Quest of Iranon

#39 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Members
  • 3632 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 25 April 2010 - 04:02 PM

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, 26 April 2010 - 02:36 AM.

Yes... I am probably still editing the post above.
FAQ for the Megamods. Frequently Answered Questions.

#40 berelinde

berelinde

    The Typo Queen

  • Gibberlings
  • 8594 posts
  • Location:New Jersey, USA

Posted 25 April 2010 - 04:29 PM

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.
Must. Write. Faster.

cmorgan: "None of us get old around here, just more proficient at doing more stuff with less braincells!"

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum

#41 Guest_Guest_Sam_*_*

Guest_Guest_Sam_*_*
  • Guests

Posted 19 August 2010 - 11:11 AM

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.

#42 Jarno Mikkola

Jarno Mikkola

    The Imp

  • Members
  • 3632 posts
  • Gender:Male
  • Location:The town where the dead haven't keeled over, yet. In Finland.

Posted 19 August 2010 - 11:46 AM

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, 19 August 2010 - 11:55 AM.

Yes... I am probably still editing the post above.
FAQ for the Megamods. Frequently Answered Questions.

#43 Kulyok

Kulyok
  • Members
  • 5549 posts
  • Gender:Female
  • Location:Moscow, Russia

Posted 19 August 2010 - 09:27 PM

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.

#44 Guest_Guest_Sam_*_*

Guest_Guest_Sam_*_*
  • Guests

Posted 20 August 2010 - 04:39 AM

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.

#45 Mike1072

Mike1072
  • Gibberlings
  • 1720 posts
  • Gender:Male
  • Location:Canada

Posted 20 August 2010 - 04:53 AM

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.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users