Jump to content

Slastraf

Members
  • Posts

    710
  • Joined

  • Last visited

Everything posted by Slastraf

  1. What would be the easiest way to make a tower defense game ? What would be the best way to make this in lua ? I taught about a grid in the 3d world, that consists of x and y places to build towers. But theres the problem that i want to make the navmesh visible, and a way to actually place the turrets there (i have no idea how to make the grid that stores information for each y and x field.. If you could think of a better way then please tell me, also how you could possibly program it. Also here are some images of what direction my game could go in future (and for a better understanding) _________ What I have already done: Rts camera, you can place boxes with the mouse into the world, prefab spawning
  2. http://i.imgur.com/TWZnhO9.jpg?1%27'>'] Just baking some normal maps
  3. For my towerdefense game I want to allow the player to place a turret into the 3d world with the mouse. I dont understand how to send a raycast from the camera when you click somewhere in the 3d world. For example if i want to place a block on the terrain by left clicking inside the game. Also I dont know how raycasting in general works . a link for that should be enough. thanks Friedrich
  4. An other nice competition with beautiful game ideas.
  5. currentmap = nextmap if you change currentmap to a string like "level01" then it will load it.
  6. I have this, too. Ignored it until now and I didnt notice anything
  7. Slastraf

    Vegetation Demo

    Actually 60 fps is the lowest. average is 80-100 fps
  8. Slastraf

    Vegetation Demo

    60 fps with looking at everything, 100+ in sky. Saphire 7870 Amd
  9. Actually if i think about that now, you could make some Island parts in a 3d program like blender, save them as a prefab. Next thing you do is making a script that places those prefabs in a way that it looks like an island also theres an option in eladwerks that you can make water on a map. use it
  10. everything is possible , but its a question of effort that you put into it. I dont think the terrain can be edited inside the game itself via code, so you would need to create your own terrain from scratch (in lua or c++ scripts). I would guess it can be done in the future when theres a newer update of leadwerks
  11. That fixed it. and thank you for the informations
  12. scripts/objects/ai/monsterai.lua" : 143 : attempt to call method 'GetPosition' (a nil value) I get this error whenever i spawn a crawler into the map by code (not drag & drop). It is the default script and it works when i drag the prefab into the scene. The following happens: Crawlers begin to run towards player. Error comes up. (all in all <1 second). I have no Idea why this isnt working. In case heres a download link: http://www.mediafire.com/download/13drm2j8i14ydin/SlastrafProject.rar its the start map which is not loaded by default i think ( in my project) . The self.Target is assigned (target = player) trought the script and everything else is not missed out.
  13. I watched it some time ago. The problems I have in my game right now are deeper , and its not the performance.I got told to make this thread with an explanation and the project because this person couldnt help me at this point , too.
  14. http://www.mediafire.com/download/13drm2j8i14ydin/SlastrafProject.rar I am sorry if you are confused a bit but explaining all would be too much for me, just download my project folder and you will understand everything fast (if you want to help me). I want to make a tower defense game, where crawlers spawn on the map and attack the tower. When you open the level01 map, basically nothing spawns (everything configurated right). when you open the start map , the crawlers spawn, run for a bit towards the player, and then an error caused because the program couldnt find the target (player) in the monsterai script( GetPosition: a nil value). The last should not be happening, however I dont know why there is a problem with the Target since its assigned. But not looking at that I added self:SpawnEnemy(1,1) in the start function of the zombieSpawner script, and in the SpawnerUpdate function only for testing both options of spawning a crawler Both dont seem to do anything in the level01 map. PM: shooting isnt implemented in the downloadable project , as well as getting hit.
  15. I had that before, but it affects the frames very much. When the spawnEnemy function is called, it loads it once again, even if not necessary.
  16. http://www.mediafire.com/download/dm6d64ri0476tz5/WinRARbySlastraf.rar Above a link to my project (~40 mb) In the start map there is a folder in the scene editor called spawners. there are some spawners and a spawncontroller. the spawners themsleves are able to spawn crawlers into the scene, the spawncontroller is able to increase the maximum amount of enemies in the scene every new round. My problem is that there are still spawning crawlers and i dont know why, The method SpawnEnemy() in the zombiespawner script doesnt get triggered nowhere and i am very confused. Thanks for reading and helping Friedrich Pm: textures are missing for small download size
  17. you could also just set the Field of view from your fpsplayer camera, and draw a scope image on the screen while scoping. make the FOV to 20 degrees, it has a zooming effect. http://www.leadwerks.com/werkspace/page/api-reference/_/camera/camerasetfov-r208
  18. Slastraf

    The Borrower

    amd graphic card maybe, I should get easily 30 fps with hunt for food for example, stuck with 5 or less. Amd saphire 7870
  19. Always when theres a new level , the maxzombies value is increasing by 30%, When theres a new level the for loop gets called once and spawns the enemies. I put this in the updatwphysiscs function so the program always updates if its time to spawn new enemies or not. The new map function gets triggered when fighting == false.
  20. I want to spawn enemies in the world, and maxenemies is increasing every round. The goal is to make it actually work fluently and in the later state of developing the enemies are resetted every 3 rounds but they also got more hp.
  21. Script.maxEnemies = 3 Script.currentround = roundssurvived -1 Script.spawner1 = nil --entity "spawn1" Script.spawner2 = nil --entity "spawn2" Script.spawner3 = nil --entity "spawn3" Script.spawner4 = nil --entity "spawn4" Script.spawner5 = nil --entity "spawn5" Script.spawner6 = nil --entity "spawn6" Script.spawner7 = nil --entity "spawn7" Script.fighting = true Script.alreadyrunning = false --[[wichtige Varieblen: zombieskilled = 0 roundssurvived = 0 ]]-- function Script:Start() self.spawners={} self.spawners[0]=self.spawner1 self.spawners[1]=self.spawner2 self.spawners[2]=self.spawner3 self.spawners[3]=self.spawner4 self.spawners[4]=self.spawner5 self.spawners[5]=self.spawner6 self.spawners[6]=self.spawner7 --self.spawner2.script:SpawnEnemy(1) --self.spawner2.script:SpawnEnemy(2) self:NewRound() end function Script:UpdatePhysics() --local rounds = roundssurvived --calculates the new amount of zombies in new round --if window:KeyDown(Key.W) then self:NewRound() end if zombiesleft <0 then zombiesleft = 0 end if zombiesleft == 0 then self.fighting = false end --if self.fighting == false then self:NewRound() end self:UpdateZombieSpawn() end function Script:NewRound() roundssurvived= roundssurvived +1 local a = (roundssurvived*.1) + roundssurvived self.maxEnemies= self.maxEnemies + Math:Round(a) end function Script:UpdateZombieSpawn() if zombiesleft==0 then self:NewRound() end local g = self.maxEnemies if self.fighting == false then for n=0,self.maxEnemies do if self.fighting == true then break end if n==maxEnemies then self.fighting = true break end local b=Math:Round(Math:Random(0, 6)) self.spawners[b].script:SpawnEnemy(b) zombiesleft = zombiesleft +1 end end --alreadyrunning = true end --[[ function Script:Collision(entity, position, normal, speed) end ]]-- function Script:PostRender(context) context:SetBlendMode(Blend.Alpha) context:DrawText(tostring(self.maxEnemies),200,2) context:SetBlendMode(Blend.Solid) end --[[ function Script:DrawEach(camera) end ]]-- --[[ --This function will be called after the world is rendered, before the screen is refreshed. --Use this to perform any 2D drawing you want the entity to display. function Script:PostRender(context) end ]]-- --[[ --This function will be called when the entity is deleted. function Script:Detach() end ]]-- --[[ --This function will be called when the last instance of this script is deleted. function Script:Cleanup() end ]]-- This is a script of mine and if I use it like that a huge amount of crawlers get spawned (it should only be as much as in the maxenemies value). I think it is probably because the for loop gets called several times before the first one makes the fighting = true, which should end the for -loop. My question is how to fix that.
  22. i have started with two for loops, each for x and y coordinates. they both create ten blocks in x and y direction. basically from now the real work begins. Whats the best way to think of an algorithm that creates labyrinths from now ?
  23. try to use the .mdl not the prefab
×
×
  • Create New...