beo6 Posted February 4, 2014 Share Posted February 4, 2014 Have you tried self.camera:SetRange()? http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/camera/camerasetrange-r203 Quote Link to comment Share on other sites More sharing options...
MajorAF Posted February 4, 2014 Share Posted February 4, 2014 Do I create a new script or put it under the App.lua? Quote Link to comment Share on other sites More sharing options...
Rick Posted February 4, 2014 Author Share Posted February 4, 2014 Put this code in wherever you have your camera. If you use the default fpsplayer.lua then it creates the camera in there. Find that line in Start() and put the SEtRange() after that. Quote Link to comment Share on other sites More sharing options...
MajorAF Posted February 4, 2014 Share Posted February 4, 2014 I copy and pasted the whole thing under the self.camera = Camera:Create() and it says something about a model being a nil value? self.model:Turn(0,Time:GetSpeed(),0) <--- It points to this line. Quote Link to comment Share on other sites More sharing options...
Rick Posted February 4, 2014 Author Share Posted February 4, 2014 What whole thing? There should only be the 1 line that sets the range. Don't copy/paste the entire example from the doc. That would be incorrect. Quote Link to comment Share on other sites More sharing options...
MajorAF Posted February 4, 2014 Share Posted February 4, 2014 self.camera:SetRange(range.x,range.y) <-- This one? What numbers do I put in? If I try putting in 4096, 4096 all I see is blackness. The map size is 4096 by 4096. Quote Link to comment Share on other sites More sharing options...
Rick Posted February 4, 2014 Author Share Posted February 4, 2014 I think the first value is the min range and the last value is max. Try calling http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/camera/cameragetrange-r202 just once to get the default values. Then use the default min range, and just play around with the max range. If you want to do it in real-time you can wrap calling this function and increasing the max range when you hit a key or something . Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 4, 2014 Share Posted February 4, 2014 I think he requests a working tutorial, as turret is general for for lot of project game type. I'll try to do it in Lua. 1 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
MajorAF Posted February 4, 2014 Share Posted February 4, 2014 I think the first value is the min range and the last value is max. Try calling http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/camera/cameragetrange-r202 just once to get the default values. Then use the default min range, and just play around with the max range. If you want to do it in real-time you can wrap calling this function and increasing the max range when you hit a key or something . I don't understand. I think it would be easier to see a video showing how to do it. If someone ever has the time that would be great. Quote Link to comment Share on other sites More sharing options...
beo6 Posted February 4, 2014 Share Posted February 4, 2014 MajorAF: i don't think a Video just for adding a single command to a code is necessary. That you see blackness is correct when you set the minimum and maximum value to the same number. If you add a camera in the editor you can see in the camera tab that the default value is min: 0.1 and max: 1000. So if you want to have a higher viewing range you need to set max higher than 1000. If you create your camera by code you need to use the SetRange command. So most likely this line right after you create your camera: self.camera:SetRange(0.1,2000) -- double the viewing range 1 Quote Link to comment Share on other sites More sharing options...
MajorAF Posted February 4, 2014 Share Posted February 4, 2014 MajorAF: i don't think a Video just for adding a single command to a code is necessary. That you see blackness is correct when you set the minimum and maximum value to the same number. If you add a camera in the editor you can see in the camera tab that the default value is min: 0.1 and max: 1000. So if you want to have a higher viewing range you need to set max higher than 1000. If you create your camera by code you need to use the SetRange command. So most likely this line right after you create your camera: self.camera:SetRange(0.1,2000) -- double the viewing range Oh, so I cannot use the same number! I thought the first number meant X axis and second meant y axis. Thanks for explaining it. But how do I increase the view range in the Leadwerks Engine perspective view? Quote Link to comment Share on other sites More sharing options...
beo6 Posted February 4, 2014 Share Posted February 4, 2014 i don't understand. Which perspective view? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 4, 2014 Share Posted February 4, 2014 http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/camera/camerasetrange-r203 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Mordred Posted February 4, 2014 Share Posted February 4, 2014 I think he mean's within the viewport, the 3d view in the top left. But i neither think that this is possible, nor am i sure why one would want that in the editor. Quote Link to comment Share on other sites More sharing options...
Josh Posted February 4, 2014 Share Posted February 4, 2014 Yeah, there's no visual control in the editor for this. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
MajorAF Posted February 6, 2014 Share Posted February 6, 2014 How do games like Warthunder and Rust get such large maps? Warthunder supports up to around 300kmx300km and Rust from what I heard is pretty large too. Here is a game called Combat Halo ( http://www.combat-helo.co.uk/ ) that has a terrain of 40kmx40km for their Apache simulator game it uses Leadwerks v2 Engine I think since it mentions splat terrain painting system. Do they load several terrain maps at once since the highest supported terrain map is 4096x4096 units (meters?) Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 6, 2014 Share Posted February 6, 2014 Ok i wanted a very basic FSP controller to make it really custom , the problem LE 3.1 FPS script is too heavy. Because i wanted FPS to make a FPS platform game, not fighting, no crawlers, no HUD, no sound and make my own prototype. The actual FPS is good to learn how to do FPS fighting game, but not good to start from if you plan a totally different FPS game. (lot of unecessary code if you just need FPS movement ) Well just got to the old Agrorr and Crhis simple FPS tutorials. ------------ Ideas for later : - FPS script : movement only - TPS Controller script : movement only Quote Stop toying and make games Link to comment Share on other sites More sharing options...
beo6 Posted February 7, 2014 Share Posted February 7, 2014 Please add a tutorial how to align a character controller to the ground. See some experiments about it here: http://www.leadwerks.com/werkspace/topic/8487-question-about-physic/ Quote Link to comment Share on other sites More sharing options...
Rick Posted February 7, 2014 Author Share Posted February 7, 2014 @beo6 Added, thanks! Quote Link to comment Share on other sites More sharing options...
beo6 Posted February 7, 2014 Share Posted February 7, 2014 thanks Rick for adding it. However you added the link to the thread-start. But all experiments me and other did there are not really working. Now it looks like the link contains the solution. Quote Link to comment Share on other sites More sharing options...
Justopolis Posted April 15, 2014 Share Posted April 15, 2014 I may be dredging up an old thread here, but I have the Steam version of Leadwerks: Indie. And I'm struggling to get a working 3rd person, fixed camera (think classic Resident Evil style). I've found an old tutorial but it doesn't work, at least not with the assets provided by the indie version. Quote Link to comment Share on other sites More sharing options...
tempest Posted April 15, 2014 Share Posted April 15, 2014 Is this the tutorial http://www.leadwerks.com/werkspace/page/tutorials_legacy/_/making-a-third-person-camera-r16, you're refering to? There's a Lua section, which should be working for the indie edition, given that the scripting language hasn't change in that regard. You might be better off asking a specific question about the code than requesting a whole tutorial; you'll get a quicker response. I know that it's not much of a help - sorry. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted April 15, 2014 Share Posted April 15, 2014 @Justopolis : Download code and example here : http://www.leadwerks.com/werkspace/files/file/521-resident-evil-cameras/ Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Justopolis Posted April 15, 2014 Share Posted April 15, 2014 Thanks for your help. I tried out the example scripts and map and still I can't get it to work. The Mesh_Figur just stands there, I can't get it to move one bit. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted April 15, 2014 Share Posted April 15, 2014 Verify : - player has physic character controller type and a mass > 0 and has script player from zip attached to it - Camera level has camera script from zip attached - yellow and blue floors have script from zip attached I will check my zip. I think you would need to work with simple examples in LE3 first before going further, i mean how to setup physics for characters or solid moving platforms, how to apply forces, how to detect collisions. Rick's tutorials and LE3 WIKI , tutorials are something you should dig and understand before wanting to go further Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.