Scripting questions, discussions, etc
5 posts Page 1 of 1
Posts: 80
Joined: Mon Jun 19, 2017 7:28 pm
by bsisko » Sun May 26, 2019 8:53 am
I having trouble getting the following code to work. I have this code in a function of the game.cs script in server folder. I'm trying to set the noCursor property of the playGui to 1, and it doesn't work. It needs to be in the game.cs script rather than the playgui.gui script because I need the user to select controls on the playGui gui, so that when I hide the controls the user will be able to navigate the world with the mouse.

Code: Select all

function DemoSignMin() { // Set the demosign into the loweer right hand corner DCSign.setVisible(false); DSign.setPosition(500,400); DSign.setExtent(200,100); DSign.setVisible(false); PlayGUI.noCursor = "1"; }
Posts: 1598
Joined: Sun Feb 08, 2015 1:51 am
by Duion » Sun May 26, 2019 6:44 pm
The location of the script does not matter, it can be anywhere, you only have to worry about the execution order so that the script is available where you want it.

For example I don't write any scripts in the .gui files or at least try to and instead create a playgui.cs file where I place the scripts.
Posts: 495
Joined: Tue Feb 03, 2015 9:50 pm
by Azaezel » Sun May 26, 2019 8:06 pm
As you say you're running this on servers and wanting clients to use it, look into the commandToClient + clientCmd
and the
commandToServer + serverCMD communications paradigm.

The former tells the client to run something locally, and the latter tells the server to do something it's end.
Posts: 80
Joined: Mon Jun 19, 2017 7:28 pm
by bsisko » Sun May 26, 2019 9:04 pm
I will give it a try Azarzel
Posts: 104
Joined: Fri Dec 29, 2017 4:34 pm
by Hodo33 » Fri Nov 29, 2019 7:36 pm
Look in core/scripts/client/cursor.cs

function showCursor()
if ($cursorControlled)

function hideCursor()
if ($cursorControlled)

hope this helps
5 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest