Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-25-2005, 05:10 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
WeaponLoaded event

It would be nice if the clientside portions of weapons received events anytime any other weapon was loaded. See, I have a weapon called Kai_Binds whose purpose is to filter keyboard events and then trigger other weapons. These weapons have to register interest with Kai_Binds in order to receive the events, and they do this by calling a public function. Thereafter, their details are stored in this.variables.

But if I edit the Kai_Binds' script while somebody is playing then suddenly the system breaks down. The this.variables are lost, so Kai_Binds doesn't know about the other weapons anymore. Even worse, those weapons don't know that it doesn't know about them, so they can't remind it. That's where my suggestion comes into play. If they were informed when Kai_Binds is reloaded, they could re-register and everything would be fine.

It could also be useful in, say, a custom Q-menu. Instead of constantly checking the player's weapon list, the menu could simply wait for a WeaponLoaded event and add the new weapon to the list.

The events could possibly be restricted to post-login weapon loads, to reduce overheads? Either way, I can't imagine it being too much effort to implement
ALSO, GIVE ME V4 ACCESS >:O
__________________
Reply With Quote
  #2  
Old 05-25-2005, 05:17 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
v4 access has already too many people.

PHP Code:
function onCreated()
{
  for (
oweapons)
    
o.trigger("WeaponLoaded",this.name);

Magic.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #3  
Old 05-25-2005, 05:19 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally Posted by Velox Cruentus
v4 access has already too many people
So kick out some of the dead weight

Quote:
PHP Code:
function onCreated()
{
  for (
oweapons)
    
o.trigger("WeaponLoaded",this.name);

Not exactly the most elegant solution, is it? For the Q-menu thing, you'd need to add that code to every weapon.
__________________
Reply With Quote
  #4  
Old 05-25-2005, 05:24 PM
Velox Cruentus Velox Cruentus is offline
Registered User
Velox Cruentus's Avatar
Join Date: Dec 2004
Location: Quebec, Canada
Posts: 465
Velox Cruentus is on a distinguished road
Send a message via ICQ to Velox Cruentus Send a message via AIM to Velox Cruentus
PHP Code:
function onCreated()
{
  
this.join("thingseveryweaponshouldhave");

It can serve other purposes as well.

Not the most elegant solution, but a pretty nifty contour in the meanwhile.
__________________
In a world of change... Who'll you believe?
Reply With Quote
  #5  
Old 05-25-2005, 05:38 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Well, I agree that it's a suitable workaround, but it's nowhere near as convenient as the system I described.

I think the portability of scripts is gonna become an increasingly important factor as Graal develops. For example, people should be able to casually add standard, open-source Q-menu scripts to their servers without editing all of their weapons.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:27 PM.


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