Jump to content

Cole Chapman

Members
  • Posts

    138
  • Joined

  • Last visited

Everything posted by Cole Chapman

  1. Yeah I know, I have used it before without a problem. Is there anything special I have to do because its Windows 8? I just get the same error =/ I have had issues with BMAX with OpenB3D and people said the test I wrote out worked so perhaps later I will try clean the drive and try again
  2. I did that, I tried "C:\Leadwerks Engine SDK" , I tried "AppDir", still doesn't seem to want to work though. I am just using the Template and RegisterAbstractPath is the only thing I changed (so there is nothing else missing or that I added)
  3. First off, its been quite a while since I used LE2. I got "Error: Shader file "abstract::query.vert" not found." and I have shader.pak in both LE SDK install folder and the app folder. Not sure what the problem is. Using latest BMAX and LE2.5
  4. I agree. Or have the ability to request it in an email
  5. Ah! Thats the tool. I don't have my key though and its not in my client area. Is there a way to have it emailed to you or do I just have to wait for support to get to me?
  6. It's been a while and I can't seem to find it, can someone tell me where it is? My client area shows nothing to download
  7. Where do I download my LE2 copy? It's been a while (My Client Area says I dont have any purchases)
  8. Very attention grabbing title. This is either a confirmation that the code is not accurate or its a confirmation that the title is correct (though that goes against what I know). Code is below. If anyone needs, I can upload both that includes the exes. C++ File: 628 KB - Average FPS: 300 (Made with Dev C++) // ==================================================================== // This file was generated by LEBuilder // http://leadwerks.com/werkspace // ==================================================================== #include "engine.h" #include <iostream> #include <string> const int ScreenWidth = 800; const int ScreenHeight = 600; const char* MediaDir = "C:/Leadwerks Engine SDK"; const char* AppTitle = "Leadwerks"; void ErrOut( const std::string& message ) { std::cerr << message << std::endl; } // ------------------------------- int main( int argn, char* argv[] ) { // Initialize if( !Initialize() ) return 1; SetAppTitle( AppTitle ) ; RegisterAbstractPath( MediaDir ); // Set graphics mode if( !Graphics(ScreenWidth,ScreenHeight) ) { ErrOut( "Failed to set graphics mode." ); return 1; } // Create framework object and set it to a global object so other scripts can access it TFramework fw = CreateFramework(); if( fw == NULL ) { ErrOut( "Failed to initialize engine." ); return 1; } // Set Lua framework object SetGlobalObject( "fw", fw ); // Set Lua framework variable BP lua = GetLuaState(); lua_pushobject( lua, fw ); lua_setglobal( lua, "fw" ); lua_pop( lua, 1 ); // Get framework main camera TCamera camera = GetLayerCamera( GetFrameworkLayer(0) ); PositionEntity( camera, Vec3(0,0,-2) ); // Create cube TMaterial material = LoadMaterial( "C:/Leadwerks Engine SDK/Materials/Cobblestones/cobblestones.mat" ); TMesh mesh = CreateCube(); PaintEntity( mesh, material ); // Create ground TMesh ground = CreateCube(); ScaleEntity( ground, Vec3(10,1,10) ); PositionEntity( ground, Vec3(0,-2,0) ); PaintEntity( ground, material ); // Add some light TLight light = CreateDirectionalLight(); RotateEntity( light, Vec3(45,45,45) ); // Spin cube until user hits Escape while( !KeyHit() && !AppTerminate() ) { if( !AppSuspended() ) { TurnEntity( mesh, Vec3( AppSpeed()*0.5f ) ); UpdateFramework(); RenderFramework(); Flip( 0 ); } } return Terminate(); } BlitzMax File: 2,141 KB - Average FPS: 465 (Made with BlitzMax...) ' ==================================================================== ' This file was generated by LEBuilder ' http://www.leadwerks.com/werkspace ' ==================================================================== SuperStrict Framework leadwerks.ENGINE Local world:TWorld Local gbuffer:TBuffer Local camera:TCamera Local mesh:TMesh Local light:TLight Local ground:TMesh Local material:TMaterial GCSetMode(2) RegisterAbstractPath( "C:/Leadwerks Engine SDK" ) Graphics(800,600) world=CreateWorld() If Not world RuntimeError "Failed to create world." gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_DEPTH|BUFFER_COLOR0|BUFFER_COLOR1|BUFFER_COLOR2) camera=CreateCamera() PositionEntity camera,[0.0,0.0,-2.0] material=LoadMaterial("abstract::cobblestones.mat") mesh=CreateCube() PaintEntity mesh,material ground=CreateCube() ScaleEntity ground,[10.0,1.0,10.0] PositionEntity ground,[0.0,-2.0,0.0] PaintEntity ground,material light=CreateDirectionalLight() RotateEntity light,[45.0,45.0,45.0] Repeat GCCollect() TurnEntity mesh,[AppSpeed()*0.5,AppSpeed()*0.5,AppSpeed()*0.5] If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit UpdateAppTime() UpdateWorld(AppSpeed()) SetBuffer(gbuffer) RenderWorld() SetBuffer(BackBuffer()) RenderLights(gbuffer) SetBlend(1) DrawText(UPS(), 0, 0) SetBlend(0) Flip(0) Forever gbuffer=Null FreeEntity light GCCollect() End Some flaw in the code maybe?
  9. Very cool! i was messing around with string.contain stuff but the regex subexp stuff comes in handy.
  10. Definately, but with things requiring some variables I may keep the option open for not using parentheses. For example: MovePlayerToPlayer(Player1, Player2) or MovePlayerToPlayer Player1, Player2 I could then splice the string to get things before and after the comma. Ill be sure to check out the Regex module
  11. I am trying to figure out what the best way is to import a user made script into a blitzmax application. I want the application to be able to work with new scripts even after a build so I was thinking of something like (Main.bmx) - pseudocode Readfile "Scriptfile.scr" If Readfile contains "Start" Then Start() Endif Function Start() Local I:int = 800 Local y:int = 600 'Ect' EndFunction Reading the file and seeing if it contains keywords for functions and then executing functions. If anyone else has any better ideas though, feel free to help me out
  12. Sorry for the abundance of questions I have been asking. Problem: Identifier "FreeTexture" not found Variables: Framework MaxGUI.MaxGUI Import MaxGUI.Drivers Import BRL.EventQueue Import Leadwerks.Engine Import "../../Imports/Framework.BMX" RegisterAbstractPath("C:\Leadwerks Engine SDK") I want it to free everything (I found ResetFramework() and I am currently using that) however, I still would like to know what this issue is.
  13. When I have VSync on The program's CPU Usage stays around 4-6%. When I turn VSync off, the CPU Usage goes to about 50%. Is that big of a change normal? EDIT: On that same note, I think its sweet that the CPU performance is so low when VSync in on. I use "While PeekEvent" in BMax (without any Leadwerks code) and the CPU Usage is about 50% but when I use leadwerks and set VSync on, it stays low (4-6%) so thats sweet.
  14. No problem, glad I could help
  15. To get your Local IP: Print HostName(localhost) Print DottedIP(HostIp(HostName(localhost)))
  16. Nvm, I got it Framework leadwerks.ENGINE Import "Framework.BMX" RegisterAbstractPath( "C:/Leadwerks Engine SDK" ) 'RegisterAbstractPath("zip::Package.pak") SetZipStreamPassword("PackagePass.pak", "12345") GCSetMode(2) AppTitle:String = "Game Client" Global FW:TFramework Local Mesh:TMesh Local Light:TLight Local Ground:TMesh Local Material:TMaterial Graphics(800,600) FW:TFramework = CreateFramework() If Not FW RuntimeError "Failed to create world." Global Terrain:TTerrain Local TerrainText:TTexture Global Move:Float Global Strafe:Float Global CamRotation:TVec3 = Vec3(0) Global mx:Float Global my:Float Global MouseXInt:Int Global MouseYInt:Int Terrain = CreateTerrain(2048) LoadTerrainHeightmap(Terrain, "zip::PackagePass.pak//Terrain.raw") TerrainText = LoadTexture("zip::PackagePass.pak//TerrainGrass.dds") SetTerrainTexture(Terrain, TerrainText, 0, 0) PositionEntity(FW.Main.Camera, Vec3(0.0, 280.0, 0.0)) Light:TLight = CreateDirectionalLight() PositionEntity(Light, Vec3(0.0, 350.0, 0.0)) RotateEntity(Light, Vec3(45,45,0)) CameraRange(FW.Main.Camera, 0.1, 750.0) 'DOF SetSkyBox(LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat")) SetBackGroundColor(Vec4(1,1,1,1)) SetStats(1) Repeat If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit CameraUpdate() FW.Update() FW.Render() Flip(0) Forever GCCollect() End Function CameraUpdate() If KeyDown(KEY_SPACE) mx = MouseX() - GraphicsWidth()/2 my = MouseY() - GraphicsHeight()/2 MoveMouse(GraphicsWidth()/2, GraphicsHeight()/2) CamRotation.X = CamRotation.X + my CamRotation.Y = CamRotation.Y - mx RotateEntity(FW.Main.Camera, CamRotation) move = (KeyDown(KEY_W) - KeyDown(KEY_S)) * 10 strafe = (KeyDown(KEY_D) - KeyDown(KEY_A)) * 10 MoveEntity(fw.Main.camera, Vec3(strafe / 10.0, 0, move / 10.0)) EndIf EndFunction
  17. I was wondering if there is a package system for BMAX that allows it to read .pak files like on Josh's blog and in examples people have given. If there is one for BMAX, can someone please post an example? Thank you
  18. Ah, the bullet thing is what did it. Ill look into Swept Collision. Thanks man!
  19. Collisions only have three parameters, The first two are (I BELIEVE) Entity Groups in a way and the third is what happens if Entities from those groups collide. I have tried Collisions(1, 3, True) Collisions(1, 3, 1) Collisions(1, 3, 2) Collisions(1, 3, 3) And I have also assigned EntityType(Terrain, 1,2,3,etc with no such luck. Marleys code works though and I am hoping its not because of the LUA stuff
  20. I used Marleys Third Person Cam tutorial and made a Player Type but I cannot get collisions to work. The only differences as far as I can tell is I did not use (and do not want to) use LUA functions and I use MaxGUI(though I cannot see how that would make a difference) The Code: SuperStrict Framework Leadwerks.Engine Import "Framework.BMX" Import MaxGUI.MaxGUI Import MaxGUI.Drivers Import BRL.EventQueue RegisterAbstractPath("C:\Leadwerks Engine SDK") GCSetMode(2) Global FW:TFramework Local GEWindow:TGadget Local GEWindowX:Int 'Null (WINDOW_CENTER) Local GEWindowY:Int 'Null (WINDOW_CENTER) Local GEWindowW:Int = 800 Local GEWindowH:Int = 600 Local GEWindowStyle:Int = WINDOW_TITLEBAR|WINDOW_RESIZABLE|WINDOW_MENU|WINDOW_STATUS|WINDOW_CENTER Local Canvas1:TGadget Global Terrain:TTerrain Global TerrainText:TTexture Global Light:TLight DebugPhysics(1) Type TPlayer Global Current:TPlayer Field Controller:TController Field Move:Float Field Strafe:Float Field CamRotation:TVec3 Field MX:Float Field MY:Float Field Jump:Float Field Position:TVec3 Field Body:TEntity Field CamY:Float Field CamZ:Float Function Create:TPlayer() Local Player:TPlayer = New TPlayer Player.Move:Float = 0.0 Player.Strafe:Float = 0.0 Player.CamRotation:TVec3 = Vec3(0) Player.MX:Float = 0.0 Player.MY:Float = 0.0 Player.Jump:Float = 0.0 Player.CamY:Float = 0.0 Player.CamZ:Float = 0.0 Player.Controller = CreateController(2.0) PositionEntity(Player.Controller, EntityPosition(FW.Main.Camera)) EntityType(Player.Controller, 3) SetBodyMass(Player.Controller, 10.0) SetBodyBuoyancyMode(Player.Controller, 0) Collisions(1, 3, 3) Player.Body:TEntity = CreateCube(Player.Controller) ScaleEntity(Player.Body, Vec3(0.5, 1.8, 0.5)) Return Player EndFunction Method Update() Self.MX = Curve(MouseX() - GraphicsWidth() / 2, Self.MX, 6) Self.MY = Curve(MouseY() - GraphicsHeight() / 2, Self.MY, 6) MoveMouse(GraphicsWidth()/2, GraphicsHeight()/2) Self.CamRotation.X = Self.CamRotation.X + Self.MX / 10.0 Self.CamRotation.Y = Self.CamRotation.Y - Self.MX / 10.0 RotateEntity(FW.Main.Camera, Self.CamRotation) If Self.CamRotation.X > 90.0 Then Self.CamRotation.X = 90.0 If Self.CamRotation.X < -20.0 Then Self.CamRotation.X = -20.0 Self.Move = KeyDown(KEY_W) - KeyDown(KEY_S) Self.Strafe = KeyDown(KEY_D) - KeyDown(KEY_A) Self.Jump:Float = 0.0 If KeyHit(KEY_SPACE) And Not ControllerAirborne(Self.Controller) Then Self.Jump = 4.0 EndIf If KeyDown(KEY_LSHIFT) Or KeyDown(KEY_RSHIFT) Then Self.Move = Self.Move * 3.0 Self.Strafe = Self.Strafe * 3.0 EndIf PositionEntity(FW.Main.Camera, Vec3(Self.Controller.Position.X, Self.Controller.Position.Y + 0.8, Self.Controller.Position.Z)) Self.CamY = 0.5 If MouseZ() > 0 Then FlushMouse() If MouseZ() < 0 Then Self.CamY = 0.0 Self.CamZ = Curve(MouseZ(), Self.CamZ, 10) MoveEntity(FW.Main.Camera, Vec3(0, Self.CamY, Self.CamZ)) UpdateController(Self.Controller, Self.CamRotation.Y, Self.Move * 3, Self.Strafe * 3, Self.Jump, 0.5) EndMethod EndType GEWindow:TGadget = CreateWindow("GE", GEWindowX, GEWindowY, GEWindowW, GEWindowH, Null, GEWindowStyle) Canvas1:TGadget = CreateCanvas(0, 0, ClientWidth(GEWindow), ClientHeight(GEWindow), GEWindow) SetGadgetLayout(Canvas1, EDGE_ALIGNED, EDGE_ALIGNED, EDGE_ALIGNED, EDGE_ALIGNED) SetGraphics(CanvasGraphics(Canvas1)) ActivateGadget(Canvas1) EnablePolledInput() FW:TFramework = CreateFramework() If Not FW RuntimeError "Failed to Initialize Engine" Terrain = CreateTerrain(2048) LoadTerrainHeightmap(Terrain, "Terrain.raw") TerrainText = LoadTexture("TerrainGrass.dds") SetTerrainTexture(Terrain, TerrainText, 0, 0) PositionEntity(FW.Main.Camera, Vec3(0.0, 1000.0, 0.0)) Light:TLight = CreateDirectionalLight() PositionEntity(Light, Vec3(0.0, 350.0, 0.0)) RotateEntity(Light, Vec3(45,45,0)) CameraRange(FW.Main.Camera, 0.1, 750.0) SetSkyBox(LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat")) SetBackGroundColor(Vec4(1,1,1,1)) SetFarDOF(1) SetFarDOFStrength(1) SetFarDOFRange(600.0, 750.0) Global MainPlayer:TPlayer MainPlayer:TPlayer = TPlayer.Create() If Not MainPlayer RuntimeError "Failed to Create Player." Repeat While PeekEvent() WaitEvent() Select EventID() Case EVENT_WINDOWCLOSE End Case EVENT_WINDOWSIZE SetGraphics CanvasGraphics(Canvas1) EndSelect Wend MainPlayer.Update() If KeyDown(KEY_ESCAPE) Then End FW.Update() FW.Render() SetBlend(1) DrawText(MouseX(), 0, 10) SetBlend(0) Flip(0) Forever GCCollect() End
×
×
  • Create New...