Author Topic: Canvas Functions  (Read 3002 times)

Hai der.  I've been messing around with trying to make a gui for a dedicated server.

I used initCanvas(Twinkle) to get the... well to get the canvas up and running.  But I've been having trouble trying to use Canvas.setContent(GuiProfile, testgui) to start the gui stuffs.  I don't actually know if <--that syntax is correct, as I don't have my notes here at work.  I know I got the syntax correct while testing it out at home though, for it stopped giving me error messages, and just crashed instead.  Yay progress.

I know Badspot has changed Blockland's engine alot since he started making it, so I went back to a copy of v0002.  Lo and behold it worked perfectly!

Given the evidence before me, either Badspot has locked up the dedicated server pretty tight, and it can no longer run a gui at all, or the dedicated server does not run some key scripts needed to run a gui.  In which case I need to go through the client startup stuffs and find which ones set up the guis so I can force feed my server some beautiful gui love.

Anyhow I'm wondering if anyone else has done this before, if anyone knows which scripts set up the gui love, or if anyone has any tips about gui-making in general(All I've done so far is put up a background image).

The dedicated server cannot run the gui, all clients that shall see the gui must download the gui add-on.
As for showing the gui you would use canvas.pushdialog(somerandomgui);

The dedicated server cannot run the gui, all clients that shall see the gui must download the gui add-on.
As for showing the gui you would use canvas.pushdialog(somerandomgui);

I may not have been clear in my intentions.  I don't mean for the clients to see the gui at all.  It's specifically server-sided.  You start the server and, just like when you start a blockland normally, a second window pops up.  Only instead of the main menu it shows a bunch of buttons like, kick, ban, mute, kill etc.  Click the buttons and stuff happens.

The server cannot run gui.
Gui is client-sided.

I'm not sure what exactly you are trying to do, are you trying to get some sort of external window running next to your dedicated server?
If that is what you are trying to do you need to create that as an external program and connect it to the dedicated server with TCP objects.

to get some sort of external window running next to your dedicated server?
Yup.

If that is what you are trying to do you need to create that as an external program and connect it to the dedicated server with TCP objects.
I'm trying to make an add-on that runs inside of Blockland.  Not an external program.

The server cannot run gui.
Do you have any expertise in that area?  If so, what have you tried?

Do you have any expertise in that area?  If so, what have you tried?
The dedicated server doesn't even have a second window to display the gui, so how do you think that would work?

The dedicated server doesn't even have a second window to display the gui, so how do you think that would work?
if you learned to read instead of talking,  you would realise that the methods mentioned in the OP should cause the gui to appear and populate.

 on the other hand, I have no expertise in this area. I would advise tracing a normal client and seeing what functions are called to cause the gui to appear.

 I'm not sure this is possible from our limited access to the backbone of torque.

if you learned to read instead of talking,  you would realise that the methods mentioned in the OP should cause the gui to appear and populate.
I have tried to put gui on a dedicated server and the only thing that happened was that the server crashed

It's not possible without code injection.

The normal client and the dedicated server have the exact same codebase. The entire special handling of the -dedicated switch is written in TorqueScript, which means they both have exactly the same things available from the engine. A dedicated server could easily decide to start up the canvas and GUI stuff if it wanted to, it's just a matter of finding the right procedure of doing so.

OP, I got to the point where I have a black canvas with a red dot that follows my mouse. Is that where you are currently?

I have tried to put gui on a dedicated server and the only thing that happened was that the server crashed
You are talking about something different. We are talking about creating the canvas itself.

We are talking about creating the canvas itself.
So that is why the server kept crashing when loading the gui file?

So that is why the server kept crashing when loading the gui file?

No, it's because you're creating GUI objects before creating the canvas.

OP, I got to the point where I have a black canvas with a red dot that follows my mouse. Is that where you are currently?
Yeah.

I just got some of the basics, like a window and the console. I'll try refining it a bit.

Edit: Running my new, stripped-down client increases memory usage by ~17.6 Mb. Does anybody know if that is a significant problem?
« Last Edit: March 31, 2013, 09:44:19 PM by Greek2me »