Jump to content

Search the Community

Showing results for tags 'code'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Blogs

  • Development Blog
  • Canardian's Blog
  • Beyond Civilization Blog Ext
  • Tyler's Blog
  • macklebee's Blog
  • B-Byrnes' Blog
  • Marleys Ghost's Blog
  • omid3098's Blog
  • Richardsimpo123456's Blog
  • DJDD's Blog
  • Rick's Blog
  • --
  • xtreampb's Blog
  • Economically Disadvantaged
  • klepto2's Blog
  • Old Blog
  • Chris Paulson's Blog
  • Davaris' Blog
  • nil
  • Rekindled Phoenix's Blog
  • Flexman's Blog
  • Kattemaksu Online
  • Marcousik's Creations Blog
  • EVE LBS Studio
  • Rendering puzzles
  • Screen Size Utility
  • Niosop's Blog
  • 1299 RTS Game Project
  • Blitzbat's Blog
  • gordonramp's Blog
  • Andy Gilbert's Blog
  • Marcus' Blog
  • JornAggror Blog
  • diedir's Blog
  • wayneg's Blog
  • Masterxilo's Blog
  • Dave Lee's Blog
  • peubuy's blog
  • OD Arts -Leadwerks Blog
  • The progression......
  • Ultra Software Company Blog
  • The Progression
  • Pancake's Blog
  • Test Blog
  • BLaBZ Blog
  • Pure³d's Blog
  • dreamhead Blog
  • RVL's Blog
  • DB's Blog
  • Toxin Games Development Blog
  • CombatHelo Blog (RSS Import)
  • Foolish's Blog
  • ZioRed's Corner
  • Toxin Games Twitter
  • Shard - Third Initiative
  • Shard's Blog
  • Soamp's Blog
  • Soamp's Blog
  • Laurens' Blog
  • JT`s warehouse district
  • Kennar's Blog
  • KiteFuchs' Blog
  • KiteFuchs' Blog
  • Rachel's Dev-Blog
  • Eagle's Blog
  • zaphos' Blog
  • please delete this blog
  • Afke's Blog
  • Richard Simpson
  • knowledgegranted's Blog
  • EdzUp(GD)'s Blog
  • aGameLife's Kelasel MMORPG Blog
  • tournamentdan's Blog
  • Beyond Civilization Blog
  • smashthewindow
  • AnniXa's Blog
  • AnniXa's Blog
  • Elemental Development
  • DigitalHax Blog
  • Aria's Blog
  • Strogg76's Blog
  • Clackdor's Blog
  • Leadwerks Project Status
  • simpleprogrammer's Blog
  • Pathfinding in LE.2.x
  • Naughty Alien's Blog
  • smashthewindow's Blog
  • Ali Salehi's Blog
  • Jardar's Blog
  • Chris Vossen's Development Blog
  • Scarlet Thread Studios' Blog
  • Kronos' Blog
  • Benton's Blog
  • ChrisV's Blog
  • tjheldna's Blog
  • shadmar's Blog
  • 3D Masons, LLC
  • Andy Gilbert's Enviro Models
  • ParaToxic's Blog
  • NarkLord's Blog
  • ChrisMAN's Blog
  • ChrisMAN's Blog
  • CGMan's Blog
  • The Game
  • Chris Tutorials
  • Leadwerks 3 Experience
  • An Alien Saga
  • klepto2 & Leadwerks 3
  • Inside the mind of eternal insomniac
  • josk's Blog
  • Shader Development in Leadwerks 3.1
  • 3D Coat : Column game making of
  • Einlander's Blog
  • Ginger George's Blog
  • I have a problem
  • Michael_J's Blog
  • nasamydifol's Blog
  • Digman's Blog
  • noesisGUI
  • SavageDogg38's Blog
  • Built from Ruins
  • Remaining Days
  • test_external_blog
  • The Hunt For Food Blog
  • Crazy Minnow Studio
  • CrazyMinnowStudio
  • Guppy's Blog
  • Playing Online
  • Evayr's Blog
  • DerRidda's Blog
  • Karl's Blog
  • whiterabbit's Blog
  • Tinyboss Games
  • abendkleider's Blog
  • sacguccireplica's Blog
  • Arena
  • Imchasinyou's Blog
  • xtom's Blog
  • Lua is better than you think.
  • mdgunn's Blog
  • Crime Closer
  • lxFirebal69xl's Blog
  • Wedmer's Blog
  • Lockdown, going forward.
  • Pump-Action Captain
  • Igor's Blog
  • Dead Anyway
  • Runenrise and more
  • reepblue's Blog
  • Slippy's Corner
  • LUA Musings
  • severjack's Blog
  • mikeporter's Blog
  • miko93's Blog
  • Megalocerous' Blog
  • lxFirebal69xl's Blog
  • aiaf's Blog
  • Lostghbear's Blog
  • echo $BLOG_NAME > blog_title.tmpl
  • johnadam111's Blog
  • Dwarf Beard
  • burgelkat's Blog
  • Charrua's Blog
  • peterpaul's Blog
  • joshmathews' Blog
  • Martin Kearl's Blog
  • Brutile's blog
  • tipforeveryone's Blog
  • Glushchenko Blog
  • Express Lab Games Blog
  • Blueapples' Blog
  • DooMAGE's Blog
  • Structura devblog
  • UltraEngine - Experiences, add-ons and other Stuff
  • martyj's Blog
  • Dragonfreak's Blog
  • Brutile's Blog
  • assigmenthelp
  • Case Study Assignment Help
  • How to deal with bad grade ?
  • How to deal with bad grade ?
  • GameDev Blog
  • devcjohnson's Blog
  • devcjohnson's Blog
  • THE WHAT? Blog
  • The Demurian Scribe
  • GUI Editor
  • GUI Tutorial
  • noob_shaders
  • The Seventh World
  • Phodex Games Blog
  • Leadwerks VS Source 2
  • Work in Progress - Scifi PBR Media
  • [C++] First Player game start
  • The Blog of Yue
  • Snowboarding Development Blog
  • Ocean: Rendering in Leadwerks 4
  • Game Ready Maps
  • Ultra App Kit (Advanced Custom Widgets)
  • Poking around
  • Blender tutorials
  • Usefull Scripts & Components
  • Thirsty Panther
  • Ultimate Action Game Controller

Forums

  • Software
    • General Discussion
    • Programming
    • Game Artwork
    • Showcase
    • Suggestion Box
    • Bug Reports
  • Addons
    • Extensions & Plugins
    • Components
    • Addon Development
  • Platforms
    • Windows
    • Linux
    • macOS

Categories

  • Streams and Events
  • Tutorials
  • Games
  • Work in Progress

Categories

  • Components
  • Effects
  • Extensions
  • Materials
    • Asphalt
    • Brick
    • Concrete
    • Debris
    • Effects
    • Fabric
    • Ground
    • Marble
    • Metal
    • Organic
    • Plaster
    • Rock
    • Roof
    • Sand
    • Snow
    • Surface Imperfections
    • Tile
    • Wood
  • Models
    • Animals & Creatures
    • Architecture
    • Food
    • Machinery
    • Plants and Vegetation
    • Props
    • Vehicles
  • Scenes
  • Skyboxes
  • Tools

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location

Found 20 results

  1. Just some background: i am making a game for a research project for school. I have no prior experience with coding so I'm a bit dumb Here's my question: How do i code in my animations? there are a lot of little things out there but they don't help me, i would appreciate it if someone were to explain it to me for my specific case. i have all of the animations done, i made them in blender. so far the only code i have is from these two posts, however i've moved the camera so that it is from a third person view: this whole animation thing has really been demotivating as i just dont know what i need so it would be nice to move past this to something equally as painful to find out. btw whilst researching i found there is very little helpful information out there anymore. there are countless posts where there are videos and websites linked however there they are either taken down or private, which is annoying because they could be helpful. either way, thank you for reading, i hope you understand what i mean and hope you might help me. Honestly all i need is a step-by-step (kind of) guide to how i get my animations to show for all my characters.
  2. I discovered that there can only be one eventqueue in leadwerks. I wanted local eventqueue instances, so I created a lua based version of EventQueue called EventQueueEx It is initialized as such: MyQueue = EventQueueEx:Create() It is used EXACTLY the same as the Leadwerks version.
  3. Hey there, Just wondering if there is a place to find scripts made by others that are ready to use? I know Leadwerks comes with some, but I'd like to play around with some others too. I've had a quick look around, can't seem to find any or maybe I just missed them all completely. Thanks
  4. This is a query more than anything. As I read the documentation both Script:UpdateWorld() and Script:UpdatePhysics() are both initiated by a single call to World::Update(). In fact the physics is a child of world and is always(?) invoked. So it appears that the separation is more a conceptual one rather than a functional one. The only reason I can think of is by putting all physics in UpdatePhysics then if (I'm not sure) that is invoked first you would know that all physics updates have been applied before you do any other world level checks/logic. So is that it or am I missing something important? I'm feeling rather dense today.
  5. I've been staring at this code for way too long and now I need different brains to look at it. This is the beginnings of a 3rd person character controller. I am now working at adding mouse look features but there seems to be a bug when the camera is at specific angles, notable y45 and y270. At those specific locations the camera glitches out. I will give it another try tomorrow, and no I don't want to create a pivot and anchor the camera to it and spin that --[[ Title: Third Person Controller Author: Einlander Start Date: 1-30-2016 Version: .01 Description: Script to control Player in 3rd person with keyboard and mouse Notes: This script is designed to mimic classical 3rd person game controls: *Look with mouse *Move with WASD *Follow Player as they move ]]-- Script.Cam =nil --entity "Camera" Script.moveSpeed = 2.5 --float "Move Speed" Script.speedMultiplier = 1.5 --float "Run Multiplier" Script.strafeSpeed = 4 --float "Strafe Speed" Script.jumpForce = 8 --float "Jump Force" function Script:Start() self.input={} self.unitangle = Vec3() self.anglemagnitude = nil end --[[ function Script:UpdateWorld() end --]] function Script:UpdatePhysics() local movex=0 local movez=0 self.input[0]=0 self.input[1]=0 local playerMovement = Vec3() -- I learned the boolean shortcuts from my years programming on a Casio Graphing Calculator self.input[1] = self.input[1] + ((window:KeyDown(Key.W) and 1 or 0) - (window:KeyDown(Key.S) and 1 or 0)) self.input[0] = self.input[0] - ((window:KeyDown(Key.A) and 1 or 0) - (window:KeyDown(Key.D) and 1 or 0)) playerMovement.z = self.input[1] * self.moveSpeed -- Strafing playerMovement.x = self.input[0] * self.moveSpeed if self.carryingEntity == nil and window:KeyDown(Key.Shift) then playerMovement.z = playerMovement.z * self.speedMultiplier -- Run while Strafed -- playerMovement.x = playerMovement.x * self.speedMultiplier end local jump = 0 if window:KeyHit(Key.Space) and self:IsAirborne() == 0 then jump = self.jumpForce playerMovement = playerMovement * 1.6 end self.entity:SetInput(0, playerMovement.z, playerMovement.x, jump , false, 1.0, 0.5, true) local startpos = Vec3( self.entity:GetPosition(true).x, self.entity:GetPosition(true).y + 5 , self.entity:GetPosition(true).z -5 ) -- y distance to get above players head, z - distance we want from player local endpos = Vec3() -- rotate the starting position (where the camera is at) around the player position if self.rot == nil then self.rot = 0 end self.rot = self.rot+.5 local finalpos = Vec3() finalpos = self:rotateX3D({startpos},self.entity:GetPosition(true) , 0)[1] finalpos = self:rotatePointY({finalpos},self.entity:GetPosition(true) , self.rot)[1] -- when self.rot ~ 45 or 270 it flips just for that 1 angle -- set camera at the final rotated positon self.Cam:SetPosition(finalpos) -- make camera look at player local lookAt = self:LookAt(self.entity:GetPosition(true)) lookAt.z = 0 -- THIS LINE IS IMPORTANT. DO NOT REMOVE IT, IF YOU DO IT WILL CAUSE A JUMP WHEN THE Z ANGLE CHANGES FROM NEGATIVE TO POSITIVE OR VICE VERSA self.Cam:SetRotation(lookAt,true) end function Script:IsAirborne() return self.entity:GetAirborne() and 1 or 0 end function Script:LookAt(lookAt) --http://www.leadwerks.com/werkspace/topic/10191-short-example-of-mathatan2/page__hl__lookat --http://stackoverflow.com/questions/1251828/calculate-rotations-to-look-at-a-3d-point --http://leadwerks.wikidot.com/wiki:face-entity --// Calculate angle from point A towards point B local tv = lookAt - self.Cam:GetPosition(true) local tRoty = Math:ATan2(tv.x, tv.z) local tRotx = 0 if lookAt.z >= self.Cam:GetPosition(true).z then tRotx = -Math:ATan2(tv.y* Math:Cos(tRoty), tv.z) else tRotx = Math:ATan2(tv.y* Math:Cos(tRoty), -tv.z) end tRotz = Math:ATan2( Math:Cos(tRotx), Math:Sin(tRotx) * Math:Sin(tRoty) ) return Vec3(tRotx,tRoty,tRotz-90) end function Script:Get3dDistance(pointa --[[as vec3--]], pointb--[[as vec3--]]) --[[as float--]] return math.sqrt((pointb.x - pointa.x)^2+ (pointb.y - pointa.y)^2+ (pointb.z - pointa.z)^2) end function Script:Get3dMagnitude(pointa --[[as vec3--]]) --[[as float--]] --http://www.fundza.com/vectors/normalize/ return math.abs(math.sqrt((pointa.x * pointa.x)+ (pointa.y * pointa.y)+ (pointa.z * pointa.z))) end function Script:NormalizeVector(pointa--[[as vec3--]], length--[[as float--]])--[[as vec3--]] --Yes I know leadwerks has these functions built in somewhere, but sometimes you just need to learn what it is you are exactly doing --http://www.fundza.com/vectors/normalize/ pointa.x = pointa.x / math.abs(length) pointa.y = pointa.y / math.abs(length) pointa.z = pointa.z / math.abs(length) return pointa end toRadians = function(degrees) return degrees / 180 * math.pi end function Script:rotatePointY(points, origin, degrees) local pointsout = {} for i = 1, #points do local point = Vec3(points.x,points.y,points.z) local x = origin.x + ( math.cos(toRadians(degrees)) * (point.x - origin.x) - math.sin(toRadians(degrees)) * (point.z - origin.z) ) local z = origin.z + ( math.sin(toRadians(degrees)) * (point.x - origin.x) + math.cos(toRadians(degrees)) * (point.z - origin.z) ) point.x = x point.z = z table.insert(pointsout, point) end return pointsout end function Script:rotatePointZ(points, origin, degrees) local pointsout = {} for i = 1, #points do local point = Vec3(points.x,points.y,points.z) local x = origin.x + ( math.cos(toRadians(degrees)) * (point.x - origin.x) - math.sin(toRadians(degrees)) * (point.y - origin.y) ) local y = origin.y + ( math.sin(toRadians(degrees)) * (point.x - origin.x) + math.cos(toRadians(degrees)) * (point.y - origin.y) ) point.x = x point.y = y table.insert(pointsout, point) end return pointsout end function Script:rotatePointX(points, origin, degrees) local pointsout = {} for i = 1, #points do local point = Vec3(points.x,points.y,points.z) local y = origin.y + ( math.cos(toRadians(degrees)) * (point.y - origin.y) - math.sin(toRadians(degrees)) * (point.z - origin.z) ) local z = origin.z + ( math.sin(toRadians(degrees)) * (point.y - origin.y) + math.cos(toRadians(degrees)) * (point.z - origin.z) ) point.y = y point.z = z table.insert(pointsout, point) end return pointsout end function Script:rotateX3D (points, origin, degrees) local pointsout = {} for i = 1, #points do local point = Vec3(points.x,points.y,points.z) local y = point.y; local z = point.z; point.y = origin.y + (y- origin.y) * math.cos(toRadians(degrees)) - (z - origin.z) * math.sin(toRadians(degrees)); point.z = origin.z + (z- origin.z) * math.cos(toRadians(degrees)) + (y - origin.y) * math.sin(toRadians(degrees)); table.insert(pointsout, point) end return pointsout end function Script:WrapAngle(angle) local currentrotation = angle if currentrotation.x < 0 then currentrotation.x = 359 - math.mod(currentrotation.x , 359) end if currentrotation.y < 0 then currentrotation.y = math.mod(currentrotation.y , 359) currentrotation.y = 359 - math.abs(currentrotation.y) end if currentrotation.z < 0 then currentrotation.z = 359 - math.mod(currentrotation.z , 359) end currentrotation.x = math.mod(currentrotation.x , 359) currentrotation.y = math.mod(currentrotation.y , 359) currentrotation.z = math.mod(currentrotation.z , 359) return currentrotation end --[[ function Script:Collision(entity, position, normal, speed) end --]] --[[ function Script:Draw() end --]] --[[ function Script:DrawEach(camera) end --]] --This function will be called after the world is rendered, before the screen is refreshed. --Use this to perform any 2D drawing you want the entity to display. function Script:PostRender(context) context:SetBlendMode(Blend.Alpha) local pos = self.Cam:GetRotation(true) local outText = "Actual angle" .. pos.x .. "|" ..pos.y .."|" ..pos.z --local outText = self:FaceEntity(self.Cam:GetPosition(true),self.entity:GetPosition(true)).x .."|" .. --self:FaceEntity(self.Cam:GetPosition(true),self.entity:GetPosition(true)).y .."|" .. --self:FaceEntity(self.Cam:GetPosition(true),self.entity:GetPosition(true)).z context:DrawText(outText,0,150) context:DrawText("Distance:" .. self:Get3dDistance(self.Cam:GetPosition(true) , self.entity:GetPosition(true)),0,165) pos = self.unitangle local outText = "unit angle" .. pos.x .. "|" ..pos.y .."|" ..pos.z context:DrawText(outText,0,180) pos = self.Cam:GetPosition(true) local outText = "Cam Position" .. pos.x .. "|" ..pos.y .."|" ..pos.z context:DrawText(outText,0,195) pos = self.entity:GetPosition(true) local outText = "Player Position" .. pos.x .. "|" ..pos.y .."|" ..pos.z context:DrawText(outText,0,210) end --[[ --This function will be called when the entity is deleted. function Script:Detach() end --]] --[[ --This function will be called when the last instance of this script is deleted. function Script:Cleanup() end --]]
  6. SetColor(1,1,1, 0.5) don't work(For each models in fame). I've tried everything. Help, please. What am i doing wrong?
  7. Have anyone code simples whis using sprites(Like a model, for bullets, for example)? It all, that i need
  8. Did anyone know, how to create effects like in ?Code sample, if possible
  9. If you now, fast objekts skip collision check and move through other objekts. Have engine any standart methods preventing it?
  10. When i create surface it look like it does not reflect light — very-very dark. What parameter setting it?
  11. What i need to setup qraphics to model like in editor? Open GL support all af this, but i don't know how turn on this methods
  12. Have anyone code exapmles with buffers using? In wiki it is VERY old
  13. Hi. How to check collision whith trigger and other objects and return this objects adress? In C++
  14. So, i want create models in real time via set vertices of this model, but model class have not similar functions
  15. So, i wanna project image that "see" camera at other place. How i can do that? I think, it have function simple fo this goal
  16. I thought you should know that the last update rendered the default fpsplayer code unable to look up or down. I have my own fps code I use, but thought I should tell you. Thank you.
  17. Hey so I have been messing around with the map changer that came with leadwerks (copied it and renamed it so I have the original still) to choose between random seed maps (initial starting areas the rest is generated) but when it tried to change maps it crashes or gives me a lua stack overflow issue. Is there something wrong with my code? Here it is. --[[ This script will act as a trigger to change the current map. Place this at the end of your map to make the player progress to the next level. ]]-- Script.mapname={} Script.mapname[0] = "" --string "Map Name" Script.mapname[1] = "" --string "Map Name" Script.mapname[2] = "" --string "Map Name" Script.mapname[3] = "" --string "Map Name" function Script:Start() self.enabled=true math.randomseed(Time:Millisecs()) math.random();math.random();math.random(); self.counter = 0 end function Script:Collision(entity, position, normal, speed) changemapname = math.random(0,3) end function Script:Enable()--in if self.enabled==false then self.enabled=true self:CallOutputs("Enable") end end function Script:Disable()--in if self.enabled then self.enabled=false self:CallOutputs("Disable") end end
  18. I believe this is a bug. When I put a pick-up code on an item (weapons collectables ect) and choose the mesh for it to represent, the (in case of the weapons) mesh chosen will show close to the pick-up mesh. Also if you have a weapon equipped then the mesh doesn't disappear when you pick up the pick-up. here is a pic of what appears with the pick-ups ( a few steps away)
  19. Hello everyone, I am creating a game where the player has to use physics to navigate the level, such as stacking objects to create stairs to get to a point, etc. In said game, the player can accidently drop objects off the level or get them destroyed by other forces. I would like to implement a feature where the player can hit a key and the level and all scripts, lighting, etc. is reloaded. This code must be in C++. How can I do this? Please help. Thanks.
  20. It's the holiday season again. As the forest air reaches freezing temperatures, I break out the ice shaver for my windshield. It's a time for celebrating family, sharing thanks for what we have, and behavior sets. That's right, fuzzy-logic for AI in-game. Since the world designers for the game won't have access to the direct behaviors, (nor the programming skills to code such things) I've managed to find some use for the custom Entity keys on objects in the Sandbox! Each entity will have actions assigned to a set of situations. Think of it like 'IF' statements that world builders have access too. This Enumeration of behaviors gives the designers flexibility to alter the NPCs actions easily within the sandbox. Global preset behavior collections, or custom sets per situation. For example, and NPC who follows the player may have something similar to this DefaultTarget = Player DefaultAction = FollowTarget Now if the NPC needs to defend the player... GuardTargetAction = KillAttacker Or... GuardTargetAction = HealTarget
×
×
  • Create New...