On a completely unrelated topic, how does one get items' ground icons to glow? You know, they respond to Tab with an aquamarine outline for easy loot finding, but I can't seem to get my custom icons to do the same.
Not certain, but it is likely coded to using the 2nd color index of the bitmap when its exactly 0x00ffff(RRGGBB), just as normal transparency uses the 1st color index when its 0x00ff00. :
Would it be possible to create a class tree like structure where you can start off as only a handful of classes, but as you level up the classes you unlock others you can switch to? Something similar to the Final Fantasy Tactics classes for reference.
Probably possible, but it would likely require both starting as a Cleric/Mage (to initialize spell slots, even if its just superficial), and some UI modifications to impose updates to spell slots when changing class, as the game only updates them when you actually level-up, and there is no way to grant spell slots if you don't already have access to a given spell level. I've looked into this for the purpose of a 3E multiclass system - it is feasible, but would be a lot of work to implement.
About the ground icon glow - possibly what you said, in practice it's a particular shade of turquoise. Copy that exactly and it glows. But if I can use different colors, I guess I could make my custom treasures show in a gold outline...
And another thing. For the life of me I can't seem to get my custom item to have more than ONE charge. It disappears afterwards. I can set the number of charges to 100 and from there to eternity, I can copy a perfectly working Fireball ability from the Wand of Fire, where it's 50, still just one charge. I've ran into this kind of crap before with items, what gives?
And another thing. For the life of me I can't seem to get my custom item to have more than ONE charge. It disappears afterwards. I can set the number of charges to 100 and from there to eternity, I can copy a perfectly working Fireball ability from the Wand of Fire, where it's 50, still just one charge. I've ran into this kind of crap before with items, what gives?
Items have 1 charge by default, the fields in the ITM file only set maximum stack/charge count not current. Current stack/charge count is set within the CRE/STO/ARE file that possesses the item.
Oh, this is giving me a heart attack. What the F... I mean, Christ. Yes, you're right. That's how I needed to do it. Thanks. This is the dumbest... why can't I just type in an item with all of its charges???
Items have 1 charge by default, the fields in the ITM file only set maximum stack/charge count not current. Current stack/charge count is set within the CRE/STO/ARE file that possesses the item.
But what if the item is in none of those places? What if it's to be created from a script and then added to a container? There is this action: AddStoreItem(S:Store*,S:Item*,I:Count*,I:Flags*), but that doesn't let you set the number of charges, does it?
But what if the item is in none of those places? What if it's to be created from a script and then added to a container? There is this action: AddStoreItem(S:Store*,S:Item*,I:Count*,I:Flags*), but that doesn't let you set the number of charges, does it?
Count and charge are stored in the same fields. It should set the # charges for the first ability, but if it has multiple abilities that need charge counts you may be out of luck.
No, just one. It worked. With several I would have had to create a separate STO not accessible from anywhere, use Weidu to create the item there and then the move-between-containers action in-game to port that item to an accessible STO.
By the way, this occurs to me as a way to make sure an item that doesn't exist anywhere but only gets created is unique. Also this should work for randomly generated loot. I'm making some new treasure and a few of the items, like a rare marble bust, are to be one-time finds. Well, if I put them in separate containers, the move action can happen any number of times, nothing will happen after the first roll, because the container will be empty then.
Would it be possible to create a class tree like structure where you can start off as only a handful of classes, but as you level up the classes you unlock others you can switch to? Something similar to the Final Fantasy Tactics classes for reference.
Probably possible, but it would likely require both starting as a Cleric/Mage (to initialize spell slots, even if its just superficial), and some UI modifications to impose updates to spell slots when changing class, as the game only updates them when you actually level-up, and there is no way to grant spell slots if you don't already have access to a given spell level. I've looked into this for the purpose of a 3E multiclass system - it is feasible, but would be a lot of work to implement.
I was afraid of that, it seems everything I want to do would be more work than I can afford to put in at the moment.
EDIT: Are the types of damages/resistances hard coded or can extra ones be added?
A lot of work? Yes, that's familiar. Myself, I've had all sorts of grand ideas for this engine that were not so much impossible as, ultimately, not worth the trouble. Especially considering the limited and indifferent audience. I mean, you'd spend a month or something working on what 200 people will download? Why? That's why I'm focusing on sheer fun stuff that most people may like - some content, some inventive mechanics, appearance changes and so on.
The latest big desire to come over me, yesterday, was to revamp the combat system towards light armor/no armor, round shields and short swords. This was the style most peoples fought in for millennia. The big swords only came around with stirrups, lances and the need to break through heavy armor. The "short sword" isn't just for stabbing like the AD&D version, that's only partially true for the gladius. But look at the popular acinaces:
Up to 800 A.D. or so people hacked with swords like this as well, swords were just shorter, shields smaller, combat closer and more visceral. I had a couple of people in the party go at each other with custom swinging short swords, round shields and no armor or leather-chainmail at most. Helmets changed to the simple antique form. And it really looked hot, much closer to the bone. I was actually worried to look at them. So my idea was, why not give everyone except mages level-dependent AC bonuses like those of monks, say, +1 for every two levels, to reflect experience? Seasoned fighters should be better at dodging, no? And I would convert all armors to chain and leather, all swords to short swords, in appearance and mechanics. Well, I still think it would be interesting, but I got dizzy just thinking about the amount of work it would take. And I've never done revamps like this.
Are the types of damages/resistances hard coded or can extra ones be added?
Hard-coded. And MAGICCOLD and MAGICFIRE are bugged, from what I've read in the G3 guide. But you can play around with the Damage and Current Hit Points opcodes a little. Look at the options there or the Harm spell. For example, you could make a sword that will decrement HP by 1 instead of doing 1 point of damage, and this would be irresistible. Or a sword that will reduce maximum HP instead.
They do have lovely colored bottom-screen messages, though. I've never understood the AD&D distinction between fire and magical fire, cold and magical cold. How is anything magical different from regular stuff except in intensity? There should be magical electricity, too, then, and magical acid, whatever that would even look like. Would it react with a magical base?
All right, people. So I'm making a magical item with a few abilities. I don't know how to give them separate names... See, a wand of fire has the fireball and the scorcher. And in the quick item slot they have the same icon but each shows with its own name on mouse-over. So each ability somehow gets a name. Where, though? The wand is just an item with two Magic type abilities, but there is no place to assign a name to them.
But what if there are several references to the TRA? Won't the latest RESOLVE overwrite the previous ones? Unless you mean I need to put -1 for the abilities not being edited?
By the way, is an item limited to just three abilities?
You can use another variable name for secondary strref, e.g. strref2=RESOLVE_STR_REF (@Y).
-1 means that the ability (if it exists) will use item's name instead of custom strref, when you open "equipment" quick bar button.
No, but 4+ abilities will share the charge count with the 1st one. This can be useful if you want to make Wand of Fire not use separate charges for fireball and scorcher abilities. Also possible to hide 2nd and 3rd from view, but I forgot how exactly (iirc with invalid use location).
But what if there are several references to the TRA? Won't the latest RESOLVE overwrite the previous ones? Unless you mean I need to put -1 for the abilities not being edited?
By the way, is an item limited to just three abilities?
Charges/Count are limited to three, some items are functionally limited to one, some have no practical limit.
All abilities after the 3rd share charges/count with the first. If they don't using charges then this is irrelevant, but it also means you can make items that intentionally share charges by creating 2 dummy abilities in the 2/3rd slot, so the real abilities are in slots 1 and 4+.
Not all item types support selecting from multiple abilities in quick-item slots.
Thanks for the answers. I think the shared charge feature will be what I need. I have an item with five abilities, use any and you have to rest for the item to recharge. That's the idea, at least... I'll look into this for sure as soon as I get back to the store and the item.
And I should probably ask @kjeron for another script. This is to patch all weapons of a category to have a new global ability, Set Spell State pointing to a custom entry. This will serve as a marker for when a character is wielding, for example, a bow and has it ready to shoot, therefore with ammo (otherwise the state gets switched off as the weapon is unselected). Right now there are no markers for having an item of a type equipped and selected. There is the HasItemCategory trigger, but it's bugged. It's only good for checking the item's presence in the inventory at FALSE. Doesn't know that the item is worn. But now it will be detectable, and this thing about ammo is a nice bonus. Actually I'm interested in the type and amount of damage weapons do. There are only a few types, for example a two-handed sword, a katana and a halberd all do 1d10 points of slashing (the halberd can do piercing too, but it's unimportant for scripts), staves, clubs and maces do 1d6 of crushing and so on.
I've added new lines to the spell state IDS already. Now this patching with the global ability... I know how to edit an existing ability, but creating one, this add-byte business...
There is the HasItemCategory trigger, but it's bugged. It's only good for checking the item's presence in the inventory at FALSE.
It fails to correctly pass the actively equipped check when the item is a launcher(never true), ammo(always true), or is in the offhand(always true). It should work otherwise, which I guess limits it to 2-handed melee weapons and thrown weapons.
And that's a darn severe limitation. Thanks a lot for the code. As soon as I get my brand-new combat mechanic finished, a couple of days I expect, you and Ardanis are getting the first places in my thank-you list.
And what's the code for patching all spells the same way, with a global effect?
For items I'm trying this version of the code with Weidu, and while there are no errors, bows don't change:
COPY_EXISTING_REGEXP ~.*\.itm~ override PATCH_IF (SOURCE_SIZE > 0x2d0) THEN BEGIN READ_BYTE 0x31 prof PATCH_IF (prof = 104 || prof = 105) BEGIN LPF ADD_ITEM_EQEFFECT INT_VAR opcode = 328 target = 1 timing = 2 parameter2 = 349 special = 1 END END END BUT_ONLY
This is supposed to look at the proficiency being used, and if it's 104-105 for bows, then add the spell state number 349, the number under which I added BOW_EQUIPPED earlier in the installation...
And what's the code for patching all spells the same way, with a global effect?
LPF ADD_SPELL_CFEFFECT (variables) END same format, however, they are only run if the spell is cast directly. Being cast through opcodes (146/148/326/258) does not trigger a spells global effects. IIRC its the same for scripts actions, only the actions that require memorization run a spells global effects.
That's for the better. I'm going to patch all spells with a global effect lasting 1 second per 2 of their casting time. If a character is in the NOW_CASTING spell state, then he ignores certain distracting script commands. A marker for magic. But it's better if nested spells don't do this.
How about my other question? Why don't the items get patched?
How about my other question? Why don't the items get patched?
It wasn't there when I posted, hadn't seen it. Why are you checking SOURCE_SIZE > 0x2d0? > 0x71 is for minimum valid item file size. > 0xa9 is for minimum valid weapon file size (they need at least 1 ability).
So I never liked that Blackguard Aura of Despair has Panic effect from lvl 15 to 20. So I downloaded Near Infinity, found spell (found spell code in EE Keeper) and replaced Panic (40) with Slow (40), also I replaced enemies level to 0 (so nobody is immune) and in Save I left (No Save).
I went to Edit, cliced Saved- it says it saved in BG:EE/Override/SpellName.
Did I do it correct? Now Aura should have Slow effect for duration without Save throws if I did it correct.
Imo much better for ability that you can use only once and it will be usefull till the end game of BG:ToB I think.
If not I think about replacing it with Posion maybe...
Comments
Probably possible, but it would likely require both starting as a Cleric/Mage (to initialize spell slots, even if its just superficial), and some UI modifications to impose updates to spell slots when changing class, as the game only updates them when you actually level-up, and there is no way to grant spell slots if you don't already have access to a given spell level. I've looked into this for the purpose of a 3E multiclass system - it is feasible, but would be a lot of work to implement.
And another thing. For the life of me I can't seem to get my custom item to have more than ONE charge. It disappears afterwards. I can set the number of charges to 100 and from there to eternity, I can copy a perfectly working Fireball ability from the Wand of Fire, where it's 50, still just one charge. I've ran into this kind of crap before with items, what gives?
Current stack/charge count is set within the CRE/STO/ARE file that possesses the item.
Edit: it does.
By the way, this occurs to me as a way to make sure an item that doesn't exist anywhere but only gets created is unique. Also this should work for randomly generated loot. I'm making some new treasure and a few of the items, like a rare marble bust, are to be one-time finds. Well, if I put them in separate containers, the move action can happen any number of times, nothing will happen after the first roll, because the container will be empty then.
EDIT: Are the types of damages/resistances hard coded or can extra ones be added?
The latest big desire to come over me, yesterday, was to revamp the combat system towards light armor/no armor, round shields and short swords. This was the style most peoples fought in for millennia. The big swords only came around with stirrups, lances and the need to break through heavy armor. The "short sword" isn't just for stabbing like the AD&D version, that's only partially true for the gladius. But look at the popular acinaces:
Up to 800 A.D. or so people hacked with swords like this as well, swords were just shorter, shields smaller, combat closer and more visceral. I had a couple of people in the party go at each other with custom swinging short swords, round shields and no armor or leather-chainmail at most. Helmets changed to the simple antique form. And it really looked hot, much closer to the bone. I was actually worried to look at them. So my idea was, why not give everyone except mages level-dependent AC bonuses like those of monks, say, +1 for every two levels, to reflect experience? Seasoned fighters should be better at dodging, no? And I would convert all armors to chain and leather, all swords to short swords, in appearance and mechanics. Well, I still think it would be interesting, but I got dizzy just thinking about the amount of work it would take. And I've never done revamps like this.
To answer you question... Hard-coded. And MAGICCOLD and MAGICFIRE are bugged, from what I've read in the G3 guide. But you can play around with the Damage and Current Hit Points opcodes a little. Look at the options there or the Harm spell. For example, you could make a sword that will decrement HP by 1 instead of doing 1 point of damage, and this would be irresistible. Or a sword that will reduce maximum HP instead.
~RESREF STRREF1 STRREF2 STRREF3~
By the way, is an item limited to just three abilities?
-1 means that the ability (if it exists) will use item's name instead of custom strref, when you open "equipment" quick bar button.
No, but 4+ abilities will share the charge count with the 1st one. This can be useful if you want to make Wand of Fire not use separate charges for fireball and scorcher abilities. Also possible to hide 2nd and 3rd from view, but I forgot how exactly (iirc with invalid use location).
There's also tooltip-adding function in IR, with examples https://github.com/Gibberlings3/ItemRevisions/blob/master/item_rev/lib/tooltip_macro.tpa
And I should probably ask @kjeron for another script. This is to patch all weapons of a category to have a new global ability, Set Spell State pointing to a custom entry. This will serve as a marker for when a character is wielding, for example, a bow and has it ready to shoot, therefore with ammo (otherwise the state gets switched off as the weapon is unselected). Right now there are no markers for having an item of a type equipped and selected. There is the HasItemCategory trigger, but it's bugged. It's only good for checking the item's presence in the inventory at FALSE. Doesn't know that the item is worn. But now it will be detectable, and this thing about ammo is a nice bonus. Actually I'm interested in the type and amount of damage weapons do. There are only a few types, for example a two-handed sword, a katana and a halberd all do 1d10 points of slashing (the halberd can do piercing too, but it's unimportant for scripts), staves, clubs and maces do 1d6 of crushing and so on.
I've added new lines to the spell state IDS already. Now this patching with the global ability... I know how to edit an existing ability, but creating one, this add-byte business...
For items I'm trying this version of the code with Weidu, and while there are no errors, bows don't change:
COPY_EXISTING_REGEXP ~.*\.itm~ override
PATCH_IF (SOURCE_SIZE > 0x2d0) THEN BEGIN
READ_BYTE 0x31 prof
PATCH_IF (prof = 104 || prof = 105) BEGIN
LPF ADD_ITEM_EQEFFECT
INT_VAR
opcode = 328
target = 1
timing = 2
parameter2 = 349
special = 1
END
END
END
BUT_ONLY
This is supposed to look at the proficiency being used, and if it's 104-105 for bows, then add the spell state number 349, the number under which I added BOW_EQUIPPED earlier in the installation...
same format, however, they are only run if the spell is cast directly. Being cast through opcodes (146/148/326/258) does not trigger a spells global effects. IIRC its the same for scripts actions, only the actions that require memorization run a spells global effects.
How about my other question? Why don't the items get patched?
Why are you checking SOURCE_SIZE > 0x2d0?
> 0x71 is for minimum valid item file size.
> 0xa9 is for minimum valid weapon file size (they need at least 1 ability).
I did my first "mod" (too big word!), I think...
So I never liked that Blackguard Aura of Despair has Panic effect from lvl 15 to 20. So I downloaded Near Infinity, found spell (found spell code in EE Keeper) and replaced Panic (40) with Slow (40), also I replaced enemies level to 0 (so nobody is immune) and in Save I left (No Save).
I went to Edit, cliced Saved- it says it saved in BG:EE/Override/SpellName.
Did I do it correct? Now Aura should have Slow effect for duration without Save throws if I did it correct.
Imo much better for ability that you can use only once and it will be usefull till the end game of BG:ToB I think.
If not I think about replacing it with Posion maybe...