Jump to content


Photo

Various mod development questions of a first-timer


  • Please log in to reply
6 replies to this topic

#1 sufflaminandus

sufflaminandus
  • Member
  • 4 posts

Posted 12 February 2019 - 11:37 PM

Hello. For quite some time now I've been working on my NPC mode codenamed 'Ray'. It's my first time affair but I managed to grasp the concepts of writing dialogs with WeiDO and basic scripting. But when I started creating creatures for the quests I encountered a few problems that moved me to create this topic.

It is not only about the questions I will list below. I earnestly try to implement my mode in proper way and to achieve that I try to clearly understand my actions: what every line of code does, why is it needed here; what every field in various IE structures does. So, actually, I got lots question, even about well documented WeiDO. I managed to resolve some of them on my own, some I just skipped, but, still, it's a long road ahead and I can't (neither want to) avoid asking for help. So I hope that this topic could be my 'advice board'. Thanks!  (But, of course, I'm going to do my own research first, before troubling others.)

Anyway, currently I can't deal with following matters:

 

1. What is your favorite approach in creating creatures (specifically people)? Currently I see two ways: blank (or template) creature that you fully customize yourself, or copying the most similar to yours with modification of differing fields. I think the  second one is quicker and safer for newbie as me but the problem is that not all kits can be found in the game (I don't recall any skalds in BG2).

 

2. How do ability modifiers get applied and how are they displayed in the NI. Specifically:

a) Is strength bonus applied in NI (THAC0 field) or does it work as some runtime effect in the game? Example: fighter level 7 has THAC0 14; if I want to create level 7 fighter with strength 17 (+1 to hit), do I set THACO 14 or 13 in NI?

b) Same question for dexterity, specifically: what is natural and effective AC and what do I write in NI for character with dex 18, 6 AC or 10 AC (and in what field)?

c) Same for constitution. Through new game I created kensai with 16 CON. At level 12 he has 117 hp. When I convert save game to CRE, NI shows 99 hp. Which is actually bewildering because CON bonus should be 2 * 12 = 24...

 

3. Effects (or are they known as opcodes in IE modding community?). It's a whole separate topic because I'm completely clueless in this area and can't even formulate exact questions.  I think my condition can be improved by basic explanation of effect system. So in this paragraph I just ask: is there are some tutorial about effects?

But, actually, I do have some vague effect questions:

 

4. I created kensai lvl 12 and converted it to created to .CRE. When I open it I see a whole bunch of effects that (as I understand) emulate kit bonuses: x4 increase THAC0 (278), x4 increase damage(73), x4 increase speed factor(190). But there are some very confusing moments:

a) Why each THAC0 and damage effect increases corresponding stat by 1 ('value' field) but speed factor increases incrementally 1,2,3,4 ('amount' field)?

b) It's logical to assume that only last of the speed factor effect gets applied, but how is it implemented? As plausible explanation I discovered that only last of the effects has coordinates set to valid values but then why all of the THAC0 and damage effects works properly? I mean that both THAC0 and damage effect has coordinates set only in the last effect too so, consequently, I would expect to see +1 bonus in game and not + 4.

c) Some questions about "Target" field in effect structure. Specifically: when should I use "None (0)", why "Preset target (2)" is used for above effects and not "Self (1)" and what is "Self (1)" then.

d) Why MODIFYPROFICIENCY is "None (0)" and is it applied in runtime (its bonuses to THAC0, damage, etc)?

e) What is "Used internally" field?

 

5. Do I have to add all the memorization info (7 priest levels, 9 wizard, etc) even for non-casting creatures?

 

6. So in the end I need to create enemy kensai creature. Do I emulate kensai bonuses via effects or do I hardcode it into stats, if possible? Looking through game creatures I see that hardcoding is a go-for method but I still want to hear it from experienced people.

 

7. My Ray NPC is assassin so I based it upon Yoshimo creature file. When I studied yoshi10.cre I noticed that innate profession skills are not memorized but he still has them in the game. Why/How?


Edited by sufflaminandus, 12 February 2019 - 11:37 PM.


#2 Sergio

Sergio
  • Member
  • 954 posts

Posted 13 February 2019 - 12:15 AM

You'd better publish all these questions here: https://forums.beamd...ions-thread/p40

There are really talented people inside that topic that may help you.

 

Regards.


Low hung brow, dazed look on your face..... It appears that you are correct, my friend. You are indeed a complete imbecile.


#3 sufflaminandus

sufflaminandus
  • Member
  • 4 posts

Posted 13 February 2019 - 03:21 AM

You'd better publish all these questions here: https://forums.beamd...ions-thread/p40

