Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 01-25-2012, 10:01 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 Pelikano View Post
Everything is a child of another GUI... even if it's just GraalControl...
Exactly, where do you think it defaults to a child of if you don't specify a parent?
Reply With Quote
  #17  
Old 01-25-2012, 10:30 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
you guys are pretty ignorant aren't you? Just place the code I supplied inside some weapon and try it out, if you set a variable to a TShowImg object it will not be added to the GraalControl, you have to do it manually.

however, it might be some v5, v6 issue, I am running v6
Reply With Quote
  #18  
Old 01-25-2012, 11:11 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by Pelikano View Post
Controls are only added to GraalControl by default if you do:

Graal Script Code:
  new GuiShowImgCtrl("SomeImg") {
    
50;
    
50;
    
width 71;
    
height 96;
    
image "era_sam_hiddencard.png";
    
visible true;
  } 
But, if you do it like the OP and create a GuiShowImgCtrl object first, then set it's attributes you have to add it to GraalControl manually:

Graal Script Code:
  temp.guiImage = new GuiShowImgCtrl("SomeImg");
  
guiImage.50;
  
guiImage.50;
  
guiImage.width 71;
  
guiImage.height 96;
  
guiImage.image "era_sam_hiddencard.png";
  
guiImage.visible true;
  
// Will not show! 
Test it yourself. I'd be very grateful if you'd stop being totally arrogant and obviously you are the one who has no idea in this case.
The first case will create a new GuiControl and assign it to a global variable called SomeImg.
In the second case, you're creating a new GuiControl and just assigning it to a temporary variable.

I don't have RC anywhere and haven't tried anything (so I'm not saying you're wrong), but both cases are just creating a new object. It seems silly that the two cases would be treated differently...
__________________
Reply With Quote
  #19  
Old 01-25-2012, 11:17 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
Quote:
Originally Posted by salesman View Post
The first case will create a new GuiControl and assign it to a global variable called SomeImg.
In the second case, you're creating a new GuiControl and just assigning it to a temporary variable.

I don't have RC anywhere and haven't tried anything (so I'm not saying you're wrong), but both cases are just creating a new object. It seems silly that the two cases would be treated differently...
try it out homie
Reply With Quote
  #20  
Old 01-25-2012, 11:18 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Pelikano View Post
Just place the code I supplied inside some weapon and try it out
Quote:
Originally Posted by Crow View Post
I did in the past and I still have some code running somewhere where I do it just like the OP.
Guess what.
__________________
Reply With Quote
  #21  
Old 01-25-2012, 11:19 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
some time in the past I had some code running somewhere that could predict the future
Reply With Quote
  #22  
Old 01-25-2012, 11:31 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by Pelikano View Post
some time in the past I had some code running somewhere that could predict the future
That's great! Thing is, as I said, I still have this code running in one of my testing WNPCs, and I've confirmed that it works just as well. So what the heck do you want anyway? This isn't exactly on topic anymore.
__________________
Reply With Quote
  #23  
Old 01-25-2012, 11:32 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by Crow View Post
That's great! Thing is, as I said, I still have this code running in one of my testing WNPCs, and I've confirmed that it works just as well. So what the heck do you want anyway? This isn't exactly on topic anymore.
post the code that works?
__________________
Reply With Quote
  #24  
Old 01-25-2012, 11:38 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by salesman View Post
post the code that works?
It's really not that complicated..

Graal Script Code:
//#CLIENTSIDE
function onCreated() {
  
with (new GuiWindowCtrl("Crow_TestWindow")) {
    
width height 256;
    
text "Rawr!";
  }

Is pretty much it. I removed unrelated things. Still works though.
__________________
Reply With Quote
  #25  
Old 01-25-2012, 11:43 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
That's not the same thing the OP is doing, I think you should read his code carefully then read yours, you might notice the difference.

Oh yeah you are NOT setting a variable to the object, which means your code is the same thing as:

Graal Script Code:
//#CLIENTSIDE
function onCreated() {
  new 
GuiWindowCtrl("Crow_TestWindow") {
    
width height 256;
    
text "Rawr!";
  }

It's just sad how ignorant some people can be and instead of apologizing for claiming people have no idea they won't admit that for once it's them doing something wrong lol
Reply With Quote
  #26  
Old 01-25-2012, 11:46 PM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
All above me:

__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #27  
Old 01-25-2012, 11:52 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Just tested on Testbed because I was curious:

Graal Script Code:
//#CLIENTSIDE
function onCreated() {
  
// This doesn't work
  
temp.gui = new GuiWindowCtrl();
  
temp.gui.width temp.gui.height 256;
  
temp.gui.text "Test!";
  
  
// but it works if you uncomment this line:
  //GraalControl.addControl(temp.gui);

edit: I thought maybe it didn't work because the GuiControl was just destroyed as soon as the reference to temp.gui was lost (i.e. when onCreated() returns), but it didn't work if I maintained a reference either (such as with this.gui instead of temp.gui).
__________________
Reply With Quote
  #28  
Old 01-25-2012, 11:54 PM
Pelikano Pelikano is offline
Registered User
Pelikano's Avatar
Join Date: Oct 2008
Posts: 1,133
Pelikano can only hope to improve
Quote:
Originally Posted by salesman View Post
Just tested on Testbed because I was curious:

Graal Script Code:
//#CLIENTSIDE
function onCreated() {
  
// This doesn't work
  
temp.gui = new GuiWindowCtrl();
  
temp.gui.width temp.gui.height 256;
  
temp.gui.text "Test!";
  
  
// but it works if you uncomment this line:
  //GraalControl.addControl(temp.gui);

edit: I thought maybe it didn't work because the GuiControl was just destroyed as soon as the reference to temp.gui was lost (i.e. when onCreated() returns), but it didn't work if I maintained a reference either (such as with this.gui instead of temp.gui).
Yeah, that's the same thing I posted. And it makes sense too if you think about it, you can't just make it add to GraalControl by default, because what if you want to add it to another GuiControl rather than GraalControl?
Reply With Quote
  #29  
Old 01-25-2012, 11:58 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004 Send a message via Skype™ to Tolnaftate2004
Quote:
Originally Posted by salesman View Post
Just tested on Testbed because I was curious:
...
What happens if you give it a name?
__________________
◕‿‿◕ pfa check yer syntax! src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote
  #30  
Old 01-26-2012, 12:02 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by Tolnaftate2004 View Post
What happens if you give it a name?
Same result. I didn't check if it was still creating a global variable with the name, though.
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:09 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.