Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. Can you post your map + scripts? Without a mass the player won't move, so input controls are discarded. For some reason the mass is not set or being removed before you take your first steps.
  2. Can you also post a screenshot of your player's physics tab properties? Make sure the mass of the entity is adjusted that has the player script attached.
  3. Please use a code tag for your code. Can you describe what exactly isn't working? Do you see an error? What behviour are you seeing? Omit parts of your script that are not relevant for now (make a backup though): for instance the sound and drawing ui. So you have this helicopter and by pressing a button, you want to fire a rocket? You want to separate that functionality. Try something more in this direction. A script for the helicopter and a script for a rocket. Helicopter --psuedo if keypressed then local spawnPosition = self.entty:GetPosition(true) local obuz = Prefab:Load("Prefabs/obuz.pfb") obuz:SetPosition(spawnPosition) obuz.script:Start() end Rocket function Script:UpdatePhysics() self.entity:AddForce(0,0,obuzforce) end function Script:Collision(entity, position, normal, speed) local collisiontype = entity:GetCollisionType() if collisiontype==Collision.Prop or collisiontype==Collision.Scene then --Create an explosion emitter here end end
  4. Again, many ways to do this. Some possibilities: Let each enemy perform a distance check once a loop or after a timer is done. --in enemey UpdateWorld local playerPos = self.entity:GetPosition(true) local enemyPos = self.playerEntity:GetPosition(true) local distance = playerPos:DistanceToPoint(enemyPos) if distance < 1.5 then --1.5 is just an examepl. System:Print("within attack range or something") end Or you let the player do a ForEachEntityinAABB. This retrieves all entities within a give shape around the player. Then for every entity it finds,check if it is an enemy and you can do things. --player updateworld local playerSurrounding = self.entity:GetAABB(Entity.GlobalAABB) local world = World:GetCurrent() world:ForEachEntityInAABBDo(playerSurrounding, "MyCallback", self.entity) function MyCallback(entity, extra) if entity.script ~= nil and entity.script.isEnemy then System:Print("this is an enemy in the players region") end end
  5. There are several ways to do this. Script property. If is it an occasional entity that needs a reference, just use a script propery for entities and drag in the player. Script.player = nil --entity "Player" If many objects require a reference, I would handle it automatically. At the start of each script, loop over the entities in the world and check if the player is among them. If the player name is unique, then you can do something like this: local n for n=0, world:CountEntities()-1 do local entity = world:GetEntity(n) if entity:GetKeyValue("name") == "MyPlayer" then playerEntity = entity break end end Note that you might want to store the player reference somewhere as it is used a lot. Saves iterations on start up.
  6. If your remove your sound code, does the error still appear? Your main menu seems fine further. Any chance you modified the menu.lua?
  7. Can you add the code via a code tag? It is really difficult to read this way. Not sure if it is the issue but you can make 'source' a local value. local source = Source:Create()
  8. It is good that you are trying to make your own stuff work first. And if you are really stuck, don't hesitate to ask. That is what the community is there for.
  9. Adjusted the script. Properties need to be declared with 'Script'.
  10. There can be only 1 UpdateWorld function per script. Some feedback on how to use Vec3 instead of 3 separate variables for the coordinates. local CamRot = {} CamRot[1] = Vec3(0, 270 ,0) CamRot[2] = Vec3(0, 180 ,0) self.entity:SetRotation(CamRot[1].x, CamRot[1].y, CamRot[1].z ) All together I would do something like this instead. Once you hit a trigger, simply place the existing camera at the position and rotation of a linked camera pivot. Attach script below to a pivot. self.camera = nil --entity "Camera" self.cameraPivot = nil --entity "Camera pivot" function Script:Start() self.position = self.cameraPivot:GetPosition(true) self.rotation = self.cameraPivot:GetRotation(true) end function Script:SwitchToCameraPivot()--in self.camera:SetPosition(position) self.camera:SetRotation(rotation) end
  11. Spline paths with physics. Using the 4.4 kinematic joints we get very stable physics movement. Ideal for platform or trains (think Halflife intro) Also a big thanks to @Phodex Games for the cool intro.
  12. You might want to send a message to Josh. Perhaps he can send you a key. support at leadwerks.com
  13. Can you define "limited"? Is this a Steam thing were you need to have at least a number of games or money in the Steam wallet?
  14. Maybe there is a new policy for new games or something. This is what I am seeing:
  15. I think the official documentation could use an upgrade regarding the usage of the deafult shaders. The information is quite scattered or not existing atm. You have to try out the examples and see what the official leadwerk maps/assest use.
  16. I don't know Spanish,but I guess 'Solo amigos' means something like "visible to friends only". You should have an option for it on steam. Somewhere at the same spot where you can edit the description.
  17. You are pretty close actually. You create a new instance of an emitter and place it at the collision point. if (entity:GetKeyValue("name") == "obuz") then local explosion = Emitter:Create() explosion:SetPosition(position) end After that you can do the respawn of the rocket. Alternatively you can also just create a new instance of the rocket and simply destroy the rocket once it explodes.
  18. That sounds like a bug. Can you post your map in the bug section?
  19. I don't think this works because you can't upload all filetypes. Not to mention that you do not have any source control. Josh mentioned once that gametemplates would be added to the workshop but that has been a while ago. I would recommend an opensource repository using github, gitlab or bitbucket. You could do something like I do here: https://bitbucket.org/Aggror/projectoled
  20. Since this question comes up quite often and the official documentation is lacking, a quick tutorial:
  21. Shaders are set via materials. So look for your vegetation material and go to its shader tab.
  22. Hi there and welcome to Leadwerks. For painting vegetation and rocks in the editor you require certain shaders to be set. leaves the leaves.shader rocks require the groundrocks.shader. If you post a screenshot of your rocks material file (and specifically the shader tab) we can see if everything is correct there. You also might need to delete the existing generated billboards for the rocks, if you apply new shaders.
  23. I dig the atmosphere. Reminds me of Planet base. Could be me but it looks like the rocks are not alligning to the terrain. Are you using the groundrocks shader? Be careful with copyrighted music. Youtube's music algorithm is able to detect music like this and your video can be automatically taken down. A simple mention of the theme song isn't a free pass. A video of mine got taken down once.
  24. AggrorJorn

    Button Exit

    just fyi: If you are sticking to 4.3 you can use https://bitbucket.org/Aggror/flowgui which is free.
  25. Does the workshop store allow bundling for a different price like you can do in the free workshop? Or do you mean as an actual separate object upload? The first one would be nice since maintaining multiple packages seems like a hassle.
×
×
  • Create New...