Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   Deconstructor? (https://forums.graalonline.com/forums/showthread.php?t=80032)

projectigi 06-10-2008 05:29 PM

Deconstructor?
 
hi,

it would be nice to have a function that is called when someone updates a weapon but before the update occurs.

cbk1994 06-10-2008 06:13 PM

Perhaps a call, but don't wait for it ...

Otherwise, you could do something like this:

PHP Code:

function onWeaponUpdatednameOfWeapon )
{
  while ( 
true )
  {
    
sleep0.05 );
  }


Personally, I really don't see a use. Your scripts should be coded in a way that if that happens, they can keep on going.

zokemon 06-12-2008 07:07 AM

Quote:

Originally Posted by cbk1994 (Post 1396181)
Perhaps a call, but don't wait for it ...

Otherwise, you could do something like this:

PHP Code:

function onWeaponUpdatednameOfWeapon )
{
  while ( 
true )
  {
    
sleep0.05 );
  }


Personally, I really don't see a use. Your scripts should be coded in a way that if that happens, they can keep on going.

Oh god, all hell would break loose!

bscharff 06-13-2008 01:29 AM

onCreated is triggered on any sort of update...
I'm probably misunderstanding the request.

cbk1994 06-13-2008 01:34 AM

Quote:

Originally Posted by bscharff (Post 1396677)
onCreated is triggered on any sort of update...
I'm probably misunderstanding the request.

Yes, he wants OTHER scripts to be alerted before a weapon is updated.

projectigi 06-13-2008 08:00 PM

More like the script itself + other Scripts :p

Chompy 06-13-2008 08:41 PM

wee, would be so much better if we could catch dynamic events.. :( Could just do a catchevent() on the onCreated event :o

Skyld 06-13-2008 09:06 PM

Quote:

Originally Posted by Chompy (Post 1396869)
Could just do a catchevent() on the onCreated event :o

You could just use function onCreated(). I can't believe you even suggested such a ridiculously stupid thing.

projectigi 06-13-2008 09:20 PM

well, nope

its like

update script
onCreated()

but i want

onUpdate()
update script
onCreated()

:p

Skyld 06-13-2008 09:29 PM

Quote:

Originally Posted by projectigi (Post 1396873)
well, nope

its like

update script
onCreated()

but i want

onUpdate()
update script
onCreated()

:p

I was referring to Chompy's idea of using catchevent on onCreated as being stupid - not this. Although the problem is that the serverside would have to wait for this update function to complete, which sometimes if abused, it never will, and the clientside has no idea that the script has updated until it's been updated anyway.


All times are GMT +2. The time now is 06:03 PM.

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