Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. I only have the lua version myself and it appears to be able to handle what I need it for... other than missing commands not exposed to it just yet. But that will come eventually. Though if I had the option to use another language for the core of game mechanics, I probably would use that. But lua is great for quick and dirty testing and troubleshooting.
  2. No need to accredit anything to anyone. A simple thanks is more than sufficient on this forum. And questions are encouraged, but this goes for everyone - a person needs to state what is their specific issue. A question about how to setup a particular model to use with the fpsweapons script is a lot more specific than asking how to do a melee system. And of course if a person can provide scripts/files/pictures to help show the problem so people can try to recreate it, then the better chance your post will be answered. As for the harpy model - 18K+ polygons seems a little high for a model that doesn't appear to have much detail. If possible, maybe retopologize to help bring that down some. As I didn't actually set it up to run around in a scene, I cannot speak to what the frame rate is doing.
  3. In windows, it can... but I can only assume the same options exist for linux Open the Script Editor and click the 'Options' icon in the toolbar.
  4. wow... I know maybe some things can get lost in translation from what is written on a post as compared to the the person's intent, but that is coming off pretty damn needy and more than a little ungrateful to the effort being put forth for them. I am going to just make the assumption that is not the case. In any case - your sword model has a couple issues: 1) the model you provided has no UV's associated with it so it looks strange when a material is applied in LE 2) the model is rotated in the wrong direction - pointy end out should be towards the +Z direction (not a big deal though as it can be rotated in its script) 3) the model is way too big - scale down using the LE Model Editor by clicking Tools-->Resize -- use the Scale percent option. Since your animations are all in one sequence, I created a text file to separate them. In notepad, I created the individual animation names and frame counts: idle, 0, 25 swing, 26, 47 I saved the text file and then with the gladiouse model opened up in the Model Editor, I clicked on File-->Load Animation to load that text file. Then I deleted the multi-animation sequence and saved the model. Next gut the fpsweapon script and rename it as 'gladiouse.lua' since there is basically only one animation and no reason to track ammo/clips/etc... Gladiouse.lua Once done with the script, load the gladiouse model into the scene and attach its weapons script to it. Save that as a prefab then delete it from the scene. To use it with the fpsplayer, load the fpsplayer prefab into the scene and attach the 'gladiouse' prefab to its weapon script variable. When you run your game with the standard fpsplayer script, you should see the sword model just slightly below the camera, to the right, and angled up. Clicking the left mouse button will make it perform the "swing" animation.
  5. For the first problem with the enemy AI (harpy character), you need to open it up in the LE model editor and perform Tools>Resize. I like the Fit option to set the character's max height. As for the rest of the issues with the harpy character, what is needed looks vaguely similar to what i had already responded to in a PM with another new person having similar problems. So here is my explanation for his specific character problems: Custom Enemy Character with inherent MonsterAI script.pdf Hope this helps.
  6. That's the problem I am trying to point out. We have no idea what you are doing wrong. You gave no specifics, no model, and no script for us to reproduce the problem. The best most people can do is guess at what your problem could be. That's admirable and hope you stick with it to get to that point.
  7. I keep seeing new people posting here a request for code that does exactly "this" or "that" for them, when they are needing to learn and understand basic lua/LE commands and LE in general. It's a little of wanting to run before you can walk scenario. People need to realize that for all intents and purposes that LE3.2 is relatively "new" for everyone, and even for the people that it isn't new, they might not have actually written code that does exactly what you are wanting to do. I am sure at some point in the future there will be plenty of generic scripts that will cover a lot of what some people want to accomplish, but without knowing lua or LE commands you won't be able to change it to do exactly what you want. The fpsplayer & fpsweapon scripts are a decent place to start for what you are trying to accomplish with weapons. The inherent fpsplayer prefab will load the autopistol prefab and the fpsweapon script will handle its animations. So start simple: first make a prefab from your weapon model and a fpsweapon-like script that will handle its animations. Then try assigning it to the weapons variable in the fpsplayer prefab that you have placed into a scene. If you did things right then you should at least see your weapons prefab when you run the scene. After that, then if you still have problems then post questions on the forum. There are always people here willing to help. What always helps a person to get a faster response to their problem is if they actually provide some way for Josh or the community to actually be able to reproduce the issue. You posting your models and scripts are always useful. And most importantly, if you want a specific answer then ask a specific question.
  8. if you have the world size set to anything other than 1024, it will fail to create a navmesh properly: http://www.leadwerks.com/werkspace/topic/10430-navmesh-generation-problems/#entry76772 Also, it looks like the current version of the navmesh will only be created in the editor on CSG or terrain objects. And for CSG objects only if a primitive physics body has not been applied to it. At the moment I don't know if this is a bug or was intentional - the documentation about navmeshes and their limits for use are unfortunately missing. My only suggestion right now is for you to create primitive CSG boxes located at the floors of your imported meshes, build the navmesh, and then delete the CSG primitives afterwards.
  9. Based on this forum post where an error was occurring during switching of maps: http://www.leadwerks.com/werkspace/topic/10459-load-map-error/#entry76909 It appears that using Release() on a sound that has been played will cause the OpenAl error. If you release the sound before being played, then no issues. example script to show the problem: function App:Start() self.window=Window:Create("Sound Bug Example",0,0,200,150,Window.Titlebar+Window.Center) self.context=Context:Create(self.window) self.world=World:Create() self.camera = Camera:Create() --import "Scripts/Functions/ReleaseTableObjects.lua" sound = {} sound[1] = Sound:Load("Sound/Footsteps/Concrete/step1.wav") sound[2] = Sound:Load("Sound/Footsteps/Concrete/step2.wav") return true end function App:Loop() if self.window:Closed() or self.window:KeyDown(Key.Escape) then return false end if self.window:KeyHit(Key.Space) then local r = math.random(1,2) if sound~=nil then if sound[r]~=nil then sound[r]:Play() end end end if self.window:KeyHit(Key.Up) then if sound~=nil then --ReleaseTableObjects(sound) sound[1]:Release() sound[2]:Release() sound = nil end end Time:Update() self.world:Update() self.world:Render() self.context:Sync() return true end If you press the Up arrow key prior to playing the sounds then there are no issues. If you hit the Space key and play a sound then try to release the sound it will cause the error. Since the fpsplayer script uses the 'ReleasetableObjects' function, it causes this same error when switching maps and the player has been released.
  10. There was an update? Strange - I didn't receive one today.. EDIT--yeah just got confirmation that an update hasn't been released yet.
  11. Look at the example scripts that come with the engine. I believe collisiontrigger.lua will show an example. Also, this page shows the inherent hooks for entity scripts: http://www.leadwerks.com/werkspace/page/documentation/_/script-reference/ edit-- wait LE2.5? How in the world did you get your hands on that? In any case, the lua collisionhook for LE2.5 could be done via an entity script: require("scripts/class") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) object.time = AppTime() function object:Collision(entity,position,normal,force,speed) if self.time < AppTime() and entity.collisiontype==COLLISION_CHARACTER then self.model:SetColor(Vec4(math.random(255)/255,math.random(255)/255,math.random(255)/255,1),1) self.time = AppTime() + 2000 end end end
  12. For whatever reason, sounds are failing with the command Release(). By using Release() to free the sound it causes the 'OpenAL: AL_INVALID_OPERATION' error. By changing the script 'ReleaseTableObjects.lua' to set the variable to 'nil' instead of Release() prevents the error from occurring, but I am not too convinced the sound has been properly released from memory. function ReleaseTableObjects(t) if type(t)=="table" then local key,value for key,value in pairs(t) do if type(value)=="table" then ReleaseTableObjects(value) elseif type(value)=="userdata" then --value:Release() value=nil end end end end There are a lot of example scripts on this forum provided officially by Leadwerks and its community members. One community member, Aggror, has even taken the time to make several tutorial videos to help out. If you are not watching those as a 'noobie' then you are probably missing out on decent information to help you get started. And as always, use the forum to search for answers, and if you can't find the answer then post a question on the forum. So far I don't think many people have had their questions go completely unanswered.
  13. In LE2, there were a number of things that affected shadows EntityShadowRange - which set how far away from the camera the entity would cast a shadow SetShadowDistance - which set the distances where the shadow resolution changed for a directional light However, I do not see either EntityShadowRange or SetShadowDistance equivalent commands exposed to LE3's lua. I do not know if they exist in the c++ verision.
  14. Use the 'shadow+alphamask.shader' for the material's shadow shader - just like it was setup for the chain.material.
  15. yeah i misspoke - was thinking of shadmar's glow that was in the workshop... I didnt see the emissive shader... for emissive the texture slot is 4
  16. By performing a dump of all the globals in LE's lua implementation, I can see that Math:Lerp is indeed missing.
  17. A post here about theora made me remember the previous LE2.31 implementation done by community member Niosop, who graciously provided a route for us to put *.ogg videos into LE via entity scripts. After updating his scripts to LE3.2 Indie scripts, I was able to get it working. I had planned on posting it via the workshop but I had a number of issues with it. One of the issues was that I couldn't get it to expose the script variables in the properties dialog when you attached the needed workshop script - so no easy way to select the video you wanted to play. In any case until that is sorted, here are the updated LETheora scripts with the example tv model that was created by our dear late community member . LETheora.zip The script is set up to allow you to pick an *.ogg video via the properties dialog after you attach the 'video_entity.lua' script to the mesh you want to view it on. In the case of the 'Old-TV' model, you would attach the script to the child mesh named 'Screen', then pick the *.ogg file you want to play.
  18. Nice work. I hope you figure out the leak issue and get sound working. Based on this post, I went back and looked at the old theora video implementation we had back in LE2.31 days and reworked the lua scripts to get it working in LE3.2.
  19. I think this grabs everything you are trying to do. It lets you pick the prefabs to be loaded, the number of spawned items, and the time in seconds between spawns. Right now it spawns the prefab 2 meters above the scripted entity. Script.spawnrate = 5 --float Script.spawncount = 5--int Script.item ={} Script.item[0] = "Prefabs/Props/barrel01a.pfb" --path Script.item[1] = "Prefabs/Props/cardboardbox.pfb" --path function Script:Spawn(rand) self.spawn = Prefab:Load(self.item[rand]) local entpos = self.entity:GetPosition(true) self.spawn:SetPosition(entpos.x, entpos.y + 2, entpos.z, true) self.spawntime = Time:Millisecs() end function Script:Start() self.spawntime = Time:Millisecs() self.counter = 0 end function Script:UpdateWorld() if self.counter < self.spawncount then if Time:Millisecs() > self.spawntime + (self.spawnrate * 1000) then self.counter = self.counter + 1 math.randomseed(Time:GetCurrent()) local rand = math.random(0,1) self:Spawn(rand) end end end
  20. What Aggror said and you are over-riding your 'self.item' table in the Start function. You created a table but set both variables to 'self.item[1]'... should change to a [0] & [1]. And you haven't associated the actual prefabs being loaded to the variable names. And you are doing a math.random between 1 & 3 but don't have that many table elements for self.item. The error you just had is because the line should be: if self.counter >= self.Spawncount then... 'Spawncount' is undefined (nil) and in itself is a different variable from Script.Spawncount (=self.Spawncount inside a Script function) The same issue will occur with 'lastSpawnTime' since it is not defined.
  21. function App:Start() self.window = Window:Create() self.context = Context:Create(self.window) self.world = World:Create() self.camera = Camera:Create() self.camera:Move(0,0,-3) local light = DirectionalLight:Create() light:SetRotation(35,35,0) self.model = Model:Box() self.model:SetColor(0.0,0.0,1.0) self.prevZ = self.camera:GetPosition(true).z self.posZ = 0 return true end function App:Loop() if self.window:Closed() or self.window:KeyHit(Key.Escape) then return false end self.model:Turn(0,Time:GetSpeed(),0) local div = 5 self.posZ = Math:Curve(self.prevZ + (self.window:GetMousePosition().z/div), self.posZ, div/Time:GetSpeed()) self.camera:SetPosition(0,0, self.posZ) Time:Update() self.world:Update() self.world:Render() self.context:SetBlendMode(Blend.Alpha) self.context:DrawText("Mouse Wheel Position: "..self.window:GetMousePosition().z, 2, 2) self.context:DrawText(string.format("Camera Z Position: %.2f",self.posZ), 2, 22) self.context:SetBlendMode(Blend.Solid) self.context:Sync() return true end
  22. and swept collisions are turned on on all those boxes? i don't know at this point... other than to make the boxes physics body one solid entity instead separate one for each box? if all the boxes are meant to be static then no reason not to make everything use one physics body...
  23. look at the FPSWeapons.lua script - is being used to cast an instance of an emitter to the emitter class
  24. i believe you are looking for 'tolua.cast(entity,"Model")' edit- shadmar sweeps in with the answer at the buzzer!
  25. what does your controller:Update() function look like? did you try turning up the iterations parameter?
×
×
  • Create New...