Skip to content

[BG1/2 REQUEST: Opcode 177: Use EFF File]

GalactygonGalactygon Member, Developer Posts: 412
edited August 2012 in General Modding
CURRENT BEHAVIOUR

At the moment the conditions for the effects nested in this opcode to occour is limited to IDS targeting.

REQUESTED BEHAVIOUR

It would be nice if there would be a way to customize the conditions to the degree that you can link external .bcs files to instances of this opcode. The conditions inside the .bcs file would be read

I'll list some examples that would be possible if this were implemented:
- creating an item/spell that grants certain bonuses during the day and penalties during the night
- emulating effects that base themselves on some stat (such as hitpoints for a Power Word spell)
- allowing spell effects to use variables in their conditions (at the moment it's possible to increment/set variables in .spl files)
- allow only a certain MYNAME.cre to be affected by some sort of effect if some quest has been completed

-Galactygon
Post edited by Galactygon on

Comments

  • GalactygonGalactygon Member, Developer Posts: 412
    SUGGESTED MEANS OF IMPLEMENTATION

    Because the unused space of the feature blocks within .spl and .itm files are limited to size 0x4, and custom .bcs files require a RESREF, I would pack that information into a master .2da file that lists all the conditions to be used by opcode 177. It's possible to amend .2da files with WeiDU, so intermod compatibility would not be a problem.

    This new .2da file (let's call it 177COND.2da) would have 3 columns: a condition number, a resref of the .bcs we want to link it to, and the block number within the .bcs file (a value of -1 would check for the first block that returns true)

    To preserve backwards compatibility, existing condition numbers would be hardcoded:

    2 EA of target has to match param1
    3 GENERAL of target has to match param1
    4 RACE of target has to match param1
    5 CLASS of target has to match param1
    6 SPECIFIC of target has to match param1
    7 GENDER of target has to match param1
    8 ALIGNMENT of target has to match param1
    Note that param2 would reference the condition number.

    -Galactygon
  • GalactygonGalactygon Member, Developer Posts: 412
    edited August 2012
    SUGGESTED MEANS OF IMPLEMENTATION (continued because I can't post long posts)

    I'll post a concrete example on how this would work. If our 177COND.2da looks like this:


    9 AATAQFGT 0

    then an effect nested in an instance of opcode 177 with param2=9 would only affect the target if GLOBAL AataqahFight=2 and would only work in AR0602 (because variable AataqahFight is tied to AR0602). That's because block no. 0 (column3) of AATAQFGT.bcs (column2) looks like this:

    IF
    Global("AataqahFight","AR0602",2)
    THEN
    RESPONSE #100
    DestroySelf()
    END
    Had I used -1 as a value in column3 of that row in 177COND.2da, the results would be the same because it would then apply the effect when any of the blocks return true.

    Note that param1 is ignored as well as any actions that are in the script block.

    -Galactygon
  • AndreaColomboAndreaColombo Member Posts: 5,525
    Hi @Galactygon,

    make sure you drop some of the devs' names so that they see your request. @SethDavis, @Nathan and @Coriander will do ;)
  • GalactygonGalactygon Member, Developer Posts: 412
    edited August 2012
    Thanks @AndreaColombo, I'll do it the next time.

    I also wish to add that in the event this request is fulfilled then the engine should read the conditions and apply the nested effect before moving on to the next effect in the effects list. I regularly embed opcode101 within a zero duration 177 to filter subsequent effects for certain creature types.

    -Galactygon
  • SethDavisSethDavis Member Posts: 1,812
    @Galactygon - why does everything you post make me cringe in terror >.<

    It might be possible, but at the moment I don't know how to access bcs files in code or how to pick out the condition and evaluate it. I'll try to keep this in mind if I ever figure that out
  • CuvCuv Member, Developer Posts: 2,535
    Since you didnt put it anywhere in the posts... for those that dont know. This is the Use EFF opcode:P Or I am sadly mistaken.
  • GalactygonGalactygon Member, Developer Posts: 412
    @Cuv: Thanks for pointing it out, the title is fixed.

    @SethDavis: I strive to post feature requests that cover multiple design features in a sustainable manner, so that it will then be possible to fully replicate features from other IE games with minimal effort. Which means less de-hardcoding work later - there's just too much that is hardcoded. I really care about BG(2):EE, and this aspect of BG(2):EE.

    -Galactygon
  • NathanNathan Member Posts: 1,007
  • AndreaColomboAndreaColombo Member Posts: 5,525
    @Nathan - passing the buck? ;D
  • ArdanisArdanis Member Posts: 1,736
    This is what I loved in NWN and would surely love to see in BG as well.
    Is it going to be safe to use in complex SPL structures? It the script referenced takes long to load, I imagine consequent effects may trigger, breaking the 146/177/206 "script".


    - allow only a certain MYNAME.cre to be affected by some sort of effect if some quest has been completed

    Well, targeting specific creatures is possible with 146/206. But no way to read variables, indeed.

  • NathanNathan Member Posts: 1,007
    @AndreaColombo nooooooookay, yes. Totally am. :D
Sign In or Register to comment.