Originally Posted by
Gleeok
You're going to have to expand that idea and clarify what you mean with some sort of implementation detail then, because I don't understand how what you are suggesting is even possible.
You mean user-defined callbacks?
I was thinking that a user could set them up, sort of like a jump. Put an insertion point in a piece of code, and if a callback references the 'jump point', it executes that code starting at the specified point. So, you would use the @ Handle to reference a function, and the defined value for the jump point:
Code:
void foo(){
//instructions
//instructions
$jump_identifier
//other instructions
}
user_callback(jump_identifier, @foo)
Not sure if it is feasible, but I thought it would be interesting. There may be more idyllic ways to do it. In fact, it may be possible to allow setting some kinds of special engine conditions in the programme, labeling them, and using them as callbacks; which would, probably require setting them up in ZQuest. I would think though, that dmap IDs, items in use, eweapons in use, and the lot that I posted above, would all be useful events for this sort of thing, and you didn't even comment on those.
This would be mostly useful in a script series where a defined series of events was logical. Taking
@ywkls
Metroid thing as an example, you would want an onSamusNoHP() callback, that was linked to the custom HP system. For one of my quests, I may want OnIsInSpace() as a callback. Who knows. The point, is that if it could exist as an option, may as well make it possible.
I was mistakenly reading the labels for some of these things as specific callback instructions though. That was my fault. I though that OnLinkDeath(ON_DEATH, @function_to_run) was how you were doing it, which was silly. This was probably because DD and Gray were discussing it two weeks ago, and the message OnDeath() was one of the proposed things from that chat.
I don;t think that this kind of callback is actually something that I have used to date. C/Cpp don;t support them. I don;t recall if Ruby does, but I've never used them. I avoid Java/J++ like the plague. I see how useful they would be, don;t mistake me. I just want to ensure that the implementation is sane and streamlined.
I'm not sure how these would be written so that adding callback types internally wouldn't be a gigantic pain. By this, I mean, writing the source-code side of things to define the event and wrap it in something, because our present 'events' are strewn through classes in a wherever-fashion. I would think that would all need fixing.
I will add however,
onLinkDrawing ...
onLinkWeapon(weapon)
and similar.
onCollision(type) is also good, if I missed that above. Simplify the hell out of those.
Other suggestions:
onWarp(type)
onRolLCredits
onIntroScreen
onTitleScreen
onNameEntry
Howzat?