New Opcodes, Triggers, and Actions, oh my!
Grammarsalad
Member Posts: 2,582
I'm no @bengoshi , but I figured that I would try to put together what is known about new opcodes/actions/triggers/etc that will be rolling with the 2.0 release, and speculate their use. Join the Beta Grammar, you say? Yes, I should do that, but I'll just be spending my time tinkering with different opcodes. I would be no use.
Anyway, most of my information will be coming from here:
https://forums.beamdog.com/discussion/47588/change-log-for-v2-0#latest
Also, checking the Tobex readme:
http://www.shsforums.net/topic/48114-tobex-modder-reference/
Opcodes:
- Opcode 232 (Cast Spell On Condition) now supports spell states as conditions
So, if you're confused, charmed, etc. Very cool.
- Opcode 144 can now disable access to the inventory screen when param2 is set to 15
- New Opcode: Make Unselectable (Opcode 365)
Interesting. This is the highest opcode number found in the log as far as I can see. DLTCEP (in BGEE) maxes out pretty much at 342 with 360 being something about "breaking point". Some of the slots in between will likely be unused, but we might see maybe 15 or so usable opcodes or so (pretty wild guess, but eh).
- New Opcode: Saving Throw vs. School (Opcode 346)
Maybe this has something to do with externalizing specialist bonuses? In any case, it's a welcome addition.
- New Opcode: Selective Enchantment Bonus (Opcode 344)
There was a blurb about the magic weapon affecting equipped weapons rather than creating new ones. Perhaps they use this opcode?
Actions
- New Action: MoveToObjectOffset()
- New Action: DisplayStringPointLog()
- New Action: DisplayStringHeadNoLog()
Maybe this displays text overhead?
- New Action: SetGlobalTimerRandom()
- ForceRandomEncounter("") now clears the queue of forced encounters
Triggers
- (TobEx) New Trigger: ImmuneToSpellLevel() (17273)
From Tobex Readme:
"Returns true if the target creature specified by Object is protected from spells of power Level. This returns true for both Protection from Spell Levels (102) and Decrementing Spell Immunity (201) effects."
- New Trigger: StoryModeOn()
- New Trigger: OriginalClass(O:Object*, I:Class*CLASS)
I know that @subtledoctor was interested in something like this...
- New Trigger: ClassLevel()
- New Trigger: IsForcedRandomEncounterActive()
Externalizations:
- (TobEx) NPC reactions to pick pocket attempts have been externalized to PPBEHAVE.2da
OKay, this has a lot of cool potential. Tobex appears to do this via trigger/action commands. In any case, I'd love to get a peek at that 2da!
- (TobEx) The effects of the default bard song have been externalized to BARDSONG.spl
Was already pretty moddable, but cool.
- Status icons have been externalized to STATDESC.2da and can support any spell icon
Okay, if this means what I think it means, I'll be pretty happy. I'm assuming, maybe wrongly, that this will allow us to easily create portrait status icons. I could be wildly mistaken.
- (TobEx) Spellcasting failure due to damage has been externalized to CONCENTR.2da
Very cool. Here is everything Tobex has to say about the matter:
"Option: TobEx gives the option of implementing a concentration check affecting spellcasters being hit. Instead of always being interrupted when hit, spellcasters have a chance of their spells being interrupted. In the current implementation, a spellcaster passes the concentration check if:
(1D20 + luck) > (spell level + damage taken)
Option: TobEx gives the option of not interrupting a creature's spellcasting if a creature takes zero damage (i.e. immune)"
I wonder if we can tweak this even further. Again, I'd love to get a peek at that 2da.
- Variables in-game can now be set from baldur.lua using SetPrivateProfileString('Global','VariableName','1')
I have no idea what this means!
Anyway, most of my information will be coming from here:
https://forums.beamdog.com/discussion/47588/change-log-for-v2-0#latest
Also, checking the Tobex readme:
http://www.shsforums.net/topic/48114-tobex-modder-reference/
Opcodes:
- Opcode 232 (Cast Spell On Condition) now supports spell states as conditions
So, if you're confused, charmed, etc. Very cool.
- Opcode 144 can now disable access to the inventory screen when param2 is set to 15
- New Opcode: Make Unselectable (Opcode 365)
Interesting. This is the highest opcode number found in the log as far as I can see. DLTCEP (in BGEE) maxes out pretty much at 342 with 360 being something about "breaking point". Some of the slots in between will likely be unused, but we might see maybe 15 or so usable opcodes or so (pretty wild guess, but eh).
- New Opcode: Saving Throw vs. School (Opcode 346)
Maybe this has something to do with externalizing specialist bonuses? In any case, it's a welcome addition.
- New Opcode: Selective Enchantment Bonus (Opcode 344)
There was a blurb about the magic weapon affecting equipped weapons rather than creating new ones. Perhaps they use this opcode?
Actions
- New Action: MoveToObjectOffset()
- New Action: DisplayStringPointLog()
- New Action: DisplayStringHeadNoLog()
Maybe this displays text overhead?
- New Action: SetGlobalTimerRandom()
- ForceRandomEncounter("") now clears the queue of forced encounters
Triggers
- (TobEx) New Trigger: ImmuneToSpellLevel() (17273)
From Tobex Readme:
"Returns true if the target creature specified by Object is protected from spells of power Level. This returns true for both Protection from Spell Levels (102) and Decrementing Spell Immunity (201) effects."
- New Trigger: StoryModeOn()
- New Trigger: OriginalClass(O:Object*, I:Class*CLASS)
I know that @subtledoctor was interested in something like this...
- New Trigger: ClassLevel()
- New Trigger: IsForcedRandomEncounterActive()
Externalizations:
- (TobEx) NPC reactions to pick pocket attempts have been externalized to PPBEHAVE.2da
OKay, this has a lot of cool potential. Tobex appears to do this via trigger/action commands. In any case, I'd love to get a peek at that 2da!
- (TobEx) The effects of the default bard song have been externalized to BARDSONG.spl
Was already pretty moddable, but cool.
- Status icons have been externalized to STATDESC.2da and can support any spell icon
Okay, if this means what I think it means, I'll be pretty happy. I'm assuming, maybe wrongly, that this will allow us to easily create portrait status icons. I could be wildly mistaken.
- (TobEx) Spellcasting failure due to damage has been externalized to CONCENTR.2da
Very cool. Here is everything Tobex has to say about the matter:
"Option: TobEx gives the option of implementing a concentration check affecting spellcasters being hit. Instead of always being interrupted when hit, spellcasters have a chance of their spells being interrupted. In the current implementation, a spellcaster passes the concentration check if:
(1D20 + luck) > (spell level + damage taken)
Option: TobEx gives the option of not interrupting a creature's spellcasting if a creature takes zero damage (i.e. immune)"
I wonder if we can tweak this even further. Again, I'd love to get a peek at that 2da.
- Variables in-game can now be set from baldur.lua using SetPrivateProfileString('Global','VariableName','1')
I have no idea what this means!
9
Comments
It's good to know that the limit of 9 kits per class is finally lifted.
I wonder if they increased the kit limit
It looks like I'm not going to get a chance to try the beta. Could you do me a huge favor, and create a character in ToB and see if there are any changes to the HLA screen (especially a scroll bar like the one for kits?)
Sorry, I only have access to BG:EE's public beta at the moment. You'd have to ask someone else for testing BGII:EE and its HLA's. Maybe @bengoshi can help you.
Awesome
Edit: no druid spells, anyway
https://forums.beamdog.com/discussion/48233/shaman-specifics#latest
https://forums.beamdog.com/discussion/comment/716951#Comment_716951
This makes me hopeful that those projectile s and animations will be present making it easier to add iwd spells
Looked at two items in the game that gives save vs school bonus (a morningstar with +2 vs Alteration and an amulet with +3 vs Necromancy).
The problem is: how this opcode distinguish schools? No Resource was allocated, the parameter1 is their respective bonus and parameter2 is zero for both.
I'm failing to reverse-engineer this one, can anyone explain to me how this works?
What were the names of the items?
BDBLUN01 (Mosela's Cudgel -> gives +2 bonus vs Alteration)
Is there a list more complete than this one anywhere? The last entry in this list is opcode #321.
I was able to locate mschool.2da, but IDK where to input the Necromancy code. I can see no field labeled as Special or something like this.
This image is from the amulet. I can see the P1 and P2, but the Necromancy code (25269) is nowhere to be found.
The value for Spell School is the same as it when assigning it to spells, Necromancy = 7. Mschool.2da just defines the strings for each school when dispelled, listed in order.
The special field is labeled and includes a list of schools in Near Infinity.
In DLTCEP its that field labeled "Variable?".
http://gibberlings3.net/forums/index.php?showtopic=25516&page=1
That's the way I coded it: GWCDSort is launched at each level (part of the CLAB file).
You can decide to only prevent one spell or more...
Thanks!
Create an innate spell myspell.spl with one header and no effects.
Add one Casting feature effect:
opcode: 172 Spell: Remove Spell [172]
target: 1 Self
timing: 1-Permanent
resource: SPPR103
resist: 0-Nonmagical
Then in your CLAB.2da file, add the following line: Notes: Replace GWCDSORT with MYSPELL. My CLAB file has 50 columns (level). You can restrict it to 40.
Then at each level, the spell MYSPELL will be launched on your character and will remove SPPR103 from his spellbook. So he won't be able to learn it.
Hoping it is more understandable than my code intended to forbid all the cleric spells from level 1 to 4.
Now I'm trying to understand how to set the area of effect of a spell, but I'll reverse-engineer something. Currently, I'm killing every living being in Easthaven.
The first one is the same, but thanks WeiDU, allows to write all the effects automatically on the fly. Helpful when it comes to deal with too numerous spells and to manage compatibility with various installs providing different codes for the same spells.
Right now I'm just trying to discover how I can make a party friendly spell centered on the caster with 30-foot radius area of effect.