-
Posts
27 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Posts posted by tomis13lack
-
-
weird - i'll try remaking the project
-
Attempting to compile with codeblocks and getting that error. I have tried copying the contents of the "Include" folder from common/Leadwerks to the Sources folder and the error went away but now i get a "zlib.h: No such file or directory" so i assume i wasnt supposed to do that.
Had leadwerks for a little while now but im still not all that sure how to use the C++ extension. I want to try to make this game with as little lua as possible.
-
On 8/2/2017 at 2:40 AM, AggrorJorn said:
I would make a single player strategy game set in fantasy medieval times. The key part is that the world map you play in is dynamic but has active factions/kingdoms. Think Totalwar/Mount and blade like. On this world you can zoom in to a playable map. The map itself is perstistent in terms of buildings.
When you have build a base, you can come back later to that map with its origial base. For instance when an enemy AI is attacking.
mine would be quiet similar to yours, as i am a big fan of mount and blade. The only difference would be live battle simulations. If you click on a battle you can watch what goes on. Time will realistically progress during the battles, big battles will have battle camps, no fighting at night because of chivalry (with an option/chance of a night battle because of deception where you/the aggressor lose honor but get an advantage). If you want, you can take control of one of your commanders (but not vassals. You would play as a commander but the vassal controls the army. Gameplay would be like the Freelance mod in M&B but you might have control of a division) during their battles. While traveling, you can "zoom in" and see the party itself traveling and things around it. You can interact with spots on the world map.
-
What does the DisplayProgressbar do? I would check (assuming it is not a function i am to make) but I do not have access to a working leadwerks,
-
Any variable or function I can call to check if it is loading? Trying to make a conditional for a loading screen
-
On 11/29/2017 at 7:44 AM, K0nan98 said:
function Script:UpdateWorld() if(srvr == nil) then srvr = Server:Create(8888) srvr:Publish("GG2", "GoodGame",10) client = Client:Create() end cnt = client:CountServers("GG2",15) --print("Count of servers = ") --print(cnt) if window:KeyHit(Key.T) then aa = client:GetServer(0) bb = aa.addres print(bb) bb = "127.0.0.1" client:Connect(bb,8888) client:Send(1,"Connected") end msg = srvr:Update() if(msg ~= nil) then print("Msg =") print(msg) end end
Hello! PLS help me. When writing such code and clicking on 'T', as a result, messages from the client do not come and the ip server is always equal to "nil". Please help me. Sorry in advance for maybe a stupid question. Output: msg = absent; bb = nil; cnt(if enable) = 1;
I'm not too experienced in this so i may be wrong (I havent done networking yet) but i believe you spelled "address" wrong on line 13. Don't know if that is the only problem
-
What is the best game you have played that was developed by the leadwerks engine? Any games that have a lot of cool features? Any games that are just really fun to play? Post here.
-
-
Fixed with a fresh install of steam... weird
- 1
-
Those who make a standalone game might want an installer for it. It makes the game seem more professional. I have created a small NSIS script for those who want to use it to accomplish this. You will need to change stuff. I put the vital things you need to change on lines with 6 #'s.
It doesn't look that good but NSI is really simple. Fixing it up should be easy.
The #'s are comments. # comments 1 line but i used 6 around the text as an attention getter. semicolons as well as /*'s are also used for commenting on this.
OutFile "GameInstaller.exe" !define pathToGame "C:\Users\**USERNAME HERE**\Desktop\**Gamename**\" ######Replace as you see fit###### InstallDir "C:\Program Files (x86)\NameofGame" ######Replace as you see fit###### Section SetOutPath $INSTDIR File /r ${pathToGame}\* WriteUninstaller $INSTDIR\uninstaller.exe SectionEnd Section Desktop MessageBox MB_YESNO "Create a Desktop Shortcut?" /SD IDYES IDNO end CreateShortcut "$desktop\myapp.lnk" "$instdir\gamename.exe" ######Replace gamename.exe with ur game's exe file###### end: SectionEnd Section -Prerequisites ######Any prerequisites go in here. I used OpenAL as an example###### SetOutPath $INSTDIR\OpenAL32 MessageBox MB_YESNO "Install OpenAL32?" /SD IDYES IDNO end ###Asks if they want to install openal in a message box File ${pathToGame}\dependencies\openalinst.exe ###i put the openal installer in a dependencies folder ExecWait ${pathToGame}\dependencies\openalinst.exe ### actaully installs openal end: SectionEnd Section "Uninstall" Delete $INSTDIR\uninstaller.exe Delete $INSTDIR\gamename ######Replace as you see fit###### SectionEnd
You need NSIS for this. Here is a link: http://nsis.sourceforge.net/Download/
How to use it:
Step 1. Paste the script in notepad
Step 2. Save the script as install.nsi (or whatever-u-want.nsi)
Step 3. open with NSIS and compile. If you have installed NSIS you should be able to compile by right clicking the nsi file and clicking "Compile with NSIS"
Step 4. Enjoy
the installer has everything in it. It will work on any system. You do not need anything but the installer to install.
- 1
- 1
-
-
5 hours ago, Thirsty Panther said:
Thank you. I would really like to know how to do an animated loading screen with C++ as this only tells you how to make a static loading screen with lua. Do you know what i could run as a condition to check to see if it is loading and create a loading screen if it is? For example:
... while(isLoading()) { //some code to create the animated loading screen } ...
5 hours ago, cassius said:Some of the c++ examples in the api reference could get you started.
I can't see any c++ examples for networking. I see the syntax of the command and that is it. From there, i have no idea of where to go.
I know C++ but have no idea how to use it with leadwerks and not mess everything up. I don't even know where to begin if i want to add something to it. I can make a separate function but would have no idea how to set it up to be called. I do not know how to associate in game things with C++. Could anyone with a considerable amount of experience give me an example (even if just a small one) or a list of commands/classes/etc. that i will be using in leadwerks C++?
-
Decided to do this one as well simply because I thought "why not." I am sure that Josh is quite busy so i'll try to do some of the more annoying/tedious stuff for now:
Function Overloading
Functions can be "Overloaded." An overloaded function is a function that exists with different arguments. This can be used for some functions that you may want to run with different argument types. This may also be used to allow default values and to avoid compiling errors:int addOne(int num) { return ++num; } int addOne() { print("There is no argument"); } addOne() //Output is nil, but it prints "There is no argument" addOne(5) //Outputs 6
- 1
-
**Before I do this, i want to let you know that I am not well experienced in leadwerks C++. I am using what i know to combine it. I do not know any wait commands in leadwerks so i made my own. I am also not sure if that is how it wants the keys. Please fix as you see fit**
Just in case someone is to need it:
Do...While Loops
Like, the while loop, the do...while loop continues looping over its code until a condition is met. The only difference is a do...while loop runs the code once before checking the condition. The syntax is as follows:
do { //code to be executed } while (condition)
The example below can be pasted into your "main.cpp" script file to see how do...while loops work. In this example, I am using a while loop like from the previous example. The do...while loop makes it so when you first start, it displays the "Tab menu" for 5 seconds. It will do nothing until tab is pressed again and it will display the tab menu for 5 seconds after the tab button is released and all of the time in between.
#include <unistd.h> // Library used for usleep #define sleep(a) for(int i = 0;i<a;i++) {usleep(500000);usleep(500000);} // Creating a wait command for timing where "a" is the seconds //Create a window Window* window = Window::Create(); //Create a rendering context Context* context = Context::Create(window); // While loop while (window:KeyHit(Key.Esc)==true) { //Do...While loop do { //Set the drawing color and clear the screen context->SetColor(0,0,0); context->Clear(); //Set the drawing color and blend mode context->SetColor(1,1,1); context->SetBlendMode(Blend.Alpha); //Draw some text onscreen context->DrawText("This is the Tab Menu!",2,2); //Update the screen context->Sync(); sleep(5) } while (window:KeyHit(Key.Tab)==true) }
- 1
-
I have a computer running Debian Buster. Upon running, it shows the "Create a project" page. If one is to create a project, it closes (cannot find an error - cannot open without steam therefore cannot open in terminal). If I open it again, the project is still not there. The project does exist in the leadwerks project folder.
I would give inxi results or specific paths but i am not on this computer at the moment.
-
While I am asking, i should probably ask about loading screens as well. I have absolutely no idea how to create one of those.
-
I know C++ and lua is really easy. When I say I know C++ quite well i mean in every way except practice. I have the C++ addon on steam and have no idea where to go from there. I am trying to make a multiplayer game. I saw the Connect, client, etc. from the api but have no idea how to implement them. Can anyone reference a tutorial or anything?
P.S. I have a Poweredge T410 with 2, 4 core Xeons and 96Gb of ram for this server - will that be good enough for ~64 players (a relatively simple first person shooter).
P.P.S. Linux compatibility is high on my priority list. Would I just copy + paste anything i do to windows, to linux for that?
-
I got everything fixed except one thing. Thui appears now and everything but the mouse is still locked when this happens. This problem did not occur before. Also if you click on some of the buttons the game crashes
-
I think i should also add:
old:
local windowstyle = Window.Resizable+Window.Titlebar if System:GetProperty("fullscreen")=="1" then windowstyle=windowstyle+Window.FullScreen end window=Window:Create(title,0,0,System:GetProperty("screenwidth","1024"),System:GetProperty("screenheight","768"),windowstyle) window:HideMouse()
new:
local windowstyle = 0 local winwidth local winheight
there seem to be a lot of new local variables and stuff and i am not sure the usage. Is there anything i should keep?
Edit: Also, i added in thui initialize and the import and it runs now, but thui isn't working. When you go to anything that would open up a menu, all effects occur except the menu itself. Game gets paused and everything but no options.
Edit 2: Forgot thui update. that is fixed.
-
What is this "Menu.lua" and what is it for? It is imported in the updated main.lua but not the old. What should i do with it?
-
3 minutes ago, DoomSlayer said:
I also use THUI and its working fine.
The update most likely changed your main.lua so you need to modify your main.lua again to work with thui.
To make sure, try to find in your main.lua:
import "Addons/THUI/THUI.lua"
you say it most likely changed it. Does this mean it will have entirely reverted it? Will i have to rewrite things i put in there?
i did have to add the line again but same error.
-
I haven't worked on my game in a while. When i went onto it it said it needed updated. I updated it and now the game will not run. It gives this error:
Quote"C:/Users/admin/Documents/Leadwerks/Projects/game2/Addons/THUI/Core.lua" : 61 : bad argument #1 to 'insert' (table expected, got nil)
No changes had been made since and it ran fine then. Only one map is still able to run, but the map isn't functioning properly as everything is black. When run in debug mode it says 0 polygons, etc. (0 everything)
this game was last updated in april of this year.
I am assuming this is because of the thui update, but i am not sure where i would be able to find the revisions i would have to make.
-
I will try making a window for it. If i do it this way, is it possible to set system properties (launch options to an extent) from this window for the next window? An example of this would be if i were to make this window with a button that says "Click here for fullscreen" and you click it, could it set the system property "fullscreen" to true?
-
I would like to add a launcher to the game to allow settings to be initially set before launch. Is this possible? If so, is it possible without the professional pack?
Lua Static Loading Screen
in Programming
Posted
So I made this script that allows you to have a static loading screen entirely in lua.
https://steamcommunity.com/sharedfiles/filedetails/?id=1676105035
How it works:
In Main.lua, I took out the chunk of code from the WHILE loop that renders the world, and instead moved all that to a function called ShouldMapChange().
ShouldMapChange simply does all of the world rendering IF the map should not change. If it should, it renders a static loading screen image then proceeds to change the map. You can then change the map by calling the ChangeMap function. It only allows a static loading screen but that is MUUUCH better than looking at a black windows "Not Responding" while it loads imo.
In the script, I give you the option of using an actual image (texture), which usually looks better. If, however, you don't have one there is an else statement which allows manually drawn loading screens with text.
Enjoy!