![]() |
GUI Issue
I'm new to the GUI functions in Graal and I'm certain I'm overlooking something simple with this error, but here goes.
I am writing a Class NPC to implement the flier script Ziplock had requested be made awhile back, if anyone remembers that. Right now, I have the window being created in Clientside in the CLASS. However, when if I hit the red X, the GUI window disappears and walking into the flier image again will not open the GUI window back up. Do I need to implement onCloseQuery to get this to work desirably? PHP Code:
|
Resolved:
for future reference, enabling destroyonhide will fix this. |
Quote:
if (guiwindowname != NULL) guiwindowname.destroy(); When redrawing guis. |
rather than make anew thread, I'll insert this issue here.
Again, I am sure this the noobness instead of a legitimate issue here, but... in Scroll Control, inside a Window Control, I am attempting to add text using a MLTextObject. PHP Code:
I have tried appending the text and then anotehr </font> tag, I have tried using the format functionality - Tests have shown this.text is a valid string so I am certain the issue isn't with actually getting data. Could use help with this. UPDATE: Upon further review, I am finding that the this.text actually doesn't exist clientside but it does serverside. I tried using a triggerclient in the class but found that doesn't work for getting the string to clientside. Any suggestions? |
Since you're accessing a GUI control, you'll need to use thiso.text rather then this.text.
|
Quote:
Uh, regardless, this.text isn't transitioning properly from serverside to clientside. Once I get that fixed, the other errors should be fixed. So, any ideas on how to synchronize across serverside and clientside? |
Quote:
I don't see why you wouldn't be able to pass it by triggering the client though. |
Quote:
Server is impractible because there is a potential for over 9000 (:)) NPCs to join the class and use it. Alright, further research has shown that a Class NPC cannot do what I am looking for it to do (triggerclient doesn't work for non weapon/GUI scripts). So I guess my next question would be, can I triggeraction to the client if I use an on function? Ok, verified I can't. am I to assume I am out of luck and it is impossible to pass information the clientside of a Class NPC? |
Quote:
|
Quote:
|
Alright. Still not working as intended unfortunately, but I'm willing to guess I messed up somewhere since I've never tried using attributes like this.
PHP Code:
|
Mind posting the entire code?
|
Class script:
PHP Code:
PHP Code:
|
I dont see this.text being declared in either of the scripts serversided, that's why it returns NULL.
|
Quote:
that means in the NPC, this.text will become whatever the params were. |
Doh, there I go not reading properly again, sorry.
Try debugging it by doing: PHP Code:
|
this.text displays "test", this.attr[0] is coming null.
So it seems that using an attr will be impossible, which leaves me in quite a predicament if I can't triggerclient in a class. :( |
Try using this.attr[1]. I don't think attr[0] works.
|
Yea, isnt attr[0] non-existant?
|
this.attr[1] resolves the issue.
Thanks guys :D |
Quote:
|
3 Attachment(s)
Hmm...
gonna bump this thread rather than creating a new one. I'm trying to create a custom GUI profile, and I'm sticking this in a class so I can easily use each profile in multiple NPCs. However, when I call createGUIs, the new profiles aren't working properly. NPC Code PHP Code:
PHP Code:
|
Not sure if it helps but I generally make functions public inside classes if they are going to be called outside the class.
Then again whats the actual problem? Does nothing happen or does the profile look all weird? |
The function itself is clientside, though you are calling it serverside :oo:
|
He's not calling the function outside of the original NPC so he doesn't need it to be public. Also, you only need to create profiles one time (do it from like a system WNPC) not for every npc. Profiles are global variables just like GUIs so once you create them, every npc can use them.
|
| All times are GMT +2. The time now is 07:57 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.