Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. You keep saying that but yet I am finding otherwise.
  2. Are you sure? https://en.wikipedia.org/wiki/Portable_Network_Graphics Probably just an error on Scrotum's part or a problem when he exported from SD. Also, he hasn't stated what compression method he is saving the LE tex file. The default conversion is DXT1 which doesn't support transparency. If the inherent example in the AI and Events map, doesn't help then my suggestion is for him to actually post the textures in question.
  3. True, but that is exactly why I suggested to make multiple sources. If its ambient music and only one should play in any given area or time then yes you can use the same source. But one source for all of your sounds will result in cutoff and only one sound playing at a time. window = Window:Create() context = Context:Create(window) sound = {} sound[1] = Sound:Load("Sound/Ambient/submarineroom03.wav") sound[2] = Sound:Load("Sound/Doors/fdn_door_automatic_servo_driven_close_short_05.wav") sound[3] = Sound:Load("Sound/Machinery/fdn_lift_apartments_lift_travelling.wav") choice = 1 source = Source:Create() source:SetSound(sound[choice]) source:Play() while window:KeyDown(Key.Escape)==false do if window:Closed() then return false end if window:KeyHit(Key.Space) then choice = choice + 1 if choice>3 then choice = 1 end source:SetSound(sound[choice]) source:Play() end Time:Update() context:Sync(true) end
  4. Well you can only lower the volume of a source. The footsteps are just being played as a sound and not a source. But you can make some minor additions to the script to use a source to play the footstep sounds. In the Script:Start function: ... ... self.sound.footsteps.concrete.step[4] = Sound:Load("Sound/Footsteps/Concrete/step4.wav") self.sound.footsteps.concrete.jump = Sound:Load("Sound/Footsteps/Concrete/jump.wav") self.source = Source:Create() --add this and in the Script:UpdateFootsteps() function, change the end of the code to look like this: ... ... if t-self.lastfootsteptime>repeatdelay then self.lastfootsteptime = t local index = math.random(1,4) --self.sound.footsteps.concrete.step[index]:Play() --commented out self.source:SetSound(self.sound.footsteps.concrete.step[index]) --added self.source:SetVolume(0.05) --added self.source:Play() -- added end Keep in mind you will need to create sources for the other sounds being played for Jump, damage, etc... if you want to control their volume.
  5. thats what i thought as well at first... but the FPSGun script sets the travel variable as a Vec3: travel = bullet.velocity/60.0*Time:GetSpeed() if self.entity.world:Pick(bullet.position,bullet.position+travel,pickinfo,0,true,Collision.Projectile) then where bullet.velocity is a vec3 value. whereas you are just calculating 'travel' as a float: local bspeed=25 ... ... travel = bspeed/60.0*Time:GetSpeed() if self.entity.world:Pick(bullet.position,bullet.position+travel,pickinfo,0,true,Collision.Projectile) then No it works as one would expect. a = Vec3(1,1,1) b = 3 c = a + b System:Print( c ) will display 4,4,4 in the console
  6. Its in the Worn Cottage worskhop download located here: http://steamcommunity.com/sharedfiles/filedetails/?id=429595109 Attaching a model that shows the issue: small cottage.mdl But any of the cottage models show the same problem with not saving the polymesh. It looks like the models have at least one open face - making it not a closed mesh. If I had to guess, I would assume this was making the polymesh fail to work properly?
  7. I think Brutile is referring to this line: A vec3 + a float just adds the float to all the components of the vec3
  8. If you have your heart set on one property key, there are cleaner and quicker ways to write what you are doing. Just write all the points as being separated by only a comma. The first 200 values are for dimension 1, the next 200 values are dimension 2, etc... You are setting the property to make it easier for you to read in the cfg file and it isn't really required for this. This will make the write smaller and then when you get the property value, you just have convert the blocks of 200 into dimensions of your multi-dimensional array.
  9. Looks like part of the context is not being cleared/drawn over in that section of the map but without out having an example to test its hard to say what would be causing that. Maybe an issue with a material setting somewhere? I would break the scene down by first removing the enemy AI then seeing if it still occurs. Then slowly start removing parts of the scene to see if it goes away. Could have something to do with your main loop, but Ive never seen smearing on just a small area and not the whole scene. Its difficult to troubleshoot a video - would be best to get an example that we can run to be able to help.
  10. It means the software version you are using has been updated on steam and it is asking you whether you want to update your project. Typically if you update, its just a handful of files being updated. Read the Project Manager tutorial regarding the 'Updating Projects' section.
  11. Its not the length that is the issue - its the format of how you are saving the data into the file. The multiple equal signs are screwing it up. Typically properties are saved as; Property=Value and you are doing this: profile1=[data] = { [1] = { [1] = 0, [2] = 0, [3] = 0, [4] = 1, ...etc for one property. I just took your text file and removed the '[data]' and all the superfluous equal signs resulting in a 411kb file and GetProperty works just fine when I use this code: ---Get one key's value and set as table function System:GetOnePropertyAsTable(t,name) local s = System:GetProperty(name) local k = 1 for v in string.gmatch(s, "%w+") do t[k] = v k = k + 1 end return t end OneKey = {} OneKey = System:GetOnePropertyAsTable(OneKey, "profile1") for k,v in pairs(OneKey) do System:Print(k.." = "..v) end You just need to figure out a better way to write your multi-dimensional array with SetProperty. Might be easier to just set one property per array but name the property as the dimension.
  12. could be - as you might be trying to use it in a way that wasn't expected or intended. dunno.
  13. Without seeing what you are doing I can't say what's different. Ive tried it sandboxed and not, and it makes no difference, the key doesn't get deleted or overwritten by just performing a GetProperty.
  14. So I run just this code now: --Get one key's value and set as table function System:GetOnePropertyAsTable(t,name) local s = System:GetProperty(name) local k = 1 for v in string.gmatch(s, "%w+") do t[k] = v k = k + 1 end return t end OneKey = {} OneKey = System:GetOnePropertyAsTable(OneKey, "OneKey") System:Print(OneKey[1]) System:Print(OneKey[2]) System:Print(OneKey[3]) And I get this in the console: string1 true 545 And my cfg file still has this in it: OneKey=string1|true|545.0003| My key/value property doesn't get written over unless i tell it to...
  15. When I run just this: --Set table values as one key's value function System:SetTableAsOneKey(t,name) for k,v in pairs(t) do t[k] = tostring(v) end local s = table.concat(t, "|") s = s.."|" System:SetProperty(name, s) end --test code mytable = {} mytable[1] = "string1" mytable[2] = true mytable[3] = 545.0003 System:SetTableAsOneKey(mytable, "OneKey") I get this in my cfg file: OneKey=string1|true|545.0003|
  16. and this is how i would approach setting a table as multiple keys: --Set table as multiple properties function System:SetAllTableProperties(t) for k,v in pairs(t) do System:SetProperty(k, tostring(v)) end end --Get properties as a table function System:GetAllTableProperties(t) for k,v in pairs(t) do t[k] = System:GetProperty(k) end return t end --test code enabled = true mytable1 = {} mytable1.color = "1,0,1,1" mytable1.name = "testkey and value" mytable1.boolean = enabled System:SetAllTableProperties(mytable1) mytable2 = {} mytable2.name = 0 mytable2.boolean = 0 mytable2.color = 0 mytable2 = System:GetAllTableProperties(mytable2) if (mytable2.boolean=="true") then mytable2.boolean = true else mytable2.boolean = false end if mytable2.boolean==true then System:Print("ENABLED!") end
  17. Just taking a simple approach that seems to work okay for setting a table as one property in the config file then reading back in that property and setting to a table. --Set table values as one key's value function System:SetTableAsOneKey(t,name) for k,v in pairs(t) do t[k] = tostring(v) end local s = table.concat(t, "|") s = s.."|" System:SetProperty(name, s) end --Get one key's value and set as table function System:GetOnePropertyAsTable(t,name) local s = System:GetProperty(name) local k = 1 for v in string.gmatch(s, "%w+") do t[k] = v k = k + 1 end return t end --test code mytable = {} mytable[1] = "string1" mytable[2] = true mytable[3] = 545.0003 System:SetTableAsOneKey(mytable, "OneKey") OneKey = {} OneKey = System:GetOnePropertyAsTable(OneKey, "OneKey") if (OneKey[2]=="true") then OneKey[2] = true else OneKey[2] = false end enabled = OneKey[2] if enabled==true then System:Print("ENABLED!") end
  18. Well, you can export the csg brushes in the map via File>Export...- just keep in mind that it will export all the csg brushes as one model.
  19. Isn't the ambient lighting color just passed as a uniform in the lighting shaders? directionallight.shader: uniform vec4 ambientlight; ... ... sampleoutput = (diffuse * lightcolor + specular) * attenuation + emission + diffuse * ambientlight; Can you not just pass your data in place of the inherent ambientlight uniform?
  20. SetGravityMode() works on character controllers as well, its just that SetInput() wont easily be able to control well once off the ground (thinking of the jump aspect). But at that point, you could switch the controls to more of a spectator cam.
  21. Ok, I see what you are saying that it doesn't appear to write to the cfg file until after game closes. But is still appears that setting a property in game allows for you to get that value via GetProperty() while in the same session. So what are you trying to do that requires it to write immediately?
  22. what file does this write to?
  23. Look at the shader: diffuse+normal+specular+emission.shader Also there is an example in the workshop: http://www.leadwerks.com/werkspace/page/viewitem?fileid=265492265 And here is a topic that discusses it: http://www.leadwerks.com/werkspace/topic/12976-glow-effect/#entry92298
  24. Open the model inside the Model Editor and choose the physics shape needed. See the Collision section in the Models and Animation tutorial for more information on how to create physics shapes.
×
×
  • Create New...