Jump to content

AggrorJorn

Members
  • Content Count

    4,815
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. Here is a playlist to learn Lua and some lua specific functionality with Leadwerks.
  2. Have you searched in the workshop? First result for explosion: https://steamcommunity.com/sharedfiles/filedetails/?id=932421043&searchtext=explosion
  3. screenshot of scene and the settings perhaps? Restarting the editor? new test scene to try it out?
  4. IMaybe the enemy is close enough to the player, it stops moving and goes to the fighting animation. Perhaps there is no fight animation and moving is not enabled again.
  5. What do you mean with pack? Do you mean 'placed it in the level' or did you make a prefab? Can you post a working project (excluding assets that are not needed to reduce file size)? I will have a look this evening.
  6. I can get the editor/game crashing, but BSOD's? Can you check the windows event log and post any possible related errors here?
  7. Often starting in debug mode, can give you at least an error instead of just a crash. Starting adding nil checks and print out a console warning when something is nill when it shouldn't be
  8. Works fine for me. 1000 is a very high range value. I tested it with 50 1 character controller with default fps script 1 pivot with your soundsource script
  9. The source is now fixed at position vec3(0,0,1) which might not be the actual position of your helicopter. Can you upload the sound? I will try out on my pc and send you the results. source:SetPosition(sel.entity:GetPosition(true)) --Retrieve the position of the helicopter Note that if your helicopter is moving, you need to update the position of the source.
  10. I am assuming this means 'I use the default FPS player script that comes with Leadwerks'. This script creates a listenere. So if you have antther script in your scene that also creates a listener (either by attaching the script to an object or by using main.lua) than these 2 listeners are conflicting. Try creating your sound, without creating an additional listener and move your character close to the position of the source.
  11. Are you using the default character controller like @Thirsty Panther mentioned? If you do, the character controller script already creates a listener for you. Which is then probably conflicting with the listener you made. Can you share the entire script you are using right now?
  12. If you try out the example from the documentation and swap the audio with your helicopter sound, does it work? https://www.leadwerks.com/learn?page=API-Reference_Object_Source_SetRange range = 1.5 --Create a window window = Window:Create() context = Context:Create(window) --Load a sound local sound = Sound:Load("Sound/heli2.wav") --Create a source source = Source:Create() source:SetSound(sound) sound:Release() source:SetLoopMode(true) source:Play() source:SetPosition(Vec3(0,0,1)) --Create a listener local listener = Listener:Create() listener:SetPosition(0,0,0) whi
  13. @Thirsty Panther Is right, leadwerks can do this for you. Sound file needs to be mono formatted though.
  14. fyi: recording (a part) of your screen can be done with the free OBS project: https://obsproject.com/.
  15. Yes, very well done. This already reads better than the very first script. So how does this script perform at the moment? Is it the intended behavior? What is the behavior you would want/expect? Do you have a video to display what is going on in your game right now?
  16. When a function has parameters (like the 'isNegative' example), then these do have any values automatically. They only get a value assigned to them when you call the function, and pass in existing values. Regardless if the calculations are correct and regardless whether this can all be done in a few lines with the right calculation, right now I am more concerned about how your code is structured. By organizing your code, we can find the solution faster. So lets try and break the code down from your very first post and imrove it step by step. Looking at the if statements Your cod
  17. Thanks for the replies @Thirsty Panther and @gamecreator. I am afraid the models that I bought do not have this element LayerElementColor but instead are refering to a material. There are no textures in the model pack, so I guess some other tricks are applied in other engines. Anyway, I am sure I can find some fbx batch export with color vertex somewhere for blender. Thanks for the help. If I find something useful, I will post back here.
  18. Okay lets first practice by making a very basic function. Lets make basic functions that returns the calculation that happens several times in your code: Take for instance this line: local Y = y+(-Math:Sin(a)*(enemy.z-pos.z) + Math:Cos(a)*(pos.z-enemy.z)) This line already exists 6 times in your code. So if you have an error in this calculation, you have change it 6 times. This makes your code hard to read and mistakes are easily made. So lets try to turn that in to a basic function: function GetYDrawCoordinate1(y, enemy, pos) return = y+(-Math:Sin(a)*(enemy.z-pos.
  19. Regardless of whether the code is right, I think your script can become a clearer/easier to read if you make use of functions. Every single if statement does more or less the same thing with only slight deviation. --current first if statement local X = x+(-Math:Cos(-a)*(pos.x-enemy.x) - Math:Sin(-a)*(enemy.x-pos.x)) local Y = y+(Math:Sin(a)*(enemy.z-pos.z) + Math:Cos(a)*(pos.z-enemy.z)) context:DrawRect(X,Y,s,s) --Format to: if statement local drawCoord = GetDrawCoordinate(Vec2(X, Y), playerPos, enemyPos, true, yRotation) context:DrawRect(drawCoord.x, drawCoord.y, s, s) end --Helper
  20. With the new engine in development, the forum itself has become rather quiet. You will find most activity in the projects section as well as the official discord server.
  21. Should vertex colored fbx models work out of the box? I have a collection (+100) models that are vertex colored instead of having any textures. Loading them in using the editor, they remain grey. I tried to see if would require some sort of default empty material but to no avail. Opening them in other engines works directly. Does anyone have experience with this? This topic mentions altering some info in blender, but I am looking to see I can achieve this without actually altering all 100+ models in an external modeling program.
  22. There is no build in way to force the pivot3 scripts from being exucted first. What you can do is wait a couple of frames before calling the for loop in your pivot 3 script.
  23. Please, for future posts, attach your entire script in the question (and in code format). The community wants to help you and the more information you provide, the faster you are going to get a solution.
  24. Without seeing the actual script you have right now, we can only guess as to why it doesn't work. The script:hurt() function looks a little of. I think you want to use: if window:KeyHit(Key.U) then self:hurt (100) end See this tutorial on functions https://www.youtube.com/watch?v=x9Wi8Rh7M58
×
×
  • Create New...