Jump to content

drakth

Members
  • Posts

    46
  • Joined

  • Last visited

Profile Information

  • Location
    Argentina

drakth's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. Thanks! I'll try that later.
  2. +1 For C++ templates! Voted for RTS
  3. Hello thanks for your reply Eirik, Yes, i got to the same conclusion, tho i wasn't trying to do a mix of LUA and C++ . I don't think i like much the idea of not being able to choose between C++ or LUA project. Someone correct me if i'm wrong, but if i don't want to use LUA i should have to remove all those code thingy about interpreter, right? Yeah the LOOP thing was annoying thats why i figured it was a LUA thingy.
  4. I added the World::Create() but i still get the error (and a black screen), it seems to create the world load textures and stuff but nothing appears on screen, and when pressing escape y get the same error because of the code i added in app:loop() which is weird :-/
  5. Yes, i saw the project folders, and added code to the app.cpp, but still doesn't seem to work. any code after the next block of code doesn't seems to be executed until i close the window. std::string scriptpath = "Scripts/Main.lua"; if (FileSystem::GetFileType("Scripts/App.Lua") == 1) scriptpath = "Scripts/App.Lua"; //Invoke the start script if (!Interpreter::ExecuteFile(scriptpath)) { System::Print("Error: Failed to execute script \"" + scriptpath + "\"."); return false; } This code seems to be something LUA related. From what i see on my old projects this code wasn't there before, so i guess it got added on one of lasts updates, strangely my previous projects works fine, but new ones doesn't. I'm attaching the example and error file. Thank you. Edit: attached the zip file. Nova.zip
  6. Hello everyone, After while i got back with Leadwerks, and i dont know if im doing something wrong or what is happening, but i cant seem to get anything to work with C++ it seems like its only being setup to use LUA. Yes, i have the standard edition I have created an example project (download link below!), it should load the level and have a basic FPS player (hopefully it works since i cant test it!) When i use one of my previous projects it works fine and i can do stuff, but when i started a new project (tried with blank and marble) it only seems to be working for LUA, not C++. Download Link: https://onedrive.live.com/redir?resid=614054867A013815!845&authkey=!APfWFon2GrPb4LU&ithint=file%2czip Any help would be appreciated. Thank you.
  7. Hello everyone! I read about the summer games tounament thingy and decided to try do a small game. So, i started leadwerks and made a new project. From what i read there is no difference now between a C++ or LUA project so, i went to Visual Studio and opened the solution. I saw there are quite several changes from the last time i used it, so i added some code i had from a previous project for a FPS. It compiled ok, but all i see is a black screen. So i went looking in detail at App.cpp Noticed stuff that wasnt there before. From debugging i see the code seems to be using Lua instead of C++??? Yes, i have the standard edition. The code i mention is the following: std::string scriptpath = "Scripts/Main.lua"; if (FileSystem::GetFileType("Scripts/App.Lua") == 1) scriptpath = "Scripts/App.Lua"; //Invoke the start script if (!Interpreter::ExecuteFile(scriptpath)) { System::Print("Error: Failed to execute script \"" + scriptpath + "\"."); return false; } My code is after this part so it only gets executed when exitting the game (?). Should i place the code somewhere else?
  8. drakth

    Skybox

    Hi everyone, Im trying to add a skybox to the default FPSPlayer.lua script. As it says at this webpage: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/camera/camerasetskybox-r824 However when i add the line: Texture* skybox = Texture::Load("Materials/Sky/skybox_texture.tex"); It gives me this error: '=' expected near '*' If i remove the * then gives me another error and so on... any help? Thanks. Ok, on the link at my OP, the section of LUA contains C++ code and viceversa. Someone should fix that
  9. Thanks Rick, That fixed the issue. However, i think there is also not working right, with the default weapon prefab. Cause on other project i have, fixing the FPSPlayer script, didnt fix the crash, however as soon as i removed the autopistol prefab it worked fine. Also thanks for the debugging tip. Should i report this on the bug forums?
  10. I tried commenting the create world line but still crashes. I created a new test project, that also seems to crash, i'll attach it in case you want to look at it. It seems to crash on the self.world:clear() but im not sure. http://www.bitperdido.com/TestLevelChange.zip Thanks.
  11. This is the content of app.lua: --This function will be called once when the program starts function App:Start() --Set the application title self.title="MyGame" --Create a window self.window=Window:Create(self.title) self.window:HideMouse() --Create the graphics context self.context=Context:Create(self.window,0) if self.context==nil then return false end --Create a world self.world=World:Create() --Load a map --local mapfile = System:GetProperty("map","Maps/start.map") self.mapFile = "Maps/start.map" if Map:Load(self.mapFile)==false then return false end self.mapFile = "" return true end function App:SwitchLevel(name) self.mapFile = name end function App:ShouldSwitchLevel() if self.mapFile ~= "" then --self.world:Release() self.world:Clear() self.world = World:Create() Map:Load(self.mapFile) self.mapFile = "" end end --This is our main program loop and will be called continuously until the program ends function App:Loop() self:ShouldSwitchLevel() --If window has been closed, end the program if self.window:Closed() or self.window:KeyDown(Key.Escape) then return false end --Update the app timing Time:Update() --Update the world self.world:Update() --Render the world self.world:Render() --Render statistics self.context:SetBlendMode(Blend.Alpha) if DEBUG then self.context:SetColor(1,0,0,1) self.context:DrawText("Debug Mode",2,2) self.context:SetColor(1,1,1,1) self.context:DrawStats(2,22) self.context:SetBlendMode(Blend.Solid) else self.context:SetColor(1,1,1,1) self.context:DrawText("FPS: "..Math:Round(Time:UPS()),2,2) end --Refresh the screen self.context:Sync(false) --Returning true tells the main program to keep looping return true end I tried loading the 2nd level instead of the 1st one, and it loads fine, it seems to crash when called from the script. The second level is just a platform with a another object where you can collide and will take you again to the first level. Thanks.
×
×
  • Create New...