Rick Posted January 1, 2010 Share Posted January 1, 2010 File Name: Pi-3rdPersonCamera v 0.1 File Submitter: Rick File Submitted: 01 Jan 2010 File Category: Lua Scripts Here is a very basic 3rd person camera thingoid. Just drag it into your scene and give it a target. The game script that you need to run also is: require("Scripts/constants/collision_const") require("Scripts/constants/engine_const") require("Scripts/LinkedList") require("Scripts/filesystem") require("Scripts/math/math") if fw==nil then --we are not in Editor RegisterAbstractPath("") Graphics(800,600) -- need a better way to get screen res fw=CreateFramework() scene=LoadScene("") -- need a way to get a scene to load scene:SetCollisionType(COLLISION_SCENE) TFilter(1) AFilter(4) end -- set globals SetGlobalString("mode", "GAME_MODE") SetGlobalString("quit", "false") FlushKeys() FlushMouse() --main function while (KeyHit(KEY_ESCAPE) == 0) and (GetGlobalString("quit") == "false") do fw:Update() fw:Render() Flip(0) end -- reset values SetGlobalString("mode", "DESIGN_MODE") SetGlobalString("quit", "false") Click here to download this file Will be creating a video that shows 3 of my Thingoids working together. Quote Link to comment Share on other sites More sharing options...
Laurens Posted January 1, 2010 Share Posted January 1, 2010 Very nice Rick, thanks! Quote Link to comment Share on other sites More sharing options...
Michael Betke Posted January 1, 2010 Share Posted January 1, 2010 So this is just a camera with target and if I enter game-mode in editor the 3thrd person will spawn? Quote Pure3d Visualizations Germany - digital essences AAA 3D Model Shop specialized on nature and environments Link to comment Share on other sites More sharing options...
Rick Posted January 1, 2010 Author Share Posted January 1, 2010 It's actually just a camera that you can rotate around anything you give it as a target when you enter game mode given you are using the game script I posted above. It also has an offset setting. When you give it a target you'll see a white box. That white box is where the camera will point to. It'll start at the origin of the target, but you can offset it. Also you rotate with holding down the left mouse button and moving the mouse. I'm uploading a video right now that shows 3 controls, this being one, that allow you to get a quick moving 3rd person style player going in about a few mins. It's still very early and any ideas/help is welcome. The video and Thingoids should be up within an hour or so. Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 1, 2010 Share Posted January 1, 2010 awesome. Thanks Rick. I will learn a thing or three from this. now I just need to get my characters converted to gmf's, so I can start playing with it. Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
wailingmonkey Posted January 1, 2010 Share Posted January 1, 2010 thank yee kindly. Quote Vista Ultimate SP1 64bit | Q6600 2.40 GHZ | 8GB RAM | 320MB Nvidia 8800GTS Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 2, 2010 Share Posted January 2, 2010 How did you link the objects? Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Rick Posted January 2, 2010 Author Share Posted January 2, 2010 To make a link you left click and hold on one object, and then drag it to another object. Just make sure you are dragging to the 2d images because that's the object. When working with the character object it can be confusing because it won't work if you drag to your model. Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 2, 2010 Share Posted January 2, 2010 do you position lock your before you do that? I can't seem to get it to hold on to the object without moving it.. THats how I thought it worked, I just was having a little issues. Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Rick Posted January 2, 2010 Author Share Posted January 2, 2010 I didn't need to position lock. I do know what you are talking about, but you just have to make sure your cursor doesn't change to indicate it's going to move the object. I guess I don't have much of an issue doing it though. Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted January 3, 2010 Share Posted January 3, 2010 yeah, will have to wait till I get back home... I am using a remote connection so thats probably my problem. Thanks Rick Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Gabriel Posted November 20, 2011 Share Posted November 20, 2011 Hello Rick I would use this principle followed by the camera, I know how to create a Link Dynamics bypassing the sandbox and LUA and how do the equivalent of SetGlobalString (), I'll assume it is with the function lua_setglobal, but I do not know how it works. Thank you for your help Gabriel PS: for the C + + code Quote Link to comment Share on other sites More sharing options...
Rick Posted November 21, 2011 Author Share Posted November 21, 2011 Not following your question. Quote Link to comment Share on other sites More sharing options...
Gabriel Posted November 23, 2011 Share Posted November 23, 2011 Not following your question. hello, this is normal it should be very late when I posted this question. but I solved my problem. About a nice job;-) Gabriel Quote 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.