Skip to content

General mod Questions thread

1568101170

Comments

  • kjeronkjeron Member Posts: 2,367
    edited September 2017
    chimeric said:

    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. :
    Pheosics said:

    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.
  • chimericchimeric Member Posts: 1,163
    edited September 2017
    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?
    Post edited by chimeric on
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    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.
  • The user and all related content has been deleted.
  • chimericchimeric Member Posts: 1,163
    edited September 2017
    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???
    kjeron said:

    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?

    Edit: it does.
    Post edited by chimeric on
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    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.
  • chimericchimeric Member Posts: 1,163
    edited September 2017
    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.
    Post edited by chimeric on
  • PheosicsPheosics Member Posts: 16
    edited September 2017
    kjeron said:

    Pheosics said:

    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?
    Post edited by Pheosics on
  • chimericchimeric Member Posts: 1,163
    edited September 2017
    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.

    To answer you question...
    Pheosics said:

    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.
    Post edited by chimeric on
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    Hard-coded. And MAGICCOLD and MAGICFIRE are bugged, from what I've read in the G3 guide.

    They work fine in the EE's.
  • chimericchimeric Member Posts: 1,163
    So no crashes if you die from them?
  • [Deleted User][Deleted User] Posts: 0
    edited September 2017
    The user and all related content has been deleted.
  • chimericchimeric Member Posts: 1,163
    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? :o
  • chimericchimeric Member Posts: 1,163
    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.
  • kjeronkjeron Member Posts: 2,367
    "TOOLTIP.2DA"
    ~RESREF STRREF1 STRREF2 STRREF3~
  • chimericchimeric Member Posts: 1,163
    How do I get this to work if the strref is @X from the TRA?
  • kjeronkjeron Member Posts: 2,367
    OUTER_SET strref = RESOLVE_STR_REEF (@X)
    APPEND ~TOOLTIP.2DA~ ~%resref% %strref% -1 -1~
  • chimericchimeric Member Posts: 1,163
    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?
  • ArdanisArdanis Member Posts: 1,736
    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).

    There's also tooltip-adding function in IR, with examples https://github.com/Gibberlings3/ItemRevisions/blob/master/item_rev/lib/tooltip_macro.tpa
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    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?

    If it has multiple abilities:
    OUTER_SET strref1 = RESOLVE_STR_REEF (@X)
    OUTER_SET strref2 = RESOLVE_STR_REEF (@Y)
    OUTER_SET strref3 = RESOLVE_STR_REEF (@Z)
    APPEND ~TOOLTIP.2DA~ ~%resref% %strref1%  %strref2%  %strref3%~
    -1 is for unused abilities.
    chimeric said:

    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.
  • chimericchimeric Member Posts: 1,163
    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. :D 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...
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    This is to patch all weapons of a category to have a new global ability, Set Spell State pointing to a custom entry.

    This wouldn't be an ability, but a global effect for the item.
    COPY_EXISTING_REGEXP	~.*\.itm~ override
    	PATCH_IF	(item type check) BEGIN
    		LPF	ADD_ITEM_EQEFFECT
    			INT_VAR
    				opcode = 328
    				target = 1
    				timing = 2
    				parameter2 = (spellstate)
    				special = 1
    		END
    	END
    BUT_ONLY
    chimeric said:

    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.
  • chimericchimeric Member Posts: 1,163
    And that's a darn severe limitation. :wink: 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.
  • chimericchimeric Member Posts: 1,163
    edited September 2017
    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...
    Post edited by chimeric on
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    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.
  • chimericchimeric Member Posts: 1,163
    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?
  • kjeronkjeron Member Posts: 2,367
    chimeric said:

    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).
  • chimericchimeric Member Posts: 1,163
    That was from someone else's code. They said it was a size check for files... Anyway, I'll try it without.
  • Benny89Benny89 Member Posts: 6
    Hi,

    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 :D and it will be usefull till the end game of BG:ToB I think.

    If not I think about replacing it with Posion maybe...
  • chimericchimeric Member Posts: 1,163
    You probably did it right, but in cases like these, you've always got to start the game and test, test, test. That's a cross you have to carry.
Sign In or Register to comment.