[BG1/2 REQUEST: Opcode 177: Use EFF File]
Galactygon
Member, Developer Posts: 412
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
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
3
Comments
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: Note that param2 would reference the condition number.
-Galactygon
I'll post a concrete example on how this would work. If our 177COND.2da looks like this: 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: 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
make sure you drop some of the devs' names so that they see your request. @SethDavis, @Nathan and @Coriander will do
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
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
@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
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". Well, targeting specific creatures is possible with 146/206. But no way to read variables, indeed.