Skip to content

[MOD] EEex (v0.10.2-alpha)

145791048

Comments

  • OlvynChuruOlvynChuru Member Posts: 3,075
    So I downloaded EEex and started playing around with script hooks. I'm wondering, what do all the different offsets in an action do? (e.g. I know that actionData + 0x54 and actionData + 0x58 are the target X and Y coordinates of the action, but what information is stored in the various other offsets?)
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited January 2019
    Bubb said:

    Luke93 said:

    @Bubb

    What can you tell me of this? Do you know of any workaround?

    @Luke93: Well, it certainly doesn't seem like desired behavior, but the code does it quite intentionally. Any effect that is applied to the creature will force the values back to normal. So, you're on the right track with using an ApplySpell, you just need to use a dummy effect that has no actual meaning. Like a 0 duration Opcode #0 with param1 = 0; something like that.
    I'm sorry, but it's not (fully) working.... In particular, General is set to 0 (GENERAL_ITEM), the other values seem OK.......

    IF
    	Global("gt_summ","GLOBAL",0)
    THEN
    	RESPONSE #100
    		SetGlobal("gt_summ","GLOBAL",1)
    		MakeGlobalOverride()
    		ChangeEnemyAlly(Myself,FAMILIAR)
    		AddFamiliar()
    		ApplySpellRES("GTDUMMY",Myself)
    		Continue()
    END
    Post edited by _Luke_ on
  • BubbBubb Member Posts: 999
    edited January 2019

    Bubb I know you are quite busy with getting things implemented but would you be able to give an example of how to implement a key binding with the EEex_Key.lua? Like for the really dense coding lay people like me?

    Extract the attached archive and drop M_Hotkey.lua into your override folder. Open it, and you should see this starting at line 13:
    B3Hotkeys = {
    {B3TogglePrintKeys, 3, 0x60}, -- Key-Pressed Output Toggle
    {"SPWI523", 3, 0x61, 0x73, 0x64},
    }
    In order to add a new spell => key combo, copy the "SPWI523" line and paste it directly on the next line. Change the resref to whatever spell / ability you want. The second column is used internally when processing the hotkey, always keep that a 3. The following numbers are the sequence of keys required to activate the action...

    The first hotkey is defining a toggle which allows you to see the hexadecimal value of whatever keys you press. After pressing "`", you should something like this in the log:


    Whenever you press a key a "[EEex] Pressed: x" will be shown in the log. You can then use these values in the keybinding definitions. :)
    -------------------------------------------------------------------

    So I downloaded EEex and started playing around with script hooks. I'm wondering, what do all the different offsets in an action do? (e.g. I know that actionData + 0x54 and actionData + 0x58 are the target X and Y coordinates of the action, but what information is stored in the various other offsets?)

    I haven't explored everything, but here's the structure that's defined in the debug file, (CAIAction being what is behind actionData):
    CAIAction:
    0x00 m_actionID word
    0x04 m_actorID CAIObjectType
    0x18 m_acteeID CAIObjectType
    0x2C m_acteeID2 CAIObjectType
    0x40 m_specificID dword
    0x44 m_specificID2 dword
    0x48 m_specificID3 dword
    0x4C m_string1 ptr to string
    0x50 m_string2 ptr to string
    0x54 m_dest CPoint (dword x)
    0x58 (dword y)
    0x5C m_internalFlags dword (bit field)
    0x60 m_source ptr to string

    CAIObjectType:
    0x00 m_name ptr to string
    0x04 m_EnemyAlly byte
    0x05 m_General byte
    0x06 m_Race byte
    0x07 m_Class byte
    0x08 m_Instance dword
    0x0C m_SpecialCase 5 bytes (m_SpecialCase[0])
    0x0D (m_SpecialCase[1])
    0x0E (m_SpecialCase[2])
    0x0F (m_SpecialCase[3])
    0x10 (m_SpecialCase[4])
    0x11 m_Specifics byte
    0x12 m_Gender byte
    0x13 m_Alignment byte
    -------------------------------------------------------------------
    Luke93 said:

    I'm sorry, but it's not (fully) working.... In particular, General is set to 0 (GENERAL_ITEM), the other values seem OK.......

    Hmm, the same thing works flawlessly on my end. Are you sure the creature in question doesn't have a general of 0 to begin with?
    OlvynChuruGrammarsaladfortyseven
  • FlashburnFlashburn Member Posts: 1,847
    Bubb said:

    Welp, I'm glad the same functionality can be implemented via the vanilla engine. I was already like 75% done doing it the hard way, so I finished because why not.


    Terminsel has Opcode #193 applied. Whenever he is selected, invisible creatures can be seen by their selection circle. He is the only one that can target the creature, though.
    Awesome! That's exactly what I wanted. You are a true treasure to modding. EEex is going to revolutionary.
    GrammarsaladfortysevenBubb
  • fortysevenfortyseven Member Posts: 96
    edited January 2019
    @Bubb I have been thinking about different ways of targeting non party NPCs in the game including allies like summons, but also neutrals and hostiles using the keyboard.

    Would it be possible to assign and display a number on such targets when they enter the visual range and then having those numbers assignable with hotkeys? Essentially, what I'm asking, would it be possible to extend the targeting system of party members, which by default can be selected by keys 1-6, to these other groups of targets?

    So maybe if a number was displayed on all targetable creatures (friend and foe) say from 1-99 and those numbers could be linked with the keybinding system you have already developed? This would make controlling single target spells and abilities a hell of a lot less fiddly in the heat of battle. Now I know you have only just completed one of my requests and I don't want to seem greedy so I understand if you are busy with other things!
    Bubb
  • BubbBubb Member Posts: 999
    @fortyseven: Interesting idea! I'll look at it after I implement some new opcodees, don't want to leave the other guys hanging :p

    The only thing I can think of off the top of my head: typing numbers that are more than one digit is a little tricky. How do I know that the 77 you just typed wasn't two "target 7" commands? One workaround would be to have a "starting" keypress, and then an "ending" keypress. So, if you wanted to target creature 22, for instance, you would type "`" + "2" + "2" + "`"

    How's that sound?
    fortysevenGrammarsalad
  • fortysevenfortyseven Member Posts: 96
    Bubb said:

    @fortyseven: Interesting idea! I'll look at it after I implement some new opcodees, don't want to leave the other guys hanging :p

    The only thing I can think of off the top of my head: typing numbers that are more than one digit is a little tricky. How do I know that the 77 you just typed wasn't two "target 7" commands? One workaround would be to have a "starting" keypress, and then an "ending" keypress. So, if you wanted to target creature 22, for instance, you would type "`" + "2" + "2" + "`"

    How's that sound?


    Not a bad idea but maybe more complicated than needed. The numbers themselves don't have to necessarily be literally reflected in their keybind. Number 0-9 could simply be combined with a modifier or even a letter key to denote increases of tens. Like shift could be tens, control could be twenties etc. Thus number 22 would simply be "ctrl" + "2". The system you have written is so flexible and extensive there is no limit to combinations.
    Bubb said:

    v0.2.1-alpha is now released:

    Gameplay changes are now opt-in, instead of being on by default. This version implements the idea of a module. Modules are gameplay changes that are included with EEex, but must be enabled by the user by altering EEex_INI.lua. Here's the currently included modules:
    • B3_Books.lua: Force-enables the mage book screen, (only the screen), for all classes. (Pretty useless right now, but I'm working on externalizing more of the magic system...)

    • B3_Hotke.lua: Implements a new hotkey system, (add new hotkeys by editing the "B3Hotkey_Hotkeys" table).

    • B3_Invis.lua: Changes Opcode #193 to allow player-controlled creatures, which have said opcode applied, to see invisible sprites. Invisible sprites that are detected using Opcode #193 will only have their selection circle visible, though there is a setting at the top of the file which makes these creatures render as if under a detected improved invisiblity.

    Love the idea of a modular system and is indeed what I was hoping you would implement! Also greatly looking forward to your plans for greater externalisation of the magic system!
    Bubb
  • The user and all related content has been deleted.
    fortysevenGrammarsaladBubb
  • The user and all related content has been deleted.
    Bubb
  • UlbUlb Member Posts: 295
    This is just awesome, thank you @Bubb
    B3_Invis.lua with the imp. invis setting is actually something I've wanted for a long time.

    Since this is the time of miracles, I'll add a few feature suggestions as well.
    (Not sure if those are within the scope of this project or of general interest though.)

    - Externalized Stoneskin color ..
    .. or even better, not just color but maybe a 2da file that allowes to point to a specific spell that's applied to the target while a spell's Stoneskin effect is active.

    - Externalized Stoneskin absorb effect.
    I wonder if it would be possible to also change the damage types a Stoneskin effect can absorb? (E.g. to create an effect that absorbs fire damage hits.)

    - Continuing that chain of thought, would it be possible at all to create an "absorb"/absolute resistance effect? (Absorb x amount of damage (not hits) or reduce each hit by x amount of damage)

    - Allow the new "character outline" render function (used for the black border around characters and the highlighting for selected characters) to be used as an opcode effect with a color parameter.
    I don't like using the sprite outlines myself but I think they would make a great aura effect (which fits all animation shapes and sizes).

    -Some kind of flag that excludes specific kits from gaining spells on level up.
    Preventing a kit from accessing default cleric or wizard spells would allow for so many cool kits..
    GrammarsaladswitBubb
  • fortysevenfortyseven Member Posts: 96
    edited January 2019
    A really useful opcode that I know loads of people have wanted over the years, me included is "disarm trap" usable on a clickable target. That way we could make spells and abilities that would allow for trap disarming without having to have a thief action bar on one of our party NPCs. Just putting it out there. ;)
    Bubb
  • OlvynChuruOlvynChuru Member Posts: 3,075
    Ulb said:


    - Externalized Stoneskin absorb effect.
    I wonder if it would be possible to also change the damage types a Stoneskin effect can absorb? (E.g. to create an effect that absorbs fire damage hits.)

    While I do not know any way to implement this exact effect, you could make a spell that absorbs the first damage of the damage type(s) of your choice by using the Seven Eyes opcode to give the creature a special spell state and update 7eyes.2da to have that spell state absorb the damage type(s) of your choice.

    Although BGEE and BG2EE do not have a 7eyes.2da file, it will work if you create one. Take a look at 7eyes.2da in Icewind Dale Enhanced Edition if you want to figure out how to do this.
    fortysevenBubb
  • The user and all related content has been deleted.
    fortysevenBubb
  • GrammarsaladGrammarsalad Member Posts: 2,582
    edited January 2019
    Ulb said:

    ...
    -Some kind of flag that excludes specific kits from gaining spells on level up.
    Preventing a kit from accessing default cleric or wizard spells would allow for so many cool kits..

    I would really like something like this.

    Or, maybe better a 2da that excludes specific spells from designated classes or kits. Like a kit specific hidespl.2da that prevents the spell from bring learned from scrolls.

    So, like:
    2DA V1.0
    0
                          HIDE 
    KIT_OR_CLASS_NAME     SPELL_NAME 
    
    
    Where the designated kit or class is barred from learning the designated spell at level up or character creation and is barred from learning the spell from scrolls.

    But even just a class/kit specific hidespl.2da would be all I would need to create custom spell lists (i.e. by changing the way school based spell learning works--i.e. by summoning based dialog or something similar)
    fortysevenBubb
  • fortysevenfortyseven Member Posts: 96
    @Bubb, I have been experimenting with your hotkey mod and it really is incredibly flexible. What is unique is how it can handle multiple key assignments. For example it will handle "A+S" completely separately to "A", "S" and "S+A". They all work in parallel without triggering the other bindings as long as you perform the inputs cleanly enough (which works quite well after a bit of practice). This allows for really interesting and ergonomic layouts. It has sped up playing larger groups with broad and complex ability sets in a way that's making it feel almost like a new game. An average battle now takes about half the time and it's more live-action with fewer and shorter uses of pause. It really is a lot more dynamic if one is willing to put in the time to adjust the keyboard layout (took me a couple of hours with trial and error for a group of 6 high level casters). I'm now wishing other games used the same key-binding system but I have never seen it anywhere else!

    One thing I have been wondering, would it be possible to add mouse keys as possible inputs? If mouse keys could be used in this flexible combo style with keyboard keys I think it would become even more dynamic and would possibly do away or at least significantly reduce the amount of practice and care that was needed to opearte a complex keyboard layout. At the moment you have one hand on the mouse anyway that isn't doing much apart from moving the pointer.

    And finally, would you be able to add item abilities to be assignable as well? That is the ones that are accessed through the backpack symbol. Items with direct effects can't have keys assigned at present as far as I can see (i have tried using their *.itm resef). Also in your current system can you assign general game functions like "map" or "inventory"?

    I know you are really busy and there are loads of others who have asked for your attention so I understand if you are occupied with other things right now!
    FlashburnBubb
  • UlbUlb Member Posts: 295

    Ulb said:


    - Externalized Stoneskin absorb effect.
    I wonder if it would be possible to also change the damage types a Stoneskin effect can absorb? (E.g. to create an effect that absorbs fire damage hits.)

    While I do not know any way to implement this exact effect, you could make a spell that absorbs the first damage of the damage type(s) of your choice by using the Seven Eyes opcode to give the creature a special spell state and update 7eyes.2da to have that spell state absorb the damage type(s) of your choice.

    Although BGEE and BG2EE do not have a 7eyes.2da file, it will work if you create one. Take a look at 7eyes.2da in Icewind Dale Enhanced Edition if you want to figure out how to do this.
    Interesting, I have no clue what 7eyes is or does, so I'll have to look into that.

    Ulb said:



    - Externalized Stoneskin color ..
    .. or even better, not just color but maybe a 2da file that allowes to point to a specific spell that's applied to the target while a spell's Stoneskin effect is active.

    Yeah - you can override the gray color with some visual effect, but the difficulty is limiting the effect to the lifespan of the Stoneskin, which is quite variable.

    For consistency's sake the ideal here would be to use a subspell identified in the Stoneskin effect - the way the Spell Deflection opcode works as of the 2.5 patch. Basically, every effect whose duration is not necessarily the same as the spell's stated duration (Stoneskin, Mirror Image, Spell Deflection/Turning, Spell Shield, etc.) should have this functionality.
    Aye, having it as a spell parameter would probably be the best solution.

    Ulb said:


    - Externalized Stoneskin absorb effect.
    I wonder if it would be possible to also change the damage types a Stoneskin effect can absorb? (E.g. to create an effect that absorbs fire damage hits.)

    This is already more or less possible, if you convert the extra elemental damage to on-hit spells, give those spells a particular secondary type, and use the (now fixed, I believe) Spell Shield opcode to provide protection against that sectype. See here:
    https://www.gibberlings3.net/forums/topic/29711-protection-against-dispel-magic/?do=findComment&comment=263993
    But that would leave out spells unless you also want to add that secondary type to real spells (which will most likely already use that type for something else) also, unless you can just new add secondary types, doing it this way would also provide unwanted immunity to a number of spells using the same subtype?
  • GrammarsaladGrammarsalad Member Posts: 2,582
    edited January 2019

    Ulb said:

    ...
    -Some kind of flag that excludes specific kits from gaining spells on level up.
    Preventing a kit from accessing default cleric or wizard spells would allow for so many cool kits..

    I would really like something like this.

    Or, maybe better a 2da that excludes specific spells from designated classes or kits. Like a kit specific hidespl.2da that prevents the spell from bring learned from scrolls.

    So, like:
    2DA V1.0
    0
                          HIDE 
    KIT_OR_CLASS_NAME     SPELL_NAME 
    
    
    Where the designated kit or class is barred from learning the designated spell at level up or character creation and is barred from learning the spell from scrolls.

    But even just a class/kit specific hidespl.2da would be all I would need to create custom spell lists (i.e. by changing the way school based spell learning works--i.e. by summoning based dialog or something similar)
    To expand a bit on the idea:

    Or maybe a hpclass.2da like set up:
    2DA                  V1.0
    DEFAULT(hidespl)
                         TABLE  
    KIT_OR_CLASS_NAME              2DA_NAME
    Where there is a default 2da that defines restrictions (maybe that could actually be hidespl.2da) but where different kits or classes could reference alternate hidespl-like 2das (that modders would have to create)
  • AndreaColomboAndreaColombo Member Posts: 5,524
    Hi,

    Would it be possible for EEex to enable this?

    Additionally, would it be possible to externalize the sprites assigned to CHARNAME at character creation? Currently they are hardcoded so if one were to, say, make a mod that changes player character sprites... at the end of character creation, CHARNAME would be unaffected, and players would have to use EEKeeper to get their new sprite.
    GrammarsaladBubb
  • UlbUlb Member Posts: 295

    Hi,

    Would it be possible for EEex to enable this?

    Additionally, would it be possible to externalize the sprites assigned to CHARNAME at character creation? Currently they are hardcoded so if one were to, say, make a mod that changes player character sprites... at the end of character creation, CHARNAME would be unaffected, and players would have to use EEKeeper to get their new sprite.

    Unless I'm missunderstanding what you're trying to do, you can already do this right now with scripts.
    GrammarsaladAndreaColomboBubb
  • GrammarsaladGrammarsalad Member Posts: 2,582
    edited January 2019
    Ulb said:

    Hi,

    Would it be possible for EEex to enable this?

    Additionally, would it be possible to externalize the sprites assigned to CHARNAME at character creation? Currently they are hardcoded so if one were to, say, make a mod that changes player character sprites... at the end of character creation, CHARNAME would be unaffected, and players would have to use EEKeeper to get their new sprite.

    Unless I'm missunderstanding what you're trying to do, you can already do this right now with scripts.
    In earlier versions you definitely can. It's done here, for example:


    https://github.com/aquadrizzt/MonasticOrders

    Edit: iirc, it's a pita. There are some redundancies you have to get around...

    Edit 2: I believe you have to apply race based 177 effects in the clab and use scripting. I forget the details, but there are issues when using just one technique
    Post edited by Grammarsalad on
    AndreaColomboBubb
  • The user and all related content has been deleted.
  • UlbUlb Member Posts: 295

    Ulb said:


    It would also be great if Stoneskins were not destroyed by damage that isn't blocked...

    Wait, what?

    Bubb
  • BubbBubb Member Posts: 999
    Heh, I lose power for one day and I come back to this! I'll get to work on all of the suggestions :)

    It might be a while before I get any particular person's done, as I now have around ~20 suggestions piled up - just know that I am indeed working on them! I'm only responding to the suggestions in which I have immediate questions on how to implement, all the rest are in the queue:


    @fortyseven:

    1) One thing I have been wondering, would it be possible to add mouse keys as possible inputs...

    2) And finally, would you be able to add item abilities to be assignable as well...

    1. Like allowing mouse clicks to be part of a keybinding? I'm not quite sure how that would work, as the mouse buttons are intrinsically hard coded to do other things.

    2. Well, at first glance I thought this would be a 2 line fix, but sadly it isn't. Item abilities don't actually use resrefs; they are embedded inside the .ITM itself. I can target the item's resref, but if the item has more than one ability it will just pick the first one. I think the only way to target a specific item ability is to match text...

    For consistency's sake the ideal here would be to use a subspell identified in the Stoneskin effect - the way the Spell Deflection opcode works as of the 2.5 patch. Basically, every effect whose duration is not necessarily the same as the spell's stated duration (Stoneskin, Mirror Image, Spell Deflection/Turning, Spell Shield, etc.) should have this functionality.

    I've pushed a commit to master that implements this for Opcode #218, and I'll try to implement it for all the other variable-duration opcodes. If someone could post a list of all of these opcode numbers it would be appreciated, so I can make sure I got all of them.
    GrammarsaladfortysevenOlvynChuru
  • The user and all related content has been deleted.
  •  TheArtisan TheArtisan Member Posts: 3,277
    Think about it: Stoneskins absorb physical attacks, right? But what happens when you have Stoneskin and get hit by the Flail of Ages? The blunt damage is blocked and a skin disappears. And... fire damage bypasses the Stoneskin and harms you, but a skin still disappears. Lightning damage bypasses the spell, but still expends a skin. (Please correct me if I'm remembering this wrong.)

    I have never seen this happen, unless the countless magic missiles I've cast at stoneskin-buffed mages has somehow been lying to me.
  • The user and all related content has been deleted.
  • fortysevenfortyseven Member Posts: 96
    edited January 2019
    Bubb said:

    Heh, I lose power for one day and I come back to this! I'll get to work on all of the suggestions :)

    It might be a while before I get any particular person's done, as I now have around ~20 suggestions piled up - just know that I am indeed working on them! I'm only responding to the suggestions in which I have immediate questions on how to implement, all the rest are in the queue:

    You really are admirable in how generously your are giving time and skill to this project of yours for the benefit of so many of us! I can't thank you enough!

    Bubb said:

    1. Like allowing mouse clicks to be part of a keybinding? I'm not quite sure how that would work, as the mouse buttons are intrinsically hard coded to do other things.

    2. Well, at first glance I thought this would be a 2 line fix, but sadly it isn't. Item abilities don't actually use resrefs; they are embedded inside the .ITM itself. I can target the item's resref, but if the item has more than one ability it will just pick the first one. I think the only way to target a specific item ability is to match text...


    Sounds like mouse buttons are off-limits if they are hardcoded.

    Regarding item abilities, using text might also not work all that well if there is more than one ability on the item. Those abilities have no text element linked to them as far as I can see. In nearinfinity they are numbered but I believe that is entirely internal to that programme. So I'm not sure what you could target? Would the icon.bam be an idea? That is often specific to a single ability and in cases when it isn't it could easily be made to be by copying and renaming the bam file to a unique name.

    Also is it possible to target other interface functions at present like opening the "map" or "inventory" with your hotkey.lua?

  • ThelsThels Member Posts: 1,416
    I'm not really following what's going on in this thread, other than that you seem to be allowing things that are otherwise not possible.

    Would this in any way be able to affect the party size? I doubt it, but one can dream!
Sign In or Register to comment.