Skip to content

[MOD] EEex (v0.10.2-alpha)

1171820222348

Comments

  • OlvynChuruOlvynChuru Member Posts: 3,075
    @Bubb Thank you! :)

    Could you let it pass the parameters of the opcode 403 effect to the function, as can be done with opcode 402?
    Bubb
  • BubbBubb Member Posts: 998
    Mmm, well I would have said "absolutely" before I looked at it, but the way I've implemented it abstracts away the actual opcode...

    Would require a major rework of the mechanism to store the originating effect instead of just the Lua function. Does what you are trying to do require access to the originating opcode?
    OlvynChuru
  • OlvynChuruOlvynChuru Member Posts: 3,075
    Bubb wrote: »
    Mmm, well I would have said "absolutely" before I looked at it, but the way I've implemented it abstracts away the actual opcode...

    Would require a major rework of the mechanism to store the originating effect instead of just the Lua function. Does what you are trying to do require access to the originating opcode?

    If it's that hard to do it, then don't worry about it right now. I just asked in case it was easy.
  • BubbBubb Member Posts: 998
    EEex has been able to alter the actionbar for a while now via a combination of EEex_AddActionbarListener() and EEex_SetActionbarButton(), but, admittedly, it is difficult to persistently target specific creatures using these mechanisms.

    Would an Opcode #404 be desired, which changes a specified button on the target creature?
    Grammarsalad
  • OlvynChuruOlvynChuru Member Posts: 3,075
    Bubb wrote: »
    EEex has been able to alter the actionbar for a while now via a combination of EEex_AddActionbarListener() and EEex_SetActionbarButton(), but, admittedly, it is difficult to persistently target specific creatures using these mechanisms.

    Would an Opcode #404 be desired, which changes a specified button on the target creature?

    That would be nice!
    switGrammarsaladCrevsDaak
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2019
    1. Is 'parameter2' of opcode #251 (Change bard song) functional?
    2. Is STATVAL.2da functional?
  • BubbBubb Member Posts: 998
    @Luke93:

    1) No. It appears only the resref field is used.

    2) It has to do with how the engine recommends you equip certain items when you are moving them around the inventory. The VALUE column is multiplied with the stat's real value, and the resulting number is added to a total "rating" count. The higher the rating, the better the item in the eyes of the engine.

    Any stat not listed in this file will be treated as a "0" towards the total rating. ARMORCLASS has a VALUE of -1 because lower is better, and so it needs to be flipped. It appears this file can be appended with any stat in STATS.IDS along with a multiplier to make the engine consider that stat when recommending equipment.
    CrevsDaak
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    Bubb wrote: »
    @Luke93:
    1) No. It appears only the resref field is used.

    Well, I noticed it's set to 1 for Shamans - both player created and enemies (e.g., BDTROLSH.cre)....
    CrevsDaak
  • OlvynChuruOlvynChuru Member Posts: 3,075
    I noticed that when an area script (or BALDUR.BCS) casts a spell, the effects of that spell have a source ID that's not 0. When I put something like EEex_GetActorStat(sourceID, 645) in my code, the game crashes if the source is an area script or BALDUR.BCS. How would I check whether or not an actor ID is pointing to an actual creature?
  • BubbBubb Member Posts: 998
    edited June 2019
    @OlvynChuru: A type field is stored at +0x4 for every game object. Every object type has a unique identifier; 0x31 is a sprite:
    local objectType = EEex_ReadDword(share + 0x4)
    if objectType == 0x31 then
        Infinity_DisplayString("I'm a sprite...")
    end
    

    Edit: Btw, here's all of the types if you are curious:
    0x0 = CGameObject::TYPE_NONE
    0x1 = CGameObject::TYPE_AIBASE
    0x10 = CGameObject::TYPE_SOUND
    0x11 = CGameObject::TYPE_CONTAINER
    0x20 = CGameObject::TYPE_SPAWNING
    0x21 = CGameObject::TYPE_DOOR
    0x30 = CGameObject::TYPE_STATIC
    0x31 = CGameObject::TYPE_SPRITE
    0x40 = CGameObject::TYPE_OBJECT_MARKER
    0x41 = CGameObject::TYPE_TRIGGER
    0x51 = CGameObject::TYPE_TILED_OBJECT
    0x60 = CGameObject::TYPE_TEMPORAL
    0x61 = CGameObject::TYPE_AREA_AI
    0x70 = CGameObject::TYPE_FIREBALL
    0x71 = CGameObject::TYPE_GAME_AI
    OlvynChuruCrevsDaak
  • OlvynChuruOlvynChuru Member Posts: 3,075
    @Bubb Thanks!

    Another question: how can I store a global variable at instant speed (i.e. as fast as a normal Lua function like EEex_GetGlobal)? Setting a global variable via a script action or an opcode is too slow. Using a Lua global won't work because those aren't specific to a save game.

    I just need a place somewhere in the save game data that's not being used where I can store a number.
  • BubbBubb Member Posts: 998
    @OlvynChuru: That would require a new function. I was looking at this a week ago and actually made some progress towards it; I'll have it uploaded either tonight or tomorrow.
    OlvynChuruCrevsDaak
  • fearlessfearless Member Posts: 40
    It take it you need a game variable that's stored in the GAM file? Is it possible to create one beforehand (I'm not versed on the exact details on how that's done so maybe its not something that can be done easily) and get the address of that game variable in memory (probably via some EEex function) and then use one of the fields that not been used? Not sure what version of the GAM format EE games use. Read/write directly to the address via other EEex functions (EEex_ReadDword, EEexWriteDword) - which wrap the VirtualProtect api and read/write to the memory address of the game variable field.
    Bubb
  • OlvynChuruOlvynChuru Member Posts: 3,075
    edited June 2019
    @Bubb Oh wow! I had no idea it was even possible to do that much! Looks good so far!

    The problem with posz not being saved could be fixed by having an effect that sets the height automatically trigger when the creature is spawned or the game is loaded. I've figured out ways of doing that without any additional help. One way is to have a permanent Invoke Lua opcode that does something if the source ID of the opcode is -1 (which it is set to when the game is loaded) and then sets the opcode's source ID the actor's ID.

    Disabling the bounce mechanism sounds good, though if that is too hard then setting a minimum possible value would be fine as well.

    Since you were able to set the Z Position value, is it also possible to set the Delta Z value? I remember there being something like that.

    The simplest way of dealing with the height map is to have an opcode that makes a sprite always be rendered on top of everything else, like flying creatures are. (This was actually something else I was going to ask you for.)

    It would be better for the height to be changed via Lua, since if that is possible then an opcode could also do it (with opcode 402).

    By the way, that B3SetPosZ function could also be used to represent a creature falling from a great height.
    Post edited by OlvynChuru on
    BubbCrevsDaaklolien
  • fearlessfearless Member Posts: 40
    Raining monsters spell, lol
    OlvynChuruBubbGrammarsaladCrevsDaak
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2019
    1) What is STATE_ILLUSIONS? When does it return true (i.e., what opcodes set it to 1)?

    Edit: it seems to be BLUR bor IMPROVEDINVISIBILITY bor MIRRORIMAGE bor INVISIBLE. Can you confirm?

    2) What about STATE_HARMLESS?
  • OlvynChuruOlvynChuru Member Posts: 3,075
    edited June 2019
    @Luke93

    From what I can tell, the states in STATE.IDS that aren't a power of 2 are combinations of other states. STATE_ILLUSIONS, for example, is a combination of STATE_INVISIBLE, STATE_IMPROVEDINVISIBILITY, STATE_BLUR, and STATE_MIRRORIMAGE (the IDS value for STATE_ILLUSIONS is gotten by adding the IDS values of those four states).

    I think that StateCheck(NearestEnemyOf(Myself),STATE_ILLUSIONS) might check if the enemy has at least one of those four states, but I haven't tested it.
    Bubb_Luke_CrevsDaak
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    @OlvynChuru

    Yes, you're right. In particular, you can BOR the base STATEs (i.e., all those listed at offset 0x0020 of a CRE file) to form all the others.....

    So, STATE_HARMLESS is FEEBLEMINDED | CHARMED | IMMOBILE..... and IMMOBILE is HELPLESS | STUNNED | SLEEPING :)
    OlvynChuruCrevsDaak
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    edited June 2019
    Once again, I'd like to know if a certain feature is functional or not....

    @Bubb What can you tell me of SPLPROT.2da and '0x106 - areatype (like outdoors, forest, etc)'? Is it functional? I'm asking because opcode #318 (AREATYPE != specified value, where 'value' is OUTDOOR) returns true in OUTDOOR areas :( (e.g., AR2600.are......)

    EDIT: sorry, it works now :) - I set 'relation' to 5 (not equal) in SPLPROT.2da, whereas the correct value is 9 (binary not match)...
    Post edited by _Luke_ on
  • BubbBubb Member Posts: 998
    Opcode #404 (OverrideButton) is now in master!

    Param1 is the button type to replace, (ids match what is defined by EEex_ACTIONBAR_TYPE in M__EEex.lua).
    Param2 is the button type to replace with, (ids same as above).

    Note that I implemented this opcode almost entirely in Lua, so let me know if the game is laggier than normal.

    My NI fork has been updated with the new opcode: download it here.
    OlvynChuruGrammarsaladswitCrevsDaak
  • The user and all related content has been deleted.
  • OlvynChuruOlvynChuru Member Posts: 3,075
    @Bubb Great! :)

    I've been doing some research testing the bounce mechanic. I cast a spell on Dynaheir that causes her corpse to jump out of her skin.

    xc68pggqwoyi.png

    Her corpse then walks up to Charname for the "do you want me back in the party" dialogue. But a few seconds later she freezes in place for a couple of seconds. This is the same issue you had shown when you used that function to change a creature's height.

    Fortunately, I've found a way to fix that freezing thing. Applying any effect to the immobile character ends that freezing thing and lets them move as normal. I think I could probably deal with the freezing problem on my own if you could give us ways to change a creature's height and change or possibly disable the bounce effect.
    fearlessAasimCrevsDaakBubb
  • _Luke__Luke_ Member, Mobile Tester Posts: 1,535
    Luke93 wrote: »
    Once again, I'd like to know if a certain feature is functional or not....

    @Bubb What can you tell me of SPLPROT.2da and '0x106 - areatype (like outdoors, forest, etc)'? Is it functional? I'm asking because opcode #318 (AREATYPE != specified value, where 'value' is OUTDOOR) returns true in OUTDOOR areas :( (e.g., AR2600.are......)

    EDIT: sorry, it works now :) - I set 'relation' to 5 (not equal) in SPLPROT.2da, whereas the correct value is 9 (binary not match)...

    Wait - do you have this working in the unmodded game, or only with EEex?

    Unmodded, EEex is not required...
    GrammarsaladCrevsDaak
  • AasimAasim Member Posts: 591
    OlvynChuru wrote: »
    I cast a spell on Dynaheir that causes her corpse to jump out of her skin.

    Hahahahahahah.....I can't wait to see v3.0 of HP BG.
    OlvynChuruCrevsDaakFlashburn
  • GrammarsaladGrammarsalad Member Posts: 2,582
    edited June 2019
    Bubb wrote: »
    B3_CuBar.lua and Opcode #405 (OverrideButtonIndex) are now in master!



    B3_CuBar.lua =>

    Enables customization of a character's actionbar ingame through a graphical interface. Simply hold shift with the character you want to alter selected, and change the buttons as you wish, like so:

    oqagw1v8ugkl.gif

    Note that for the sake of fair play only buttons that are already available to the character / don't provide new powers are able to be swapped in. Release the shift key when done editing the actionbar.

    To enable, flip
    ["B3_CuBar"] = false,
    

    to true in EEex_INI.lua



    Opcode #405 (OverrideButtonIndex) =>

    Overrides a button based on index and actionbar configuration:
    Param1 = Button index to override
    Param2 = Button type to override with
    Special = Actionbar config to match (-1 to match any class home)



    @OlvynChuru: Your bounce mechanic override will be the next thing I do. :)

    Cool!

    Regarding B3_CuBar.lua.

    I vaguely remember that there was a spontaneous casting mechanism that also used the shift key(i.e. hold the shift key to cast cure light wounds instead of any first level priest spell, for instance). I still have to go through the thread, so maybe I'm wrong, but is there a conflict?
    Post edited by Grammarsalad on
    BubbGusindaCrevsDaak
Sign In or Register to comment.