cassius Posted November 29, 2009 Share Posted November 29, 2009 I have been trying to update the character controller code on the wiki for use with le 2.3 but had no success. I need some code that will put a player inside a level with look around and mocement capability. If anyone would share such code it would be much apreciated. Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
Scott Richmond Posted November 29, 2009 Share Posted November 29, 2009 Show us what code you're using and what (if any) errors. Quote Programmer, Modeller Intel Core i7 930 @ 3.5GHz | GeForce 480 GTX | 6GB DDR3 RAM | Windows 7 Premium x64 Visual Studio 2008 | Photoshop CS3 | Maya 2009 Website: http://srichnet.info Link to comment Share on other sites More sharing options...
macklebee Posted November 29, 2009 Share Posted November 29, 2009 You can use my test bmax framewerk program that I am using for testing lua scripted models loaded from an Editor scene. Let me know if you have any problems... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
cassius Posted November 29, 2009 Author Share Posted November 29, 2009 Thanks macklebee. I got rid of the code last nijht after a couple of frustrating hours. The program ran with no errors. The lighting was on and you could lookaround with mouse but movement was frozen. The problem was I did'nt know which commands were obsolete or no longer needed. Is it true that LoadScene takes care of lighting now? Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
macklebee Posted November 29, 2009 Share Posted November 29, 2009 The controller needs a mass now... I think the tut doesn't have that and if i remember correctly that was a bug from an older SDK version that Josh fixed... also, you need to set the acceleration value which I don't believe was in the old tut... but then again Josh redesigned the character controller completely since that tut was made... good rule of thumb is to look at the wiki for all of your commands and see if there has been any changes to what the parameters are now... try changing it and see what each one does for you... and as far as I can tell the lua scripted lights when loaded from LoadScene just automatically work now... the position/rotation/color etc all seem to be set... at least for bmax users, I can't speak for c++ Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Marleys Ghost Posted November 29, 2009 Share Posted November 29, 2009 and as far as I can tell the lua scripted lights when loaded from LoadScene just automatically work now... the position/rotation/color etc all seem to be set... at least for bmax users, I can't speak for c++ Using C++ I have not found any problems with LoadScene automatically parsing the lights and setting them up in a scene. Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted November 29, 2009 Share Posted November 29, 2009 Mack... i ran your code... it worked perfectly... you're making quick progress getting a grasp on this thing... thx for sharing... your collision code snippets helped me get my player guy reacting properly inside my sub... --Mike Quote Link to comment Share on other sites More sharing options...
macklebee Posted November 29, 2009 Share Posted November 29, 2009 Using C++ I have not found any problems with LoadScene automatically parsing the lights and setting them up in a scene. now if we can only get emitters to work automatically in c++! Mack... i ran your code... it worked perfectly... you're making quick progress getting a grasp on this thing... thx for sharing... your collision code snippets helped me get my player guy reacting properly inside my sub... thanks Mike, just trying to repay the community that helped me when I first started... now maybe one of these days I will actually produce something! Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Marleys Ghost Posted November 29, 2009 Share Posted November 29, 2009 now if we can only get emitters to work automatically in c++! Quote AMD Bulldozer FX-4 Quad Core 4100 Black Edition 2 x 4GB DDR3 1333Mhz Memory Gigabyte GeForce GTX 550 Ti OC 1024MB GDDR5 Windows 7 Home 64 bit BlitzMax 1.50 • Lua 5.1 • MaxGUI 1.41 • UU3D Pro • MessiahStudio Pro • Silo Pro 3D Coat • ShaderMap Pro • Hexagon 2 • Photoshop, Gimp & Paint.NET LE 2.5/3.4 • Skyline • UE4 • CE3 SDK • Unity 5 • Esenthel Engine 2.0 Marleys Ghost's YouTube Channel • Marleys Ghost's Blog "I used to be alive like you .... then I took an arrow to the head" Link to comment Share on other sites More sharing options...
cassius Posted November 29, 2009 Author Share Posted November 29, 2009 I too would like to repay the community for fantastic help over a long period but mostly my lack of expertise prevents it. I do however recommend le and the community at every oportunity. It might be nice to have a "How to" section on the forum like: How to open and close doors in a game How to make an elevator go up and down How to pick up objects....etc Quote amd quad core 4 ghz / geforce 660 ti 2gb / win 10 Blender,gimp,silo2,ac3d,,audacity,Hexagon / using c++ Link to comment Share on other sites More sharing options...
macklebee Posted November 29, 2009 Share Posted November 29, 2009 I too would like to repay the community for fantastic help over a long period but mostly my lack of expertise prevents it. I do however recommend le and the community at every oportunity. It might be nice to have a "How to" section on the forum like: How to open and close doors in a game How to make an elevator go up and down How to pick up objects....etc I was in the same boat cassius when I first started... heck, I am actually still in that boat! and thats the whole purpose of this new forum/social development that Josh has envisioned... the goal being to be able to easily share assets whether it be code/models/scripts/whatnot... give it time to build up and I think you will get a form of that How to section you are looking for... At least I know I plan on exposing all I can figure out (and all I don't know) and sharing whenever I can... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
gordonramp Posted November 29, 2009 Share Posted November 29, 2009 Mack, Your code with collisions is working for me too, thanks for that. Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
macklebee Posted November 29, 2009 Share Posted November 29, 2009 Mack, Your code with collisions is working for me too, thanks for that. glad i could help i am trying to finish setting up my bmax framewerk testing code that will set the water, distance fog, skybox, what have you... i will post that in my blog for anyone to use for testing if they wish... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
josk Posted November 29, 2009 Share Posted November 29, 2009 Code working perfect here too, also working with the sound code you put in the c++ section. Maybe worth putting it all in this thread. Thanks. Quote Elite Cobra Squad Link to comment Share on other sites More sharing options...
macklebee Posted November 29, 2009 Share Posted November 29, 2009 yeah, good point josk... to get the oildrum lua script sound to work in your bmax framewerk program, you need this in your bmax code: SetGlobalObject("listener", CreateListener(fw.Main.camera)) and this is the modified oildrum.lua code for the collision function: --Add collision noise function Collision(model,entity,position,normal,force,speed) local entity=entitytable[model] local time,i if fw~=nil then listener = fw.listener else listener=GetGlobalObject("listener") end if EntityDistance(listener,model)<30 then if speed>hitthreshhold then time=AppTime() if time-lasthitnoisetime>hitnoisedelay then --Check how many impact noises are already active local countsources=0 for i=0,2 do if hitnoise[i]~=nil then countsources=countsources+hitnoise[i]:ActiveSources() end end --Only emit a sound if there are fewer than the allowed max sources if countsources<maxhitsources then i=math.random(0,2) if hitnoise[i]~=nil then entity.model:EmitSound(hitnoise[i],30,1.0,0) end end lasthitnoisetime=time+math.random(0,hitnoisetimevariation) end end end end Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
gordonramp Posted November 29, 2009 Share Posted November 29, 2009 That works too, you're on a roll. Quote AMD Athlon x2 7750 2.7ghz, 6gb ddr2 ram, Galaxy9800GT 1gig ddr2 video card, Windows 7,64. Link to comment Share on other sites More sharing options...
macklebee Posted November 30, 2009 Share Posted November 30, 2009 That works too, you're on a roll. thanks gordonramp. If any bmx users are interested, you can get an updated controller program from my blog that sets your skybox, water properties, and distance fog based on your Editor map, as well as give the option to set aa, bloom, godray, hdr, ssao, and wireframe during runtime... basically just what I am using to test the new editor and lua scripted objects... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
josk Posted November 30, 2009 Share Posted November 30, 2009 Excellent, keep it up. Quote Elite Cobra Squad 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.