Jump to content

Gonan

Members
  • Posts

    186
  • Joined

  • Last visited

Everything posted by Gonan

  1. Findings of publishing with fps weapon pack, adding Pickup M4 to the scene. Running under the editor works. Publishing to the desktop - no weapon is displayed, unless the data.zip file is emptied, and the project folders copied in. Also note the Lua sandboxing is disabled when running in this way. Publishing to steam workshop, "atest33beatupdate", friends and admins only, the initial weapon works and displays, the M4 displays but cannot be picked up by running over it or pressing "E". This was still using the latest 3.3 beta.
  2. 1 Follow this topic var FAVE_TEMPLATE = new Template( " Unfollow this topic If you unfollow this topic you will no longer receive any notifications "); published atestmap shows no weapon, works ok in editor, beta 3.3. Josh has fixed the issue of publishing to Steam, with an update available in the beta version. Thanks Josh. I have created another test map, friends and admins only, and published to steam using the menu workshop>Publish File as a game and the weapon now stays visable. My previously publicly published game MidnightPatrol once again works as expected. I did not need to republish it. Using the Project Manager, Publish to a desktop folder, still looses the weapon display. If I remove the contents of the zip file and copy the project subfolders into the published desktop folder, then the display returns. As soon as I create a zip file with any contents in the folder, the problem re-appears. Even if that content bears no relation to the game. I think this would mean if you wanted to publish a stand alone version to non Leadwerks users you would not be able to use items that need to be protected in the data.zip with a password, like assets in addons folders. I'll check with the FPS weapon pack tomorrow.
  3. I went to my WIP folder, and I didnt do the update, and it worked ok. After the Project Manager update, my problems returned. So I replaced the scripts I had updated with vanilla ones from the mygame and still had problems in that the crawlers were no longer animated. So I stopped leadwerks, and opened the mygame project, and copied the crawlers from prefab and model folders, deleting the original folders in my WIP. Restarted my WIP project and the animation is now working. I will have to re-add the customised logic back into my WIP. Is there any guidance on what or how to modify the .lua scripts so that we are protecting our code from being updated, if we are not supposed to update the supplied .lua scripts, whats the best way of inserting our customised logic?
  4. The version of MidnightPatrol was last updated on the workshop on 5th November. I'm pretty sure it was working with the auto pistol loaded at that time. I have a stand alone version built a couple of days afterwards, and that still works, It doesn't have steam initialised. So something has changed to stop it working, I am assuming Josh doesn't and hasn't run the steam broadcast beta. Ill try recreating another stand alone version.
  5. I'm having lots of problems with leadwerks since joining the steam broadcast beta. I had put it to allow anyone to view, and started playing MidnightPatrol on the leadwerks game player. When looking at game on the workshop, it was not showing a weapon, no error message in the log, but also not showing a loading in the log for a weapon either. Can anyone confirm that the weapon loads if the haven't started using the steam broadcast beta. Ive opted out of the steam broadcast beta, re-booted my pc. I have also tried to publish using the project manager, with a backup of my game, to the desktop, again no weapon. Exporting creates a zip, expanding the zip, gives a game but the character aren't animiated, but the weapon is displayed with cross hairs as it should. However as soon as an AI attack begins the game freezes, with a lua error, not enough memory appearing after about 30 seconds. I also noted that the project was marked with ! and needed an update in the project manager. And this updated 6 files. I've opted out of the broadcast beta but the problems still persist. I don't know if it is the steam broadcast beta, but thought I had better warn others to be wary in case it is. I am also using leadwerks beta , but don't know how to get back to the 3.3 release. There isn't an option on the properties to not participate, so its still showing as beta on my steam library. So it could also be a beta update of leadwerks.
  6. I wonder if anyone else has noticed this happening to them. I haven't found the cause, but its happened about a dozen times over the last month. I have a water.lua script which has as its first line. Script.CameraOrPlayer=nil--entity This creates a CameraOrPlayer box on the Scene - Script tab. I drag and drop the Player from the list of items in the Scene to the box, and the box now says Player. All is fine for a while and I repeat my programming / testing cycle without issue, until it says it can't run the water.lua script because CameraOrPlayer is a nil value. When I check the Scene Script CameraOrPlayer box, I find that its empty, and have to re-drag Player back into it. Then its alright again for a while.
  7. @shadmar, you don't need to see my shader, because you are brilliant, I passed the texcoords0 via an "out vec2" through from the vertex shader and used them as an "in vec2" in the fragment shader and it works. Thank you so much, I've been trying to get this working for 2 weeks, starting with zero knowledge of shaders, got your water effect working with the wobble shader for underwater within a couple of hours, and then tried to get lava to work. I even started going through Jamie King's youtube video course on OpenGL upto video 55, of 99, and we have just covered the world to view matrix, so thought I needed the inverse function, and was trying all sorts of combinations of matrix transforms to no avail. 2 minutes after reading your post, I was up and running.
  8. I'm trying to use a fragment shader to represent moving lava, I've found a shadertoy lava but if I try to use that in leadwerks i can get a moving image but it doesn't move with the first person camera. I know that the screen coordinates that I am using need to be changed to a world based system, but I have been unable to get lava plane to have a 3D appearance, ie further away patterns look smaller and near patterns look bigger, and if I move the camera the view doesn't move. The function I am using, at its most basic starts with vec2 p = gl_FragCoord.xy; I think I have to manipulate this into a world position, but I don't have the knowledge on how this can be converted. I think I have to use various transformations that invert those made by leadwerks. Is what I am trying to do possible. Ive tried to use the shader on a material, applied to the plane, but if I do it that way I don't get the lava swirling on the screen, but it still fails to follow the camera. Ie the image of the lava remains fixed to the viewport. At the moment, I have a Lava.mdl, just like a water plane, a lava.lua script which loads a lava.shader. The script sets iGlobalTime as a float, which just counts in 0.005 increments. The other variable is a vec2 iResolution set to context:GetWidth()*2 and context:GetHeight()*2 Though if I try to divide gl_FragCood.xy by iResolution the lava fails to display except as a solid colour. Does anyone have a Fragment shader code snippet that converts coordinates back to world coordinates for Leadwerks? Thanks in anticipation.
  9. I got an error (target nil value) when I was killed by several monsters. Only one of them actually kills you but the others may still call EndAttack() The fix is simple, after the second line of function Script:EndAttack() if self.mode=="attack" then -- add these 4 lines if self.target==nil then self:SetMode("idle") return end -- the script then continues with if self.target.health<=0 then
  10. Slight UI bug here, when you drop onto the root, the drag icon remains in place, so you don't have to left click, you can also scroll to get rid of it. When you drag onto other scene entries the icon disappears correctly.
  11. Thanks both solutions work. Ctrl-z undoes other things done in sequence in the current editing session, so selecting the item to make a child and clicking ctrl-z doesn't make it a child, unless it was the last action done, or you undo you other actions to get to the one that put it there. If you have saved the changes and reloaded Leadwerks you will need to use the drag to the scene root method. Dragging the child to the root of the scene tab - dropping, and left clicking on the root also works, though you will probably need to use the mouse wheel to get to the root, as the scene tab doesn't auto scroll while dragging. If you don't have a mouse wheel you can drag it to other parents and scroll and re-drag to reach the scene root.
  12. Can create and move an entity in the scene tab to become a child of another, for instance a light to become a child of Player. However If I want to undo that relationship, I can't find a way to do so. I can move the child to become a child of a different parent, but not to make it independent. Is there a trick to performing this action?
  13. I noted that if there was 1 particle, the effect of no particles in use, was not noticeable at all, with 1000 about 50 fps, with 4000 15 fps, and with 6000 12 fps, and 9999 7 fps. So I created two script functions in the emitter script. function Script:OneParticle()--in tolua.cast(self.entity,"Emitter"):SetParticleCount(1) end function Script:MaxParticle()--in tolua.cast(self.entity,"Emitter"):SetParicleCount(5000) end Then by using the trigger delay functions with a delay of 5000 set up the flow graph links so that the turning off switch called Pause()function and Activate() for the trigger delay. Output from OnActivate() was then taken to the in for OneParticle(). The delay was required so that particles which had just been emitted had time to fly though the air and disappear through the terrain, without the delay they just vanished mid flight. The turning on switch output was linked to Play() and MaxParticle() as no delay was required. Now the frame rate just slows from 40 fps at the beginning of play() to about 16 during the emission phase, as the last particle disappears it recovers to 60 fps (occlusion culling is set) then climbs to 110 fps. If I hit the pause switch and the emission sequence had finished, I get a 5 second drop in frame rate to 10 fps, then it recovers to 130fps as the particle count is set to 1. Note the emitter is not paused its playing with no visible particles to get this frame rate drop.
  14. The framerate drop seems to happen after the last particle that was emitted and no longer processed. The stages are Emitter Playing - frame rate slow but useable. Emitter Paused - frame rate still similar no new particles are emitted. frame rate slowly speeds up a bit if occlusion culling is selected, the frame rate speed up faster as the particles disappear from view under the terrain after 20 seconds the last particle has long since disappeared and the frame rate is going quite fast by now, but then suddenly dips to very slow.
  15. I've been messing around with emitters for the last few days, and found what seems to me a couple of strange behaviours. Using the debug Lua build in Leadwerks on steam 3.2. 1) FPS drop. If you pause an emitter, either by not starting it, or using tolua.cast(self.entity,"Emitter"):Pause() in your Script attached to the Particle Emitter (in the Emitter tab - Play and Loop are unticked) before its completed its full pass of particles, the frame rate drops off, I get 4 to 7 frames per second, with 9999 Particles and Duration 18000. When the particles are playing I get 25 to 30 frames per second. If I let the sequence finish I get 70 to 80 fps. 2) I have set up a box, called BigSwitch1, and attached a script, which has a Collision function. Even though I have not begun to play() the emitter, I get certain numbers of collisions reported from the Collision function. These numbers vary depending on the Physics mode and Collision type, I get a fixed number of hits from the non playing emitter. I use this line in the Collision function with in the BigSwitch1.lua script to report the collision. System:Print("Collided with BigSwitch1 was "..entity:GetKeyValue("name")) The Output log shows the hits coming from ParticleEmitter2, which is part of my loaded map. I can get 6 7 or 19 hits reported, these occur as soon as the scene appears on the screen. After that no more collisions are recorded as coming from ParticleEmitter2, but hits from Player do report without problem.
  16. In the documentation for Entity::EmitSound it says a source is automatically created and managed by the entity. Is there a way of controlling the sound so that in the Lua script for the emitter, when I pause and play, I can also pause and play the sound by gaining access to the source that the EmitSound created. I'm not hopeful, as I can't see the sound source in the debugger.
  17. I found the problem with the emitter not displaying in game. This was when I ticked the Shape hint, on the physics tab the emitter no longer displayed in game, but was ok in the editor, but if I unticked it, it was ok in both.
  18. Thanks Rick and macklebee, I am new to Lua, but experienced with C++. No luck with the FindEntity function. I am now trying the Map:Load with the script option, to see if I can access the ParticleEmitter2 I am using steam leadwerks 3.2, not using the beta. Should I switch to the beta?
  19. I have created an erupting volcano map, by adding a particle emitter to the caldera (volcano's crater), in the editor, with Realtime Render option ticked, it displays the blobs of lava flying out all around the volcano. When I try to run it from script, in debug or run, the map loads but the emitter does not display. I thought maybe its been Reset and I need to get it to Play(). I can not find how to reference the objects which show in the Scene tab in the map editor, from Lua script. I don't want to create the emitter, and set its values, within the script. In App.lua i've set up the map to load --Load a map local mapfile = system:GetProperty("map","Maps/Erruption.map") If Map:Load(mapfile,1)==false then return false end // play ParticleEmitter2 which is the last item added on the Scene tab in the map editor. ParticleEmitter2.Play() // gives Error attempt to index global 'PaticleEmitter2' (a nil value) return true end How should I reference that emitter contained in the loaded map using lua code? Ive tried, prefixing the line with self.map., self.world.map. , self.context.map. self.world: and lots of other combos to no avail.
  20. Wow that's a speedy answer, 3 minutes. Thanks Josh.
  21. Will it be possible to use Leadwerks to simulate liquid, or gels, or beings, flowing over a landscape, such as a burst pipe, a leak from a petrol/gas tanker, or a lava flow down the side of a volcano or the eruption at the caldera. I was thinking of particles, having a mass, but also having properties like temperature, viscosity, heat loss, but instead of particles being free roaming, they have an attraction force to their neighbouring surfaces, which could be the ground or other particles, which increases with the viscosity. The could be given an initial velocity, which could be flowing or flying. For instance the lava eruption would initially fly then flow, when it hits the ground, it would transition from flying via splat processing, before starting a flow process, then if the ground disappeared, like over a ledge, there would be a pour transition back to flying. This could be used to simulate dams breaking, rivers overflowing, moving glaciers or avalanches, or even how crowds of people/zombies would behave if they were pushing though a cordon, or lemmings doing what they are most famous for. Once the movement stops, a final phase, which could be ignition, or evaporation, or seepage, or freezing.
×
×
  • Create New...