Jump to content

imjustacowlol

Members
  • Posts

    18
  • Joined

  • Last visited

imjustacowlol's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Yep, I'm having the same issues also when not loading new maps.
  2. But GetPosition will track where it's current position is. So then I would have to make something similar to this: entity:GetPosition() if self.position==x,y,z then entity:SetPosition(x,y,z) end Would something like that make sense? & btw, lua looks similar to c++ in leadwerks, c++ is just a lot more advanced and there are still some small diffrences in the same code.
  3. Hey guys, I'm bussy creating a small video game with a background that is constantly moving from the top of my screen to the bottom. The problem is, as soon as it has completed its simple task of moving from one direction into another, it disappears from the screen. I've been trying for about an hour to get the object back to the top of the screen again, so it can start over moving down again, but unfortinately my poor coding skills haven't managed to do so yet. What I basically want, is that the object gets 'rolled back' for a specific distance when it gets past an imaginairy line. And when it has been rolled back, I want it to start over with going to the bottom of the screen again. And when it gets back to that line, it must role back again etc. etc.. To give you a basic idea of what I want, imagine it like the tracks of a tank if you look at it from the side: 1 segment of the track will go from left to right over the wheels of the tank, as soon as it gets to a specific distance (the last wheel) the track goes down and then it will go from right to left. All segments of the track will do this, and they will all stay perfectly lined up behind each other. Now I do not want to create tank tracks in my game, but the movig background I want could use an similar idea. The script I am using right now to just move it from the top of my screen to the bottom of my screen (might be in diffrent directions for you) is attatched to this post. There are a few not needed lines in there, but that's because I am still working at it myself as well. If you have an idea of what i want, and if you know how to code it then all help would be very much appreciated -Wes Backgroundmovement.lua
  4. I've been observing all solutions, and I'm sorry for my lack of reactions, but none of the solutions unfortinately have helped yet. Aggror's solution causes the game to crash upon map switch with self.world:Clear() again. and xtreampb, in what script should I put that piece of code?
  5. Noise.lua is in the attatchment of this message. When I put Script:Delete() even anywhere in the Noise.lua script, it gives me an error: Script Error attempt to index global 'Script' (a nil value) Line 24 Noise.lua with the Script:Delete() is in the attatchment. When I replace Script:Delete() with Sound:Delete() or sound:Delete() it gives an error for the Delete part (doesn't matter if I write Delete or delete, gives the error anyway): Script Error attempt to index global 'Delete' (a nil value) Line 24 Noise.lua
  6. Didn't work to get rid of the music. The music is attatched to an object with the Noise.lua script, and the object reaches throughout the whole map so everywhere you go you hear that song. When I either use Clear() or Release() in App.lua it doesnt delete the music. it's like something in the engine is registering that you are still in the previous map ánd in the new map that you loaded with the map-switch.
  7. It does say it is deleting things yeah. But when I deleted the release parts in the player script, it still crashes for some reason. Perhaps I missed something, i'll take a look at it. The part where it goes wrong is actually after loading the next map 0_o --edit-- okay found another release part in player script, deleted that and still crashes with self.world:Release() but I fixed it by doing this: function App:ShouldSwitchLevel() if self.mapFile ~= "" then self.world:Release() self.world=World:Create() Map:Load(self.mapFile) self.mapFile = "" end end First self.world=World:Create() was not in the script, because that got advised earlier on. But by putting it back it did fix the crash. Here comes the new issue: The music from the previous level (There was music playing in that level) does not get released/deleted. Do I need to put an additional command in the ShouldSwitchLevel part to do so?
  8. I'll take a look at it Still crashes if my ShouldSwitchLeve() is this: function App:ShouldSwitchLevel() if self.mapFile ~= "" then self.world:Clear() Map:Load(self.mapFile) self.mapFile = "" end end Next to that, the fpsplayer script is the default one by leadwerks.
  9. I was but not anymore, doesn't work on either the beta or the normal.
  10. You can download my project here, its a significantly smaller file https://www.dropbox.com/s/68ldy91jccykpdb/TestProject2.zip still crashes upon clearing/releasing the world.
  11. I'll make a smaller testmap for you today. Just came back from school so yeah ;/
  12. Hey guys, So quite a long time ago I had issues with switching maps at the part of clearing a world. Several weeks ago a update game because there was something missing in the engine itself, but when I switch with the same scripts I used before the 'fix' the game crashes without giving a reason. The scripts involved within map switching are App.lua and LoadLevel.lua. I don't see anything weird at the output tab in the debug editor, the general output tab does randomly say Error: Unknown client disconnected. I have no clue why the map switch works for others and not for me. I tried making a new project and the game would still crash. Here is a link to one of my main projects (it is 1.5gb yes, but I'm using most of the files in it so yeah..) https://www.dropbox.com/s/68ldy91jccykpdb/TestProject2.zip if you know the solution please let know
×
×
  • Create New...