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 11-18-2008, 07:54 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Local GUI controls

I think it would be nice to have a way to create GUI controls locally to an NPC... similar to this.vars.

Since GUI's are pretty much global, it wouldn't be hard for a script from one person to overwrite the script of another, simply because they named their window, "Window". This way, controls will only be accessible by the same NPC, and eliminate any interference from outside scripts, or cause any interference.

I'm not sure how it would be done, but I still think it would be a nice addition.
Reply With Quote
  #2  
Old 11-18-2008, 03:08 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Methinks you could use an md5 hash to insure a unique name for the gui control, then just use your object variables to point to it.
PHP Code:
temp.controlname md5(timevar2);
new 
GuiWindowCtrl(temp.controlname) {
  
thiso.windowctrl this;
  
// blah
}
this.windowctrl.visible true
__________________
Reply With Quote
  #3  
Old 11-18-2008, 03:58 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Inverness View Post
Methinks you could use an md5 hash to insure a unique name for the gui control, then just use your object variables to point to it.
It's easy to find out names of all controls though, so it still doesn't really achieve the same effect that Dusty's suggestion would.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #4  
Old 11-18-2008, 05:45 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by xXziroXx View Post
It's easy to find out names of all controls though, so it still doesn't really achieve the same effect that Dusty's suggestion would.
Dusty's suggestion is a way to avoid name conflicts and use local variables instead, which is what I provided.

My suggestion eliminates unintentional overwriting of GUI controls based on name conflict.
__________________
Reply With Quote
  #5  
Old 11-18-2008, 08:05 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Inverness View Post
Dusty's suggestion is a way to avoid name conflicts and use local variables instead
Quote:
Originally Posted by DustyPorViva View Post
I think it would be nice to have a way to create GUI controls locally to an NPC... similar to this.vars.

... controls will only be accessible by the same NPC, and eliminate any interference from outside scripts, or cause any interference...
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 11-18-2008, 08:45 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by xXziroXx View Post
Quote:
Originally Posted by DustyPorViva
Since GUI's are pretty much global, it wouldn't be hard for a script from one person to overwrite the script of another, simply because they named their window, "Window".
I think it's obvious hes talking about unintentional actions.
__________________
Reply With Quote
  #7  
Old 11-18-2008, 11:19 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Inverness View Post
Methinks you could use an md5 hash to insure a unique name for the gui control, then just use your object variables to point to it.
PHP Code:
temp.controlname md5(timevar2);
new 
GuiWindowCtrl(temp.controlname) {
  
thiso.windowctrl this;
  
// blah
}
this.windowctrl.visible true
I also think it would be more efficient if the data never has to leave the weapon, don't you?
Reply With Quote
  #8  
Old 11-18-2008, 11:32 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by DustyPorViva View Post
I also think it would be more efficient if the data never has to leave the weapon, don't you?
The way I provided is less efficient than the normal way because you're generating a hash, setting a global variable, then setting a local variable rather than simply setting a global variable like you would normally.
__________________
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 10:46 PM.


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