There are really talented people inside that topic that may help you.

 

Regards.

Ok, I will publish them there too.


Edited by sufflaminandus, 13 February 2019 - 03:21 AM.


#4 Creepin

Creepin
  • Administrator
  • 1676 posts

Posted 13 February 2019 - 07:26 AM

Hello sufflaminandus! First of all, I'm long time player but only recently tried my hand in an actual mod creation, so some things are not known to me as well. Here is, however, what I know.
 

1. What is your favorite approach in creating creatures (specifically people)?

Whenever possible I'd create from nearest similar vanilla creature (or rather vanilla + BG2Fixpack). Specifically for people I'd advice to create a character ingame first, but you already know that.
 

2. How do ability modifiers get applied and how are they displayed in the NI.

NI shows base numbers before modifiers from characteristics are applied. That's 100% true for AC/Dex and for HP/Con. I was unable to come up with a simple enough test for THAC0 because I'm not sure how to check for base THAC0 ingame (whether the amount displayed in the character screen would be influenced by being a fighter with zero stars in unarmed), but I fully expect it would generally work in the same way.
Note though, that there's two fields for AC in cre file: to my tests only "effective AC" affect creature ingame, setting its base AC (counter-intuitive, I know).
 

3. Effects: is there are some tutorial about effects?

Sadly, no, I miss one dearly myself, especially in regard of targets/durations. For example I was unable so far to create an item with "while equipped" effect where the effect itself is provided through opcode 146 "cast spell". There's a trick to learn a bit on your own through observation: in NI open any effect, change the actual effect field to the effect you're interested in, and do a search for selected attribute. This will give you all instances where this effect were used, and you'll be able to learn what settings were set to attain this or that implementation of effect in question.
 

 
4. I created kensai lvl 12 and converted it to created to .CRE. When I open it I see a whole bunch of effects that (as I understand) emulate kit bonuses: x4 increase THAC0 (278), x4 increase damage(73), x4 increase speed factor(190). But there are some very confusing moments:
a) Why each THAC0 and damage effect increases corresponding stat by 1 ('value' field) but speed factor increases incrementally 1,2,3,4 ('amount' field)?
b) It's logical to assume that only last of the speed factor effect gets applied, but how is it implemented? As plausible explanation I discovered that only last of the effects has coordinates set to valid values but then why all of the THAC0 and damage effects works properly? I mean that both THAC0 and damage effect has coordinates set only in the last effect too so, consequently, I would expect to see +1 bonus in game and not + 4.
c) Some questions about "Target" field in effect structure. Specifically: when should I use "None (0)", why "Preset target (2)" is used for above effects and not "Self (1)" and what is "Self (1)" then.
d) Why MODIFYPROFICIENCY is "None (0)" and is it applied in runtime (its bonuses to THAC0, damage, etc)?
e) What is "Used internally" field?

a) & b) I've re-created kensai lvl12 chr -> cre, and for me amount in each case of opcode 190 set to 1. Also I only got 3 opcodes 190 which is correspondent with "for every 4 levels" description while you mention 4. Can it be that you did something wrong?
c) & d) I wish to knew that as well :whistling: Experiments and testing is your best friends to get the desired effect, and dissecting other mods can help, but fundamental knowledge of targeting and duration options of effects would be of huge help if anyone care to write an essay on that :) Modify Proficiency is permanent, but the impact of that permanent effect is indeed applied runtime per wspecial.2da.
e) Huh? Can you elaborate?
 

5. Do I have to add all the memorization info (7 priest levels, 9 wizard, etc) even for non-casting creatures?

Of course not, why would you?
 

6. So in the end I need to create enemy kensai creature. Do I emulate kensai bonuses via effects or do I hardcode it into stats, if possible? Looking through game creatures I see that hardcoding is a go-for method but I still want to hear it from experienced people.

You can go either way, really, but creating kensai ingame and then turning it to cre is simpler in that you won't have to count how much of which bonus is appropriate for given level: the game will do it for you. Just don't forget to remove any protagonist innate abilities in case you originally created him in singleplayer or the 1st slot of multiplayer.
 

7. My Ray NPC is assassin so I based it upon Yoshimo creature file. When I studied yoshi10.cre I noticed that innate profession skills are not memorized but he still has them in the game. Why/How?

Engine provides these ingame: notice how when you join Yoshimo the engine says "Yoshimo - Special Snare: Yoshimo". That's because before that, as a creature, he didn't have those, which is consistent with your observation. See here to learn which abilities are applied and how, and you'll know what you had to apply/recreate for your creature.Sorry I forgot you're making an NPC, not an enemy creature. You won't be needing that for an NPC, the game will sort it itself.


