-
Posts
7,936 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Rick
-
Plus, before publishing you can do a output of a count to get a total entity count and then make a progress bar off of that to make it 100% accurate with entity count.
-
You can do an animated loading screen in Lua. But both in C++ or Lua you will have pauses as the models get loaded. Map:Load() has a callback function called for each entity. That's where you would cycle through the images and then you'd call Context:Sync() to show that to the screen.
-
It shouldn't be. Map:Load() is a blocking function and doesn't come back until it's done as far as I know (yes it calls the callback for each entity it loads but shouldn't come back from the Load() call in order to reach your context:Sync() in your main loop). The world doesn't have anything to do with 2D drawing though as far as I know, but even then Sync() on the context is what draws to the screen the 2D stuff. I must be missing something here because that doesn't make sense to me how this is working. How long does your map take to load? Can you post your entire App.lua file? Yeah, I just tested that if you don't call Context::Sync() nothing is drawn to the screen. I just get a white screen, so I don't think this is perhaps working the way you think it is. How are you getting out of your ShouldSwitchMap() function because there is no if check in there to see if you should indeed switch maps, so if that function is being called all the time in App:Loop() then it would be switching maps all the time. So my impression is whatever you are seeing was left over from the last frame that Context:Sync() was called in, but that wouldn't be what you are drawing in the map loader callback. That's why it confusing and seeing you App.lua would probably clear things up.
-
I tried recreating this using the exact names and it was fine after a restart.
-
So yesterday I created a prefab named CornStalk. I gave it 4 children all named CornStalk. The base CornStalk is a csg shape with a script attached and the invisible material on it. The 4 children CornStalk is an actual model that I had to scale down to 0.001. I wake up this morning and the below is what I see! 4 extra CornStalk's added to each child. I did not put these here. LE did somehow. This happened with a couple other prefabs that I did the same thing with, but surprisingly it didn't happen with some others that had the same setup. I cannot seem to reproduce this as of yet but LE is doing something very odd here. Also, I cannot see the CornStalk's at all now in the 3D view. If I bring a new CornStalk prefab in then they look fine. I close and reopen LE and it still looks fine (so far). No clue why LE decided to make these extra children.
-
Did you try downloading LuaJit or just plain Lua? I seem to recall plain Lua didn't work, but LuaJit did as I believe the state is different between the 2. Either way it sounds like you meant just using the same files and not requiring an LE project so yeah, same same there. I just wasn't sure what you were meaning by your fist sentence. OP Josh seems to include the source as well, so you can either include lib or source: E:\Steam\steamapps\common\Leadwerks Indie Edition (this is my path via steam but you can find yours). There is an include and library folder that has the libs/sources for the Lua library.
-
You always want to check that Pick returned true (since it returns true if it actually picked something and false otherwise). http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/world/worldpick-r502 Are you walking up to a wall? Note that generally the GetPosition() of a character model will return it's feet position which may be too close to the ground. Store that off in a Vec3 and add a little to the y so it moves up. Also do the same +y to the 2nd point. If all else fails make 2 small cubes in Start() and always position those at the 2 points you are testing so you can visually see the start and end of the raycast. Just hide() these cubes at the start of Update() and show then again at the end so they don't get picked. Make your radius value different than 0 maybe? Play around with the last parameter (collision type). This will be the collision value for this ray, which means it'll adhere to this chart about collide or not (http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/collision-r778) The default value is 0, which I would think is None, which I wouldn't think would collide with anything but I could be wrong on that. I generally specify something there.
-
local pickInfo = PickInfo() local castPos = pickInfo.position if(castPos:DistanceToPoint(playerPos) <= self.Range) then What is castPos? Normally you do a Pick passing in the pickinfo. That pick fills in the pickinfo variable and then you use the filled in variables. You aren't calling a Pick before you use pickInfo.position means nothing is filling position in with anything of value.
-
@Aaron Does that work for you? It seems like it wouldn't because when you load the map it should call that callback function for each entity it's loading, but you are drawing to the context, but it is my understanding that whatever you draw to the context will not actually be displayed until context:Sync() is drawn (http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/context/contextsync-r48). I don't see that being called in your LoadingScreen() function so how would what you are drawing there be shown on the screen?
-
They are shared yes. I don't know if it's global or I think it might be just shared between any instance of that script. If you know C++ you can think of them as static variables inside a class. You'd get the same effect if you made a local at the top of the script I believe.
-
Yeah, I've used NuGet in VS with .NET stuff but never in C++. Personally I think you should download the Lua source and just include it into your project. It's only like 2-3 files. You might need to get LuaJIT as I believe LE uses that.
-
I remember having a basic wireless keyboard about 5 some years ago and thought it was sweet, until I started playing FPS games with it. The lag was noticeable and just pissed me off. It's scarred me for life on wireless keyboards.
-
What do you mean by this? Do you mean just the same version or are you talking about exposing this stuff in an LE C++ project? Because you don't have to include your stuff inside the LE C++ project. You can make your entirely separate DLL that has nothing to do with LE at all. As long as you are using the same Lua version as LE (which you can just download from the lua website. don't know about using nuget with C++ for lua. I just downloaded the lua source and put it into my C++ DLL project.) you can load your separate DLL in from a Lua file in an LE project. I've done this before when I made a joystick DLL for someone and exposing networking via RakNet for myself.
-
This installation of Lua, did it include the entire source or just the lib or lib/dll?
-
If I recall correctly Josh leaned on a contractor heavily for Linux stuff who did have a lot of experience. I could be wrong but I recall him talking about a contractor for that stuff. Personally it would be interesting if Josh could write the editor with node-webkit using WebGL for the 3D viewport. This would give a consistent look on all platforms. I know he likes the idea of the editor looking like the platform it's running on but I think that's overrated. It would be better to have the editor loot exactly the same on all platforms and only require 1 codebase that node-webkit could possibly give him. Perhaps the issue is WebGL doesn't support OpenGL 4.
-
Yeah, you'd want to draw it before you load the map. This also means you'd have an extra self.context:Sync(false) most likely after you draw your "Loading..." text using the context.
-
The idea with that is basically an array of char right? Can't you just have that be a table in Lua and do the translation of the table to char* and back? So GetPixel() will return a table that is acting as an array, and SetPixel() takes the lua table as an argument and inside the C++ code it converts that table to char* and calls the C++ version of SetPixel(). It may not be a direct translation from C++ but it can still look like it's working the same way from the users end.
-
Yeah that would probably be the ideal, but a quick win or low hanging fruit, or other corporate jargon would be to just expose GetPixels()
-
Shadmar was able to create a thief like light detection but had to make a custom exe in C++ to expose GetPixels(). Can we get this functionality exposed by default with LE so everyone can enjoy this system? http://www.leadwerks.com/werkspace/topic/11991-csg-shape-to-mimic-light/
-
Very cool. Sort of a shame Lua only users don't have this functionality as whenever a new update happens for them they have to pick either get no new exe updates or this exe
-
RakNet was bought out by Oculus VR. I'm pretty sure it's free now.
-
When you jump do 2 raycasts only at certain distances in "front" of the player. 1 around the shoulder height of the character (play around with this height) and another at the feet. If the shoulder one doesn't hit anything AND the feet one does that means you are jumping at an edge area. If you are also moving forward, then do the parkour thing.
-
I can try to answer some. - You can load anything at run-time so you can create randomly generated worlds. That's more on your ability to make such a world make sense. - You can have multiple LE "Worlds" at the same time. If you are talking about LE terrain though I believe you can only have 1 of those. There are a lot of obstacles to overcome with such an idea. There is no loading assets on another thread, but loading already loaded assets are basically instant so you can perload your models and then over multiple frames make instances of those models and place them where you want. - Standard edition allows C++ which will be faster but I don't think we are talking massive speed increases that most of us indie people will hit up against. The nice thing is that the C++ version gives you more freedom to add other C++ libraries, which there are many. - I believe there is a Blender exporter for models so if you have used that before then no other software really needed. - No clue on sounds - You can make any mode of game you want, but that's on you to code that. - No magic bullet here. If you are a C++ programmer I recommend RakNet as it's 100% free and open source now and I personally like working with it. You would use that to make your own server app (console most likely as including LE for the server app requires your server to have a gfx card that is compatible and most servers don't and really shouldn't require this). Include it in your LE client app and make them talk. Multiplayer is a huge deal though. It can and often gets very complex.
-
You don't need mingw. Make a DLL project in Visual Studio, include the newest Lua (Lua-JIT maybe) source, and have at it. Note that this will be specific to Windows though. If you want it cross platform you'll need a different compiler (I think mingw is windows only too). Maybe gcc.
-
Congratulations getting Leadwerks GamePlayer Greenlit.
Rick replied to Gonan's topic in General Discussion
@domi It's not out yet.