Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Feature request (https://forums.graalonline.com/forums/forumdisplay.php?f=194)
-   -   Hooking scripts prior to default systems. (https://forums.graalonline.com/forums/showthread.php?t=134260667)

12171217 09-30-2010 03:12 AM

Hooking scripts prior to default systems.
 
Dear Stefan,

Allow certain weapon scripts to be executed before default systems are ran. Can be done like:

hookEvent(HOOK_PREMOVEMENT, "lolTest");

then lolTest() would be executed before the player movement logic is done each frame.

With love,
Downsider

MrOmega 09-30-2010 04:11 AM

I support this, please Stefan

Deas_Voice 09-30-2010 10:31 AM

state a example of usage please, i don't get what "hooking" into default systems would be good for (rather then making your own)

fowlplay4 09-30-2010 03:18 PM

then stuff like this could be easily done.

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
// Hook Level-link Function
  
hookEvent(HOOK_CHANGELEVEL"onChangeLevel");
}

function 
onChangeLevel(lvlxy) {
  
stupidFadeEffect();
  
waitfor(this"Faded"1.5);
  
warpPlayer(lvlxy);



cbk1994 09-30-2010 11:48 PM

I'd rather seen it done like in JavaScript

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
universe.onLevelChange = function (levelNamexy) {
    
stupidFadeEffect();
    
// etc
    
return true// false would cancel the default action
  
};



12171217 09-30-2010 11:52 PM

Quote:

Originally Posted by cbk1994 (Post 1603320)
I'd rather seen it done like in JavaScript

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
universe.onLevelChange = function (levelNamexy) {
    
stupidFadeEffect();
    
// etc
    
return true// false would cancel the default action
  
};



This is pretty much it, canceling the default action is also important.


All times are GMT +2. The time now is 12:52 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.