Edited by Creepin, 13 February 2019 - 10:01 AM.

The Old Gold - v0.2 WIP (mod for BGT/BWP/BWS)


#5 sufflaminandus

sufflaminandus
  • Member
  • 4 posts

Posted 13 February 2019 - 07:50 PM

Hi, Creepin and thank you very much for the answers.


I see now that, as you stated, experimenting and testing should be my primary tools in understanding the cogs of IE. I will do more thoroughly next time.
 

a) & b) I've re-created kensai lvl12 chr -> cre, and for me amount in each case of opcode 190 set to 1. Also I only got 3 opcodes 190 which is correspondent with "for every 4 levels" description while you mention 4. Can it be that you did something wrong?

I re-created kensai too and I still get the same effects. Now that you mentioned, it is indeed weird that there are four opcodes 190. Probably I indeed do something wrongly.

My process of creating this kensai is: new single player game -> set up character -> game starts -> level up through console ("Give XP: 1000000") -> export -> open character in NI -> export as .cre. I have BG2EE. I've installed fixpack but resulted creature is the same. Is there some fault in this chain? 

 

 

Of course not, why would you?

It's just every humanoid creature in the game has all memorization info set, even when they can't cast spells at all. Well, I guess, it is some side effect copy-paste during original development. 

 

 

Engine provides these ingame: notice how when you join Yoshimo the engine says "Yoshimo - Special Snare: Yoshimo". That's because before that, as a creature, he didn't have those, which is consistent with your observation. See here to learn which abilities are applied and how, and you'll know what you had to apply/recreate for your creature.Sorry I forgot you're making an NPC, not an enemy creature. You won't be needing that for an NPC, the game will sort it itself.

No no, the link is you provided is useful, as I'm dealing with non-party creatures right now.


Edited by sufflaminandus, 13 February 2019 - 07:51 PM.


#6 Creepin

Creepin
  • Administrator
  • 1676 posts

Posted 14 February 2019 - 12:43 AM

I re-created kensai too and I still get the same effects ... I have BG2EE.

No, you did everything exactly as I did. Well I must say I know nothing about EE so perhaps, improbable as it may be, EE changes opcode 190 from cumulative to non-cumulative. However, let's first look at all options. If you use the link I gave you you'll learn that abilities of kensai are governed by clabfi04.2da. In my case (classic engine) attack speed improvement (opcode 190) is applied via spcl143.spl, which is listed in said clabfi04.2da as being applied at levels 1, 4 and 8 (and level 13 further which makes the whole progression inconsistent but whatever), that's why lvl10 kensai should have 3 instances of opcode 190 applied, and since it's the same spell applied 3 times it just can't have different numbers set to "amount" field. Does that implemented in the same way so far for EE?

 

It's just every humanoid creature in the game has all memorization info set, even when they can't cast spells at all. Well, I guess, it is some side effect copy-paste during original development.

Most probably. Still, what kjeron said - for EE he has 1st hand knowledge (for classic too, I reckon, but he mainly answers with EE in mind), so if he say add memorisation you add memorisation ;) Or just don't bother and "cheat" with ReallyForceSpellRES("spcl144",Myself) :whistling:


Edited by Creepin, 14 February 2019 - 01:01 AM.

The Old Gold - v0.2 WIP (mod for BGT/BWP/BWS)


#7 sufflaminandus

sufflaminandus
  • Member
  • 4 posts

Posted 14 February 2019 - 08:03 PM

No, you did everything exactly as I did. Well I must say I know nothing about EE so perhaps, improbable as it may be, EE changes opcode 190 from cumulative to non-cumulative. However, let's first look at all options. If you use the link I gave you you'll learn that abilities of kensai are governed by clabfi04.2da. In my case (classic engine) attack speed improvement (opcode 190) is applied via spcl143.spl, which is listed in said clabfi04.2da as being applied at levels 1, 4 and 8 (and level 13 further which makes the whole progression inconsistent but whatever), that's why lvl10 kensai should have 3 instances of opcode 190 applied, and since it's the same spell applied 3 times it just can't have different numbers set to "amount" field. Does that implemented in the same way so far for EE?

Nope, in EE it is still spcl143.spl but opcode 190 definetely has become overriding as In EE spcl143.spl comprised of 190 opcodes for every 4th level and amount field is incremented for each consequent opcode (1:1, 4:2, 8:3, 12:4, 16:5...).

Well, it seems we found a small bug in speed factor progression for kensai in both engines. I mean the proper way should be to apply 190 should be: 4, 8, 12, 16....