Search the Community
Showing results for tags 'Scripting'.
-
I've spent the last few days creating a simple self contained server browser. It will list all the servers of a specific game, allow the user to select a server and send a callback with the selected info. Requirements: The script from this topic placed in a file here: Scripts/Functions/eventqueuemanager.lua The Script: A simple example: It will create a server and open a server browser window. + Starts the move mode, click to exit it. X closes the window. import("Scripts/Functions/eventqueuemanager.lua") import("Scripts/serverbrowser.lua") local window = Window:Create() local context = Context:Create(window) local server = Server:Create() System:Print("Server1 publish::" .. tostring(server:Publish("Example Temp Test Server", "Testing population of server list from masterserver "))) server:Release() function test(ip,port,close) -- callback function System:Print("Callback") System:Print(ip) System:Print(tostring((close == true) and "close" or "")) end local serverbrowser = serverBrowser("Example Temp Test Server",context,0,0) -- create the serverbrowser serverbrowser:SetCallback(test) -- set callback -- do stuff while true do if window:Closed() then return end if window:KeyHit(Key.Escape) then return end Time:Update() context:SetColor(0,0,0,0) -- need to clear alpha!! or the gui will stay on screen!! context:Clear() EventQueueManager:Update() context:Sync() end serverbrowser:ClearCallback() -- remove callback serverbrowser:Release() -- release everything The server browser will obey the limits of your window. If any part of it is not on screen, it will be pushed back onto it. Edits: -2017-8-24: -Added the ability to directly connect to a ip and port. -Moved the code to put the window into a function and check on server browser creation. -2017-8-25: -Added the abilitiy to automatically resize to fit inside the bounds of the current context
-
- scripting
- networking
-
(and 3 more)
Tagged with:
-
Good evening, As Mentioned in the caption - is there a possibility to link Notepad++ to Leadwerks engine so that if I press F5 it "compiles" ? Would be super Awesome! yours Max Aigner
- 5 replies
-
- programmers
- notepad
- (and 4 more)
-
I'm having an issue when I try to execute local entity = self.entity:Copy() I get an error "Script classname sin not found." The self.entity in question has a script named Sin.lua attached. Any ideas? EDIT After renaming and reattaching the script file, everything seems to work for now... Does it have to do with the fact that I've edited it in the external editor?
-
I'm looking to see if there is a way to detect if the game is running in the lua sandbox (example: in the game player) or as a standalone game? I would like to detect this so I can use IO to read and write settings in standalone and load the defaults with the sandbox enabled.
-
So for the last couple of days I've been trying to make my own FPSPlayer script with the help of some other users. I managed to do everything I wanted but there's one problem. I don't know how to fix this error. Script Error error in function 'Pick'. argument #4 is 'nil'; 'value' expected. Line 465 The script is a combination of Aggror's FlowGUI FPSPlayer and my own, that's probably why it doesn't work. Any help would be appreciated! FPSPlayer New.lua
- 13 replies
-
- scripting
- physics and inventory
-
(and 1 more)
Tagged with:
-
Hi I went through the Object script tutorials and I've gotten that crate model to rotate. I've also tested out the Pick example for the Camera class. Now my question how do I make a Camera object that I placed in the editor to do a "Pick" on the crate model then have that model rotate (and maybe even play a sound)?