Jump to content

reepblue

Developers
  • Posts

    2,600
  • Joined

  • Last visited

Everything posted by reepblue

  1. Here is a water material I've made. Apply it to a face of a box brush and set the collision type to trigger. You also need to add this script to it so it animates the normal map. This is based off an old script Shadmar made but it checks what face the water is on. Just make sure self.Material is the same as the material you've placed on your face. It uses probe reflections so it's very inexpensive when it comes to that. -- Make this the material you used on your face. Script.Material = ""--path function Script:Start() self.textures = { } -- Fetch workshop animated water normals for x=0,9,1 do local name = "water1_"..x..".tex" self.textures[x] = Texture:Load("Materials/Effects/Water/"..name) end for x=10,63,1 do local name = "water1_"..x..".tex" self.textures[x] = Texture:Load("Materials/Effects/Water/"..name) end -- Load material self.mat = Material:Load(self.Material) -- Only apply the water texture to the face where we've assigned it. if self.entity:GetClassName()=="Brush" then tolua.cast(self.entity, "Brush") System:Print(self.entity:GetFace(0):GetMaterial()) if self.entity:GetFace(0):GetMaterial() == self.Material then self.entity:SetMaterial(self.mat) end end self.index=0 end function Script:UpdateWorld() -- Animate normals for texture1 for material if self.index > 63 then self.index=0 end local count = 0 self.index=self.index+Time:GetSpeed()*0.25 count=math.floor(self.index) if self.mat ~= nil then self.mat:SetTexture(self.textures[count],1) end end cheepwater.zip
  2. I remembered the only reason that the option would be grayed out would be if there was no probe. But after making a simple level, adding objects, etc, I can't rebuild GI at my will the option is grayed out. I've tried: Saving the map, and reloading it Moving the probe around Making a new probe Reloading the map after a restart of the editor. All I did was make a boxed room, add a skybox and a few props. It used to work fine before.
  3. reepblue

    Leadwerks 4.1 Beta

    I gotta agree with xtom and Crazycarpet. I was stoked to see the banding issue fixed, but I still see banding with the spotlights, just less of it. So I might just remove banding in the point light and the directional light if I get to a point where the grain is very visible. But great update overall. Really happy we have reflections now.
  4. Updating a game will probably never be painless. However, if we don't update our games, we get nagged by a dialog box to update our game until we do. That might mean a lot of work of reverting some script files, updating shaders, etc. Personally, I'd be happy with a flag to disable the dialog box in the cfg.
  5. Why not include (or convert the common into) a skeleton project that just has the needed files to get the engine to run? C++ user's are most likely going to ignore the scripts and if you edit the existing ones, it might get overwritten in an update. You can make a template hierarchy system in the werk flie. This way you can have multiple templates installed in one project if you wanted too. Would allow much more flexibility for custom templates. Just allow the "Template" entry to read more than one value. Then you can split the core engine components (shaders, executables) in one template folder, and make a new folder (Called SDK maybe) and place the scripts, and vegetation models in that template. to make the current 'blank' template, in the werk file do: Template="Common|SDK" For the FPS template, it'll look like: Template="Common|SDK|Advanced First-Person Shooter" And if you just want the core elements: Template="Common" Just my suggestion. Another way is to just customize the templates folder to your needs, but official updates will cause conflicts. So you'll have to disable updates until you're ready to hand update it again.
  6. I recommend this topic. Josh helped me save a big frame dip in this topic.
  7. Close the window, or have a global bool set to true on start up, then have a script make it false. in Main.lua in the while loop: if running == false then return end Example: -- Quit the game! running = false
  8. It's been over a year ago since I've released the Vectronic Demo using Leadwerks. The demo was composed of assets I've made ported from the Source Engine and my lack of understanding of the API and lua scripting at the time. (I'm used to coding everything in C++) As of writing, it has 1,221 subscribers on the Steam Workshop, 25 out of 26 positive ratings, and is the second most subscribed item! So there is sigh that this as a MVP (Minimum Viable Product) was a success. And again, the Game Launcher is in Beta.. Since the demo, the engine got a lot of improvements and features, and I've learned a lot more about game development in general. (Models, Texture making, etc.) Last summer, I sat down to develop a base application for my projects. I wanted the world, context, and window management to be out of the way while making the full game, and I was concerned about a UI as it was a sticking point when I did a Source branch change from the 2013 SDK to the Alien Swarm Branch in favor of better development tools. (That engine is really fragmented when it comes to things like that....) Once I finished that application; LEX, I then started over developing the game using that template. Two months went by, I've done some interesting puzzles in dev textures.but I felt that one element was taking over the vecball power elements. It was more fun to use that than fire balls at boxes. (And it was more work than the Vecballs) So, I paused development on that project to research if that 'thing I added' would be a better focusing point. I only spent a week on it. I didn't want to work on it too much, just enough to see if it'll work. It turned out, that minus some placement calculation, it was really fun. As you can see, I don't want to talk about it in-case I decide to go with it. November was approaching again, and it's a special time for me. In 2010, I released my Portal mod Blue Portals with mostly positive reviews. Every November, I like to do something to give a reason for people to revisit it. Last year (2014) I fixed the mod so it'd work with the steampipe update, and last November, I decided to put the mod on Steam as an "Anniversary Edition" Although we had massive support about Blue Portals on Steam, there was things I wasn't happy about, and prevented me from putting it on Steam earlier. Some things didn't age well and I've made some poor design choices. There was also some criticism over the difficulty curve (which is kind of common with Portal mods), and somethings just broke. I can spend a few months patching it up, or I can take the extra time and reevaluate the entire project, and have it be a quality mod on Steam. Plus, if the difficulty curve was adjusted, more people can actually play it! This first started as a revamp project, but slowly became it's separate entity with it's own needs. I'm learning a few new things I've haven't known before, and it's interesting how some concepts/techniques I've learned using Leadwerks came into play here. I was first very worried about Vectronic being on the back burner, but then I realized that it's actually a good thing I take a break from Vectronic for the following reasons: I can experiment with marketing, community management, updates with little to no risk. I can try something and see how it goes and decide what I did right and/or wrong with that decision and use it in the future. I can get used to Steamworks, and have an idea going into Steam Greenlight how it's gonna be, which is a plus over most indie devs who need to take time to learn that stuff. Blue Portals: Anniversary Edition can be/will be used as an advertising piece for future projects, I can comfort future consumers with an example of our work before they vote on Greenlight or purchase it on Steam. I was really unsure where to take the project, so coming back with a clear head would help. I have a bunch of ideas now, but not gonna jump into anything now. I see the Blue Portals: Anniversary Edition project (BPAE) as a stepping stone for marketing and consumer confidence. Since the mod can be downloaded with zero risk to a consumer, I feel better taking chances with it then I would a product I'd wish to sell. So what's the battle plan? Continue to develop BPAE. I'm aiming for a December release. Since most research and development have been conducted five years ago, I think if my team and I keep working at it, we can have a polished product on Steam which in return can help sales with Vectronic. I plan on starting to experiment with Marketing next month. I really want to find that "How Early is the right time to show?" mark. My first guess is "When the project has an established direction, but nothing is 100% final just yet.". Which for this project is short of 6 months of development. Continue to chip away at LEX2 as it's going be the new foundation. Unlike it's predecessor, the solution is very minimal and allows for easy C++ entity implementations. I want to participate in the next Tournament using it to make sure it's all solid and good. When BPAE is wrapping up, start programming the yucky gross parts like the player and some custom collision rules. Start thinking how everything will tie together and use the new things I learned with BPAE while making design and development choices. I think doing this while BPAE becomes a touch up project will allow me to not feel like I'm doing the same things on two projects. Start the true cycle of development for Vectronic once BPAE is submitted to be released on Steam. So that's the plan. Taking this one at a time. I'll keep you posted on what I'm doing like always. Although Blue Portals: Anniversary Edition isn't a Leadwerks project, I still think me writing my findings with it can benefit others while making their games. We're all learning here!
  9. Pivot* pivot = Pivot::Create(); pivot->SetScript("Scripts/MyCoolScript.lua");
  10. When will we be receiving these improvements? I noticed the lighting shaders where updating, but the banding still exists. EDIT: it seems that on the left wall of 02-FPS Controller, you can see the left wall, the banding isn't apparent, but the right wall, the banding is still noticeable. Weird part being is that the spotlight is centered, but only one side has the banding.
  11. There is Entity->SetScript(string). I use it all the time, and the bulletdecal script uses it. You can also just make a "C++ Script" class too. Networking isn't officially supported, but a lot of people got Multiplayer games to work.
  12. Different brand? I know when I switch from AMD and Nvidia, I always saw a brightness/contrast level difference in games.
  13. For the past few months, (on top of working on my greenlit mod) I've been developing a new foundation for Vectronic that will take care of all the 'internal yucky bits' such as window/context/world management, and other features and functions. I really wasn't happy how the first implementation came out as I felt like I was taking too much from the developer, and it was messy and confusing to do something simple like adding a loading screen. LEX2 is more lua friendly, not bloated with scripts that you may or may not use, and has more comments than my Blue Portals 2 video in the code! You just need the executables, App.lua, and engine.pak which contains standard assets that the application will call if something is missing. You can play with it here. I've used the latest beta with probes so if you don't have the probe beta, don't load map 07 I guess. Here are somethings you might notice looking at scripts or general usage. Developer Console: LEX2 comes with a developer console for visually debugging your game while you play. Draw stats, show physics, show navigation, or change settings on the fly. All commands use the standard system properties. To access the console, the game must be started with -dev or launched from the editor. When the game is paused, it the tilde key (`) and start typing. Hit Enter to submit your command. You can use PageUp and PageDn to scroll through pass commands. You can type 'help' to report a list of current commands. There is no display box, so it's best used when the game is windowed with the log from the script editor visible. Asset Manager: self.sound = Sound:Load(AssetManager:Check("Sound/MySound.wav)) Never crash again because you moved something or mistyped an asset. AssetManager:Check() returns a error asset from engine.pak if what you've sent is not found. The game will not start at all unless the error assets are found at startup. You can also easily preload models for later use with AssetManager:Precache(string). You can also make a Precache list with AssetManager:PrecacheGlobal(string). This is great if you have a model or prefab that might spawn at anytime in any map. PostStart(): PostStart is a command fired after the level loads instead of during it like Start does. function Script:Start() self.source = Source:Create() self.source:SetVolume(self.volume/100) self.source:SetPitch(self.pitch) self.source:SetLoopMode(self.loop) self.source:SetRange(self.range) self.source:SetPosition(self.entity:GetPosition(true)) end function Script:PostStart() local sound = Sound:Load(AssetManager:Check(self.soundfile)) if sound~=nil then self.source:SetSound(sound) if self.playing==true and self.enabled==true then self.source:Play() end sound:Release() sound=nil end end Input System: if Input:Forward(true) then self.input[1]=self.input[1]+1 end if Input:Backward(true) then self.input[1]=self.input[1]-1 end if Input:Right(true) then self.input[0]=self.input[0]+1 end if Input:Left(true) then self.input[0]=self.input[0]-1 end You can now allow your player to change their controls. by calling a general function. Controls can be controlled with System:SetProperty or by editing settings.config. The control commands are based off of the default steam controller layout. I just need too add previous/next weapon, but wasn't 100% sure how I was gonna do that since it may be a scroll wheel. Basic UI System: Use Lua to create your own UI with LEX2's exposed UI classes. If you replace the app start and loop functions with this code, it'll make a square in the corner with a text button that says "Leadwerks". --This function will be called once when the program starts function App:Start() Rect = UIRectangle:Create(4,4,200,200) Rect:SetColor(40, 40, 40) Rect:SetBorderLineWidth(4) Rect:SetBorderColor(92, 92, 92) Rect:EnableBorder(true) Rect:Hide() local testfont = Font:Load(AssetManager:Check("Fonts/consola.ttf"), 20) Rect3 = UIText:Create(Rect:GetCenter().x, Rect:GetCenter().y, "Leadwerks", testfont, "Test"); Rect3:Center(); Rect3:SetShadowMode(false) Rect3:SetAsInteractive(true) Rect:AddChild(Rect3); return true end --This is our main program loop and will be called continuously until the program ends function App:Loop() context:SetBlendMode(Blend.Alpha) -- Here is code to darken the scene when the game is paused. if self:IsPaused() and self:IsConnected() then context:SetColor(0,0,0,0.5) context:DrawRect(0,0,context:GetWidth(),context:GetHeight()) end Rect:Update() if (Rect3:GetMouseEvent() == Rect3.MouseLeftUp) then System:Print("Pressed!") elseif(Rect3:GetMouseEvent() == Rect3.MouseOver) then Rect3:SetColor(100, 100, 100) elseif (Rect3:GetMouseEvent() == Rect3.MouseLeftDown) then Rect3:SetColor(80, 80, 80) else Rect3:SetColor(255, 255, 255) end if window:KeyHit(Key.F11) then if (Rect:IsVisible()) then Rect:FadeOut() else Rect:FadeIn() end end context:SetBlendMode(Blend.Solid) return true end I haven't really did much with the UI as it's a future feature of the engine, plus I've been playing with other stuff. But with UIRectangle and UIText is pretty much the foundation of buttons, sliders and other stuff anyway. Or you can use another UI library if you want. Again, you can play with it by downloading the project here: https://dl.dropboxusercontent.com/u/16218991/Requests/LEX2Test.7z I'm really stress testing it now making sure I don't have to touch anything when I'm ready to revist Vectronic. Speaking of Vectronic, it's almost been a year since I've released the demo. I might later this week write a blog about it and my battle plan for it.
  14. Sent the side toolbar icons for Josh, and I believe it'll be in the next beta build. Everything should now complement each other, looking great on both Windows and Linux.
  15. YES! Glad to see this was addressed! Gran seems to be much better then bars of lines.
  16. The editor sprites were actually based from the top icons. Again, I'm sure the old editor sprites and the left side icons were made during the sametime period where everything used gradients and was very colorful. Today, it looks very tacky imo. I can whip up some replacements and approach Josh with them. This way, all icons will have a flat look to them.
  17. If you join the beta branch and updated your projects, you'd probably noticed that the low res Leadwerks 2 icons have now been replaced with high resolution ones that match the rest of the user interface. Decals, Particles Emitters, Cameras, and Probes now have their own icon, and you can tell all entities apart just by looking at them. I've originally made these a while ago when I noticed that each entity had it's own material and texture, but most of them just recycled the pivot icon. I've released a version on the workshop, and an updated version as part of the LEX template. Yesterday, Josh contacted me about using them in the official build, and I was more than happy to say yes, and make any wanted changes. He mostly wanted the lights to be yellow, and I've changed the angle of the spotlight to be more downward. Each icon texture is 512x512 uncompressed, and was made using a vector art program so the icons are sharp and clear as possible. These icons will be skipped during the packaging process, so they will not bloat your final game. You can get these icons by joining the beta branch and updating your project. These icons will be released as part of Leadwerks 4.1. If you think anything needs to be changed, let ether Josh or I know. I think the only thing left to do is update the light buttons on the side, really. Here's a mock up of what it can look like. To be honest, I think they kind of clash with the other icons as those where shipped with 3.0 which had some sort of a Windows 7 icon pack for everything else.
  18. Here is a diffuse+normal+specular+roughness shader I did real quick in-case you don't want displacement/parallax. Pretty much I copied and pasted the roughness code from Josh onto the diffuse+normal+specular shader. https://dl.dropboxusercontent.com/u/16218991/Requests/diffuse%2Bnormal%2Bspecular%2Broughness.shader
  19. diffuse+normal+specular+parallax+roughness.shader* Can't wait to play with it, I was thinking about writing my own this morning, but you've beat me too it.
  20. the FPSGun script does this. I'd look at that and convert the bob code to C++.
  21. Wow! Now just need roughness values set in the material so everything doesn't reflect like a mirror!
  22. I noticed that the SlidingDoor.lua script from the Leadwerks 3.0 demo was a tad different from the current stock one. After fixing the Joint:Slider call, I've noticed that doors reset to the exact position it was when it is closed. You can try it for yourself, I've modified the script to have the loop sound, and release everything properly. There might be a good reason why it was changed with 3.1, but I've found it to be more reliable. The door will also not collapse if a lot of heavy objects are on top of it if you're using it as a lift. import "Scripts/Functions/ReleaseTableObjects.lua" Script.enabled=true--bool "Enabled" Script.openstate=false--bool "Start Open" Script.offset=Vec3(0)--Vec3 "Offset" Script.movespeed=1--float "Move speed" 0,100,3 Script.opensoundfile=""--path "Open Sound" "Wav File (*wav):wav|Sound" Script.closesoundfile=""--path "Close Sound" "Wav File (*wav):wav|Sound" Script.loopsoundfile=""--path "Loop Sound" "Wav File (*wav):wav|Sound" Script.manualactivation=false--bool "Manual activate" Script.closedelay=2000--int "Close delay" function Script:Start() self.entity:SetGravityMode(false) if self.entity:GetMass()==0 then Debug:Error("Entity mass must be greater than 0.") end self.sound={} if self.opensoundfile~="" then self.sound.open = Sound:Load(self.opensoundfile) end if self.loopsoundfile~="" then self.sound.loop = Sound:Load(self.loopsoundfile) end if self.closesoundfile~="" then self.sound.close = Sound:Load(self.closesoundfile) end if self.sound.loop~=nil then self.loopsource = Source:Create() self.loopsource:SetSound(self.sound.loop) self.loopsource:SetLoopMode(true) self.loopsource:SetRange(50) end if self.manualactivation==false then self.Use=nil end self.opentime=0 if self.openstate then self.openposition=self.entity:GetPosition(true) self.closedposition=self.openposition+self.offset self.desiredposition=Vec3(self.openposition.x,self.openposition.y,self.openposition.z) else self.closedposition=self.entity:GetPosition(true) self.openposition=self.closedposition+self.offset self.desiredposition=Vec3(self.closedposition.x,self.closedposition.y,self.closedposition.z) end if self.openstate then self.openangle=0 self.closedangle=self.offset:Length() else self.openangle=self.offset:Length() self.closedangle=0 end local pin=self.offset:Normalize() self.base=Pivot:Create() self.base:SetPosition(self.closedposition) self.joint = Joint:Slider(self.closedposition.x,self.closedposition.y,self.closedposition.z,pin.x,pin.y,pin.z, self.entity,self.base) self.joint:EnableLimits() self.joint:SetLimits(0,self.offset:Length()) end function Script:Use() self:Toggle() end function Script:Toggle()--in if self.enabled then if self.openstate then self:Close() else self:Open() end end end function Script:Open()--in if self.enabled then self.opentime = Time:GetCurrent() if self.openstate==false then self.openstate=true if self.opensound then self.entity:EmitSound(self.opensound) end self.component:CallOutputs("Open") if self.loopsource~=nil then self.loopsource:SetPosition(self.entity:GetPosition(true)) if self.loopsource:GetState()==Source.Stopped then self.loopsource:Play() end end end end end function Script:Close()--in if self.enabled then if self.openstate then if self.closesound then self.entity:EmitSound(self.closesound) end self.openstate=false self.component:CallOutputs("Close") if self.loopsource~=nil then self.loopsource:SetPosition(self.entity:GetPosition(true)) if self.loopsource:GetState()==Source.Stopped then self.loopsource:Play() end end end end end function Script:Disable()--in self.enabled=false end function Script:Enable()--in self.enabled=true end function Script:UpdatePhysics() --Disable loop sound if self.sound.loop~=nil then local angle if self.openstate then angle = self.openangle else angle = self.closedangle end if math.abs(self.joint:GetAngle()-angle)<0.1 then if self.loopsource:GetState()~=Source.Stopped then self.loopsource:Stop() end else if self.loopsource:GetState()==Source.Stopped then self.loopsource:Resume() end end if self.loopsource:GetState()==Source.Playing then self.loopsource:SetPosition(self.entity:GetPosition(true)) end end if self.openstate then if self.closedelay>0 then local time = Time:GetCurrent() if time-self.opentime>self.closedelay then self:Close() end end end --Figure out where the door should be local diff if self.openstate then diff = self.openposition - self.desiredposition else diff = self.closedposition - self.desiredposition end local l = diff:Length() if l>self.movespeed/60 then diff = diff:Normalize() * self.movespeed/60 end self.desiredposition = self.desiredposition + diff --Find the difference between where we want the door to be, and where it is diff = self.desiredposition - self.entity:GetPosition() --If the difference is more than a tiny bit, use physics to add forces to make it go where we want if diff:Length()>0.01 then self.entity:PhysicsSetPosition(self.desiredposition.x,self.desiredposition.y,self.desiredposition.z) return end end function Script:Release() ReleaseTableObjects(self.sound) if self.loopsource then self.loopsource:Release() self.loopsource=nil end self.sound=nil self.base:Release() self.base=nil end
  23. Works like: void MapHook(Entity* entity, Object* extra) { LoadingScreen(); } void Changemap(std::string map) { Map::Load(map, &MapHook) } Sill works, this is what I use. Not as dynamic as Lua I've found.
  24. Great work! I really like how it makes a material pop out more.
×
×
  • Create New...