llde / xOBSE

Oblivion Script extender source
243 stars 35 forks source link

Suggestion: add syntax to allow adding event handlers directly. #212

Open ir4ne opened 11 months ago

ir4ne commented 11 months ago

Suggestion: add syntax to allow adding event handlers directly.

Event handlers are probably the best feature that has been added to OBSE in recent years. However, unfortunately, it does not completely eliminate the need to use quest scripts for handling events: you still need to call SetEventHandler somewhere. I suggest making a syntax that would allow xOBSE to register handlers at game startup automatically, for example:

scn NewSyntaxExample

String_var filename

begin SetEventHandler_LoadGame { filename }
   ...
end
llde commented 11 months ago

Adding a block for every event is unfeasible unless I can patch the compiler to interpret that. Otherwise we could rely on a begin OnEvent "event" filter1 filter2

EdMSL commented 9 months ago

unless I can patch the compiler

Is it even possible?

llde commented 9 months ago

Possible is possible.

EdMSL commented 9 months ago

It would be great