Lua hooks needed!
#71
That would be reasonable. Pity that I cannot do that myself.
Reply
Thanks given by:
#72
Really? I could also just add another category, makes more sense to me, it's still the same project.
Reply
Thanks given by: Taugeshtu
#73
True, that's what I meant all the time, just didn't realise the difference between a project and a category, sorry.
Still, no submissions?
Reply
Thanks given by:
#74
well I added the "Plugin API" category now
Reply
Thanks given by:
#75
An idea: how about changing the OnChunkGenerated hook to trigger *before* the chunk is added to the world, and having the same parameter set, as OnChunkGenerating - ChunkX, ChunkZ and ChunkDesc. It could then use ChunkDesc to do some last-minute changes to the generated chunk.

Why: If a plugin uses OnChunkGenerated() and modifies the chunk, the changes sometimes don't get propagated to clients that already queued that chunk for sending. This is the easy fix. Also it makes the API a bit more flexible.
Another reason: I'd like to add new hooks, OnChunkUnloading (self-explanatory name) and OnChunkAdded, that would trigger each time the chunk is loaded or generated (in cWorld:SetChunkData() ). And it would be quite ugly if the hook fired in this sequence: OnChunkGenerating - OnChunkAdded - OnChunkGenerated. It'd be much more logical to have OnChunkGenerating - OnChunkGenerated - OnChunkAdded. But that is possible only if we change the logic of the OnChunkGenerated that the chunk is not yet added to the world.

How many headaches have I just caused? Smile
Reply
Thanks given by:
#76
I suppose, nil of them Smile Actually, now I'm wondering why it wasn't done this way in the first placeBig Grin
Reply
Thanks given by:
#77
Because OnChunkGenerated was done before we had cChunkDesc (cLuaChunk at that time), it was easy to add, unlike the cChunkDesc class. Smile
Reply
Thanks given by:
#78
Done in rev 1193. Now the wiki...
Reply
Thanks given by:
#79
The wiki is almost done, hook-wise, so it's about time we get new hook requests Smile
I, for one, am thinking about a HOOK_WEATHER_CHANGING hook that would be called *before* the weather is changed and will allow plugins to refuse the change.
Got any new ideas? Go put them in the flyspray bugtracker.
Reply
Thanks given by:
#80
Seems good Smile
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)