-
Posts
7,936 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Rick
-
Is it possible to have a camera screen be a texture?
Rick replied to MisterGravity's topic in General Discussion
http://www.leadwerks.com/werkspace/topic/8103-gameplay-tutorial-requests-here/ Last link on the first page. Bookmark that topic because we'll be adding lots to it and I will update the first page to make it easier to fine -
I would be curious to see if that works, but I don't think coroutines are real threads. It just simulates them.
-
After you load your prefab in code just call it's Start() function. local prefab = Prefab:Load(path) prefab.script:Start()
-
I think this can be solved now with the new collision script that has enter/exit? Are you teleporting instantly or trying to do what portal does where you can see your character 1/2 and 1/2 in both. If teleporting instantly then look at my teleport video tutorial. It uses the enter/exit and before I send to the other portal it disables the destination portal so the collision that would happen when over there won't happen until I exit and come back. http://www.youtube.com/watch?v=dTaSP1fKD7c
-
Blender is a great 3D modeling program. It's free and has a ton of resources and I'm pretty sure it can export to FBX file format which Leadwerks can read/import. Often people are generally coders or artists with a few being able to do both. So if you haven't done any game creation be sure to try your hand at both and see what interest you more. They both take a lot of time to get really good at.
-
That's crazy!
-
That would just be positioning of the 'flashlight' (a spotlight) which I assume is created in that FPSPlayer script (I don't have it in front of me). You can just increased the Y value probably to raise it up. I assume that's all you mean? You can also increase the Z value some maybe to move it forward some, and the X value to move it left/right.
-
That would be great shadmar!
-
@ Kavex I agree that would be cool. It however could be more of a modeling thing than coding. I say could be because there are different ways to attack this problem. I could offload it 100% on the modeler and just have them make new arms for the flashlight and in code I just switch what model I'm using. Or, the modeler could make the 1 model but have different animations using all the possible "attachments" already in the model just hidden below it and only have it show during certain animations in the model. Like, Arms_Pistol_Idle, Arms_Pistol_Flashlight, etc. Or you can have the arms be 1 model, while the attachments be different models completely. Their animations could possibly need to be lined up still in order for it to look good, but then you would have bones on both models, and in code find the position of these bones and line them up (you could even parent one to the other if you like). I would love to do a tutorial on this, but I'm not an artist and so I'd need the correct models to work with first.
-
Lua itself has no graphic capabilities. Most "core" languages don't so it's not as if this makes Lua bad or the odd ball. People make libraries in a given language that expose this functionality. Leadwerks exposes some functionality via Lua to do certain things. I guess you'd need to give an example of what you are looking to do. If you are looking for what is called post processing effects (doing funky things to the entire screen) then that's shaders. It's very powerful and much faster and it's a good thing that it's not directly done on the CPU but on the gfx card itself because that's where shaders run. The good news is you can code shaders in all editions of Leadwerks. Go to the shaders folder and just dbl click one and it'll open it up for you in the shader editor. The bad news is shader programming takes a good amount of time to learn and is an advanced topic. Shader programming has it's own language that is like C++ and the language is an OpenGL thing not a Leadwerks thing. However Leadworks can add it's own touch in how it exposes things to shaders. As I said, it's a pretty advanced topic, but if you put the time in you can learn it.
-
That sort of stuff is best to be in shaders, which isn't Lua. It's a whole other deal. You can code them with Leadwerks, but it's different. You can do a search for shader programming for OpenGL.
-
How do you even get that? When I went using safari it brings me to what looks to be the mobile site. I'd prefer the actual full site myself
-
I downloaded the Steam iPhone app but I can't find out how to access the forums. Does anyone know of a way to do that?
-
@Marcus If something that doesn't have that variable hits the script I think the script would give an error. Doing a check that the variable exists should help avoid that. if entity.script.entityType ~= nil then if entity.script.entityType == "Player" then end end
-
Select the box in the scene tab. Go to the properties section under the Physics tab. There is a collision type dropdown. Select Trigger. You probably also have to attach the trigger script but I'm not sure if the tutorial goes over that or not.
- 1 reply
-
- 1
-
I think the link just above the list on the first page has a Lua tutorial.
-
Leadwerks 3.1 Indie access variables from other script ?
Rick replied to norbert's topic in Programming
This depends on if you need that information between runs of the exe too. Most of the time if you need that information saved between maps you also need it saved between runs. In that case I'd save the information to disk and load it back on each map startup. Leadwerks has file commands: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/stream/ http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/filesystem/ Use GetAppDataPath() to get the path your application should write too. You can then create any folder/file under this path for your game (like a save file). This makes sure it writes to the correct places per OS that is allowed by any security measures that OS has. If you only did want to save between maps then yes, it would be best to make a global structure that stores all the information you need, then load it back to the script information on a new map. I would make Save()/Load() functions that maybe do both so it's abstracted away. -
Updated first page. Thanks.
-
Leadwerks 3.1 Indie access variables from other script ?
Rick replied to norbert's topic in Programming
So 'self' will only mean the current script you are in. So when you use it in App.lua it means the variables and functions only in App.lua. Why are you looking at doing that in App.lua? You could do that in the FPSPlayer script if you like with self.camera:SetClearColor(). I personally don't like that a camera is created in that script though. https://www.youtube.com/watch?v=dTaSP1fKD7c If you watch this tutorial you can see how I remove that script from making the camera and bring in a camera as an entity to the scene and bring it in as a parameter. Once you do this, you could make a script and attach it to the camera entity and do what you want. Generally speaking you probably want to avoid changing App.lua unless you really are comfortable with the engine and have a very good reason to. -
Leadwerks 3.1 Indie access variables from other script ?
Rick replied to norbert's topic in Programming
I would use the FPSPlayer's script PostRender() function to draw this. You can access the context in that script with: App.context:DrawText() I say do it this way, because App is global and you'll only ever have 1 in your program, so accessing it in all the other scripts makes more sense. This way you can leave App.lua alone. Drawing information related to the player should go with the player script so you aren't making a dependency in your App.lua file that you may change later. If you ever remove that FPS script your App.lua file will give an error. However, you'll never remove App.lua. -
At about 3:20 you'll notice when he attached a collision trigger it shows all the parameters from the FPS player script. I get this all the time.
-
I put the first quote because it tells me you purchased this on Steam, where it talks about programming with Lua for the engine. I put the second quote because it also didn't say C# is not included or Java isn't included. Software generally doesn't say what's not included in its description. I'm assuming you knew about Leadwerks before Steam (I don't know your history and Leadwerks) and you knew it used C++ in prior versions and that 3.1 would at some point have a C++ version? If that's the case I feel for you, but the description on Steam for that version is clear. You use Lua to program the Leadwerks Steam edition. There were no tricks there. You are free to ask for a refund and maybe you'll get it, but don't blame Leadwerks for you not reading the description of the product. I don't want to come off as being mean, but just a fact of life. You have to read what you are buying and if you make a mistake (we all do) then own up to it (again ask for a refund if you need to), but blaming others isn't really fair.
-
Sweet! Thanks nate
-
Like Guppy is implying you'd have to use a 3rd party networking library like RakNet (or others) and integrate it into Leadwerks.