Skip to content

New engine feature: Tweak op122/255#5

Open
4Luke4 wants to merge 3 commits into
Bubb13:develfrom
4Luke4:item
Open

New engine feature: Tweak op122/255#5
4Luke4 wants to merge 3 commits into
Bubb13:develfrom
4Luke4:item

Conversation

@4Luke4
Copy link
Copy Markdown

@4Luke4 4Luke4 commented Apr 18, 2026

This pull request introduces hooks for the Create Item opcodes (op122 and op255), enabling custom logic to be executed before and after an item is placed by an effect. These hooks provide better control and tracking of item creation and placement, including the ability to override item flags and track the equipment slot in which an item is placed.

New Create Item opcode hooks:

  • Added Opcode_Hook_CGameEffectCreateItem_BeforePlaceItem and Opcode_Hook_CGameEffectCreateItem_AfterPlaceItem function declarations to EEex.h, allowing logic to run before and after an item is placed by an effect.
  • Implemented Opcode_Hook_CGameEffectCreateItem_BeforePlaceItem to override item flags with effect flags if present, and Opcode_Hook_CGameEffectCreateItem_AfterPlaceItem to track and store the equipment slot of the placed item in Lua state, or clear it if not equipped.
  • Registered the new hook functions with exportPattern in main.cpp, making them available for use in the engine.

See also Bubb13/EEex#117.

4Luke4 and others added 3 commits March 27, 2026 19:07
Add .gitignore entries to exclude Google Drive File Stream temporary files (.tmp.driveupload, .tmp.drivedownload) so transient local upload/download artifacts are not committed to the repository.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant