-
Posts
4,978 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by YouGroove
-
Navigation is not dependent on physics, it just calculate path based on the navmesh. Then you could make move any physic object on that path could it be Physics or Bullet. For particles, it's only keeping same parameter forces but applied to a physic object created with physix. The only requirement is having all physic functions of LE3 exposed on the API.
-
Thanks Josk, We'll see if this project will lead to something ? for the demo it will be a polished demo instead of some bad looking prototype.
-
Why not some raycast, if the ray collides with an other entity , just check the angle to see if it's inside the cone angle ? It's something i will do for some simple stupid robots AI.
-
[INCOMPLETE] Model names wrong in scene panel
YouGroove replied to YouGroove's topic in Leadwerks Engine Bug Reports
You import a models that are named in Assets foler : soldier, house, roof ... Why those names are not taken for the Scene panel , why LE3 take some bone or hierarchy name to display it on the scene panel ? In UE4 i just import some soldier.fbx , it keeps the same name soldier in the scene panel , what makes sense, i don't have to bother about bones or hierarchy name at all Anyway, i just posted it, no one says that will be corrected, and if LE3 users are ok with strange things or needing unecessary extra efforts, good for them -
[INCOMPLETE] Model names wrong in scene panel
YouGroove replied to YouGroove's topic in Leadwerks Engine Bug Reports
Yep Blender direct export to FBX. Same exact test on all 3 engines. But the problem is not the import as the model name is ok on the Asset panel. This is just a naming bug when the model is dropped on the 3D map. -
[INCOMPLETE] Model names wrong in scene panel
YouGroove replied to YouGroove's topic in Leadwerks Engine Bug Reports
This is not a problem of prebab as i tested with a simple model that is not prefab. (I updadet the first post with a custom example) UE4 Unity Why should we have to rename each imported FBX every time ? i never had to do that on other 3D editors (even older 3D engines). It's a naming bug. -
Just some bonus thing nothing priority : Take a screenshot during gameplay for publish.
-
I made it work with GotoPoint and it worked, then chaging code with Follow worked after that. if(dist < self.maxDist and dist > self.minDist and self.mode ~="chase") then self.mode="chase" self:updateState("chase") self.entity:Follow(self.target,self.speed,self.maxaccel) end I just find Follow command very unstable even playing with acceleration values, the character some times turns suddenly very fast, or it is some moment like some freezz, also sometimes it continues on trajectory too much and follow the player too late.But it's perhaps better optimized ?
-
Ok i should read the Command reference some times Returns true if a path can be plotted to the target entity, otherwise false is returned. But "follow" name command is misleading for me, a name like canReach() ro reachable() would make more sense.
-
I made a custom AI script for soldier and i called Follow() in start , even put it in physic loop. Soldier has character physics with mass , it is enabled, it has player as target in script and navmesh is build for the level self.entity:Follow(self.target.entity,self.speed,self.maxaccel) Any idea ?
-
Thanks gamecreator, seeing video it lead mean to this thread with code examples : http://www.leadwerks.com/werkspace/topic/5417-ragdolls/#entry47816 Hummm , that's heavy code --[[ Leadwerks Soldier Entity Script by Paul "Masterxilo" Frischknecht (c) 2010 Paul Frischknecht/Hurricane-Eye Entertainment visit http://www.hurricane-eye.webs.com/ =========Usage========= This soldier model is designed to be controlled completely through messages. It creates it's very own character controller and has all the animations set up. All that is left to do is controlling it. =========Messages========= -Message- -Parameters- -Function- "Jump" N/A Makes the character controller jump if it's on the ground. "SetHeading" "<y angle in °>" Sets the direction where the model should point/walk to when moving forward. "SetMovement" Any of: Sets the correct animation and makes the character move. "MOVE_FORWARD" If no movement is specified, the character will stop moving and play the idle animation. "MOVE_FORWARD_LEFT" "MOVE_FORWARD_RIGHT" "MOVE_BACK" "MOVE_BACK_LEFT" "MOVE_BACK_RIGHT" "MOVE_LEFT" "MOVE_RIGHT" "" For an example of using the model, see the soldier game script. Problems: Animation of current lod stage resets after game mode of non-game soldiers... (only sometimes?!) ]] -- Required scripts require("Scripts/class") require("Scripts/math/math") require("Scripts/hooks") require("Scripts/Constants/collision_const.lua") -- Create the class local class=CreateClass(...) math.randomseed(AppTime()) -- Constants class.NTSC_FPS = 29.97 class.BLENDCHANGE_SPEED = 0.05 class.TURN_STEPS = 5 class.MOVE_STEPS = 3 class.MOVE_SPEED_FW = 4.5 class.MOVE_SPEED_SIDE = 3.2 class.MOVE_SPEED_BACK = 3 class.JUMP_FORCE = 4.0 class.animsLoaded = 0 class.anims = {} class.run_sound = LoadSound('abstract::zombie.wav') class.jump_sound = LoadSound('abstract::z_jump.wav') zombie_mode = 0 --turn on or off zombie mode (chaising camera) SetPhysicsQuality(0) -- =======Animation handling======= -- Loads an animation for all LoD's of the model and remember it's sequence id. -- Per class (but requires one unique model instance) function class:loadAnimation(model, animFilename, animId) AppLog("Loading animation "..AbstractPath(animFilename).."...") local sequenceId --lodCount = CountChildren(model) lodCount = CountModelLODEntities(model)--NEW as of LE2.5 for childId = 0, lodCount-1 do --sequenceId = LoadAnimation(GetChild(model, childId), animFilename) sequenceId = LoadAnimation(GetModelLODEntity(model,childId), animFilename)--NEW as of LE2.5 end self[animId] = sequenceId end function class:clearAnimations(model) ClearAnimation(model) --lodCount = CountChildren(model) lodCount = CountModelLODEntities(model)--NEW as of LE2.5 for childId = 0, lodCount-1 do --ClearAnimation(GetChild(model, childId)) ClearAnimation(GetModelLODEntity(model, childId))--NEW as of LE2.5 end class.animsLoaded = 0 end -- Loads all animations (per class) function class:loadAnimations(model) class:clearAnimations(model) class:loadAnimation(model, "abstract::anim_soldier_idle.gmf", "animIdleId") class:loadAnimation(model, "abstract::anim_soldier_run.gmf", "animRunId") class:loadAnimation(model, "abstract::anim_soldier_StrafeL.gmf", "animStrafeLId") class:loadAnimation(model, "abstract::anim_soldier_StrafeR.gmf", "animStrafeRId") class:loadAnimation(model, "abstract::anim_soldier_back.gmf", "animBackId") -- Finished loading animations class.animsLoaded = 1 AppLog("Loaded soldier animations.") end -- =======Class itself======= function class:CreateObject(model) -- Initialize local object=self.super:CreateObject(model) object.bodies = {} --pysics bodies for ragdoll object.joints = {} object.lods = {} object.lodCount = 0 --count and remember lods --[[for childId = 1, CountChildren(model) do local child = GetChild(model, childId) if child:GetClass() == ENTITY_MESH then object.lodCount = object.lodCount + 1 object.lods[object.lodCount] = child end end]] object.lodCount = CountModelLODEntities(model) for childId = 0, object.lodCount-1 do local child = GetModelLODEntity(model, childId) object.lods[childId] = child end function object:CreateRagdoll() --AppLog("Start: "..os.time()) self.ragdoll = 1 --turning on ragdoll and turning off animation --clear animation helper functions --RemoveHook("Flip", object.Render) object.Update = nil object.Draw = nil if self.controller ~= nil then FreeEntity(self.controller) self.controller = nil end --AppLog("Cleaning hooks and controller: "..os.time()) --create a physics body for bone in model function CreateBodyForPart(partname, radius, length) local mesh = GetChild(self.model, 1) --taking a firts LOD for bones coordinates --local mesh = GetChild(GetModelLODEntity(self.model, 0), 1) --self.lods[0] --taking a firts LOD for bones coordinates local part = FindChild(mesh, partname) if part ~= nil then AppLog("Bone found: " .. partname) --[[ --local body = CreateBodyPivot(self.model) --dosent work with collision --local body = CreateBodySphere(0.05, self.model) --local body = CreateBodySphere(radius, self.model) local body = CreateBodySphere(0.04, self.model) --local body = CreateBodyCylinder(radius, radius * 3, self.model) --local body = CreateBodyBox(radius * 3, length * 5, radius * 3, self.model) --SetBodyMassCenter(body, Vec3(0, radius * 1.5, 0)) SweptCollision(body, 1) EntityType(body, COLLISION_PROP) --SetBodyGravityMode(body, 1) --SetBodyFriction(body, 0.1, 0.1) --SetBodySoftness(body, 1) --SetBodyElasticity(body, 1) --SetBodyDamping(body, 0.3, 0.3) SetBodyMass(body, radius * 500) --SetBodyMass(body, 5) PositionEntity(body, EntityPosition(part, 1), 1) RotateEntity(body, EntityRotation(part, 1), 1) self.bodies[partname] = body ]] --cylinder doesn't work because of can't shift it without shiftion it's origin --creating a bone-like body --local bone = CreateBodyBox(radius * 3, length, radius * 3, body) local bone = CreateBodyBox(radius * 2, length - 0.04, radius * 2, nil) --local bone = CreateBodyCylinder(radius, length, --self.model) --local bone = CreateBodyCylinder(radius, length - 0.04, nil) --body) local position = EntityPosition(part, 1) --local position = Vec3(origin.x, origin.y -length / 2 - 0.04, origin.z) PositionEntity(bone, position, 1) RotateEntity(bone, EntityRotation(part, 1), 1) TurnEntity(bone, Vec3(90, 90, 0)) MoveEntity(bone, Vec3(0, -length / 2 - 0.04, 0), 1) --TranslateEntity(bone, Vec3(0, -length / 2 - 0.04, 0), 0) --SetEntityMatrix(bone, GetEntityMatrix(part)) EntityType(bone, COLLISION_PROP) SweptCollision(bone, 1) --SetBodyGravityMode(bone, 1) --SetBodyMassCenter(bone, Vec3(0, radius * 1.5, 0)) --SetBodyFriction(bone, 0.5, 0.5) --SetBodyFriction(bone, 0.3, 0.3) SetBodyFriction(bone, 0.8, 0.3) --SetBodySoftness(bone, 1) --SetBodyElasticity(bone, 1) --SetBodyDamping(bone, 0.3, 0.3) --SetBodyMass(bone, radius * 50) SetBodyMass(bone, radius * 200) --SetBodyMass(bone, 5) --self.bodies[partname] = body self.bodies[partname] = bone --CreateJointFixed(body, bone, EntityPosition(body, 1)) --EntityParent(body, self.bodies[partname], 1) --EntityParent(bone, body, 1) --EntityParent(self.bodies[partname], nil, 1) else AppLog("Bone not found: " .. partname) end end function SetupBodyForPart(mesh, partname) local part = FindChild(mesh, partname) if part ~= nil then EntityParent(part, self.bodies[partname], 1) AppLog("Part found: " .. partname) else AppLog("Part not found: " .. partname) end end function CreateJoint(bodyname_parent, bodyname_child, pin, minangle, maxangle) --local joint = CreateJointBall(self.bodies[bodyname_parent], self.bodies[bodyname_child], EntityPosition(self.bodies[bodyname_parent], 1)) --local joint = CreateJointBall(self.bodies[bodyname_child], self.bodies[bodyname_parent], EntityPosition(self.bodies[bodyname_parent], 1)) --local joint = CreateJointBall(self.bodies[bodyname_parent], self.bodies[bodyname_child], EntityPosition(self.bodies[bodyname_child], 1)) --local joint = CreateJointBall(self.bodies[bodyname_child], self.bodies[bodyname_parent], EntityPosition(self.bodies[bodyname_child], 1)) local axe = TFormVector(pin, self.model, nil) --local position = EntityPosition(self.bodies[bodyname_child], 1) local position --local mesh = GetModelLODEntity(self.model, 0) --self.lods[0] --taking a firts LOD for bones coordinates local mesh = GetChild(self.model, 1) --TellAboutChildren(mesh, 0) local part = FindChild(mesh, bodyname_child) if part ~= nil then position = EntityPosition(part, 1) AppLog("Part "..bodyname_child.." found.") else AppLog("Part "..bodyname_child.." not found!") end local joint = CreateJointHinge(self.bodies[bodyname_parent], self.bodies[bodyname_child], position, axe) SetHingeJointLimits(joint, minangle, maxangle) --SetJointCollisionMode(joint, 0) --dosen't work in lua --SetBallJointLimits(joint, Vec3(1,1,1), 0, 0) --dosen't work in lua --joint:SetLimits(Vec3(1, 1, 1), 0, 0) --dosen't work self.joints[bodyname_child] = joint --EntityParent(joint, self.bodies[bodyname_parent]) end --reset all lods position --[[for childId = 0, self.lodCount-1 do local child = self.lods[childId] PositionEntity(child, EntityPosition(self.model, 1), 1) RotateEntity(child, EntityRotation(self.model, 1), 1) UpdateMesh(child) end]] --AppLog("Updating lods: "..os.time()) AppLog("Creating bodies for parts...") CreateBodyForPart("Bip01 Pelvis", 0.05, 0.08) CreateBodyForPart("Bip01 Spine", 0.03, 0.13) CreateBodyForPart("Bip01 Spine1", 0.03, 0.13) CreateBodyForPart("Bip01 Spine2", 0.02, 0.13) CreateBodyForPart("Bip01 Neck", 0.03, 0.06) CreateBodyForPart("Bip01 Head", 0.08, 0.1) CreateBodyForPart("Bip01 L Clavicle", 0.02, 0.15) CreateBodyForPart("Bip01 R Clavicle", 0.02, 0.15) CreateBodyForPart("Bip01 L UpperArm", 0.03, 0.28) CreateBodyForPart("Bip01 R UpperArm", 0.03, 0.28) CreateBodyForPart("Bip01 L Forearm", 0.03, 0.21) CreateBodyForPart("Bip01 R Forearm", 0.03, 0.21) CreateBodyForPart("Bip01 L Hand", 0.03, 0.09) CreateBodyForPart("Bip01 R Hand", 0.03, 0.09) CreateBodyForPart("Bip01 L Thigh", 0.06, 0.38) CreateBodyForPart("Bip01 R Thigh", 0.06, 0.38) CreateBodyForPart("Bip01 L Calf", 0.04, 0.36) CreateBodyForPart("Bip01 R Calf", 0.04, 0.36) CreateBodyForPart("Bip01 L Foot", 0.04, 0.08) CreateBodyForPart("Bip01 R Foot", 0.04, 0.08) AppLog("Intializing joints...") local rollX = Vec3(1, 0, 0) local rollY = Vec3(0, 1, 0) local rollZ = Vec3(0, 0, 1) CreateJoint("Bip01 Pelvis", "Bip01 Spine", rollY, -45, 45) CreateJoint("Bip01 Spine", "Bip01 Spine1", rollX, -10, 30) CreateJoint("Bip01 Spine1", "Bip01 Spine2", rollX, -10, 30) CreateJoint("Bip01 Spine2", "Bip01 Neck", rollX, -10, -10) CreateJoint("Bip01 Head", "Bip01 Neck", rollY, -75, 75) CreateJoint("Bip01 Neck", "Bip01 L Clavicle", rollY, -30, 0) CreateJoint("Bip01 Neck", "Bip01 R Clavicle", rollY, 0, 30) CreateJoint("Bip01 L Clavicle", "Bip01 L UpperArm", rollZ, -140, 0) CreateJoint("Bip01 R Clavicle", "Bip01 R UpperArm", rollZ, 0, 140) CreateJoint("Bip01 L UpperArm", "Bip01 L Forearm", rollX, -120, 0) CreateJoint("Bip01 R UpperArm", "Bip01 R Forearm", rollX, -120, 0) CreateJoint("Bip01 L Forearm", "Bip01 L Hand", rollZ, -5, 30) CreateJoint("Bip01 R Forearm", "Bip01 R Hand", rollZ, -30, 5) CreateJoint("Bip01 L Thigh", "Bip01 Pelvis", rollX, -5, 90) CreateJoint("Bip01 R Thigh", "Bip01 Pelvis", rollX, -5, 90) CreateJoint("Bip01 L Thigh", "Bip01 L Calf", rollX, 10, 140) CreateJoint("Bip01 R Thigh", "Bip01 R Calf", rollX, 10, 140) CreateJoint("Bip01 L Calf", "Bip01 L Foot", rollX, -10, 60) CreateJoint("Bip01 R Calf", "Bip01 R Foot", rollX, -10, 60) --AppLog("Creating joints: "..os.time()) --for childId = 0, CountModelLODEntities(self.model)-1 do --local child = GetChild(GetModelLODEntity(self.model, childId), 1) local child = GetChild(self.model, 1) AppLog("Setting up bodies...") SetupBodyForPart(child, "Bip01 L Foot") SetupBodyForPart(child, "Bip01 R Foot") SetupBodyForPart(child, "Bip01 L Calf") SetupBodyForPart(child, "Bip01 R Calf") SetupBodyForPart(child, "Bip01 L Thigh") SetupBodyForPart(child, "Bip01 R Thigh") SetupBodyForPart(child, "Bip01 L Hand") SetupBodyForPart(child, "Bip01 R Hand") SetupBodyForPart(child, "Bip01 L Forearm") SetupBodyForPart(child, "Bip01 R Forearm") SetupBodyForPart(child, "Bip01 L UpperArm") SetupBodyForPart(child, "Bip01 R UpperArm") SetupBodyForPart(child, "Bip01 L Clavicle") SetupBodyForPart(child, "Bip01 R Clavicle") SetupBodyForPart(child, "Bip01 Head") SetupBodyForPart(child, "Bip01 Neck") SetupBodyForPart(child, "Bip01 Spine2") SetupBodyForPart(child, "Bip01 Spine1") SetupBodyForPart(child, "Bip01 Spine") SetupBodyForPart(child, "Bip01 Pelvis") --end end --object:CreateRagdoll() function object:ClearJoints() local id for id in pairs(self.joints) do FreeJoint(self.joints[id]) end for id in pairs(self.bodies) do FreeEntity(self.bodies[id]) end end function object:updateAnimation() local blend = AppSpeed() * class.BLENDCHANGE_SPEED blend = math.min(blend, 1.0) --AppLog("CountChildren = "..CountChildren(self.model)) --AppLog("CountLODs = "..CountModelLODEntities(self.model)) Animate(self.model, ((AppTime()+self.timeOffset)/1000.0) * class.NTSC_FPS, blend, self.currentAnim-1, 1) --[[for childId = 0, CountModelLODEntities(self.model)-1 do local child = GetModelLODEntity(model, childId) Animate(child, --self.model, ((AppTime()+self.timeOffset)/1000.0) * class.NTSC_FPS, blend, self.currentAnim-1, 1) end]] end -- Initialize function function object:Init() -- Load this model class' anims (has to be done only once) if class.animsLoaded==0 then class:loadAnimations(model) end -- Setup the model SetModelLODDistance(model, 5, 0) SetModelLODDistance(model, 12, 1) SetModelLODDistance(model, 19, 2) -- Collision type EntityType(model, COLLISION_NONE) --local lodCount = CountChildren(model) AppLog("Setting physics...") local lodCount = CountModelLODEntities(model)--NEW as of LE2.5 AppLog("LOD count = "..lodCount) for childId = 0, lodCount-1 do --EntityType(GetChild(model, childId), COLLISION_AILINEOFSIGHT) AppLog("Setting LOD "..childId) EntityType(GetModelLODEntity(model, childId), COLLISION_AILINEOFSIGHT)--NEW as of LE2.5 end AppLog("Setting physics done.") self.target = fw.main.camera --for zombie mode self.life = 100 --for countdown hits until death -- Set default settings self.moveDirAdd = 0 self.curMoveDirAdd = 0 self.moveDir = 0 self.moveSpeed = 0 self.jump = 0 self.matrixUpdateIsInternal = 0 -- Animations self.currentAnim = 0 self.timeOffset = math.random(10000) -- Create the controller self.controller = CreateController(1.75, 0.35, 0.45, 45, 1) PositionEntity(self.controller, EntityPosition(model, 1), 1) SetBodyMass(self.controller, 10) EntityType(self.controller, COLLISION_CHARACTER) SweptCollision(self.controller, 1 ) -- Set current state SendEntityMessage(model, "SetMovement=") SendEntityMessage(model, "SetHeading=0") SendEntityMessage(model, "RandomizeAnimTimeOffset", nil,1) self.ragdoll = 0 end -- Define callbacks function object:SetKey(key,value) if key=="color" then else return self.super:SetKey(key,value) end return 1 end --[[function object:GetKey(key,value) if key=="bloody" then return "true" end end]] function object:SetMovement(moveDirAdd, moveDir, moveSpeed, currentAnim) self.moveDirAdd = moveDirAdd self.moveDir = moveDir self.moveSpeed = moveSpeed self.currentAnim = self.class[currentAnim] end -- Recieve control commands through messages function object:ReceiveMessage(message,extra) local values=string.Explode(message,"=") local command = values[1] local value = "" if values[2] ~= nil then value = values[2] end if command=="SetHeading" then self.heading = tonumber(value) elseif command=="Jump" then if self.ragdoll == 0 then --don't jump after death if ControllerAirborne(self.controller) == 0 then --don't jump in air self.jump = 1 self.model:EmitSound(self.class.jump_sound, 30, 1.0, 0) end end elseif command=="hit" then if self.ragdoll == 0 then --still alive AppLog("I'm hited!") self.life = self.life - 1000 if self.life <= 0 then SendEntityMessage(self.model, "die") else local volume = 1.0 - self.life * 0.005 self.model:EmitSound(self.class.jump_sound, 30, volume, 0) end end elseif command=="die" or command=="use" then AppLog("I'm dying!") self.currentAnim = self.class.animIdleId self:updateAnimation() self:CreateRagdoll() AppLog("I'm dead!") elseif command=="SetMovement" then if value=="MOVE_FORWARD" then self:SetMovement(0, 0, class.MOVE_SPEED_FW, "animRunId") elseif value=="MOVE_FORWARD_LEFT" then self:SetMovement(45, 0, class.MOVE_SPEED_FW, "animRunId") elseif value=="MOVE_FORWARD_RIGHT" then self:SetMovement(-45, 0, class.MOVE_SPEED_FW, "animRunId") elseif value=="MOVE_BACK" then self:SetMovement(0, 180, class.MOVE_SPEED_BACK, "animBackId") elseif value=="MOVE_BACK_LEFT" then self:SetMovement(-45, 180, class.MOVE_SPEED_BACK, "animBackId") elseif value=="MOVE_BACK_RIGHT" then self:SetMovement(45, 180, class.MOVE_SPEED_BACK, "animBackId") elseif value=="MOVE_LEFT" then self:SetMovement(0, 90, class.MOVE_SPEED_SIDE, "animStrafeLId") elseif value=="MOVE_RIGHT" then self:SetMovement(0, -90, class.MOVE_SPEED_SIDE, "animStrafeRId") else self:SetMovement(0, 0, 0, "animIdleId") end else return self.super:ReceiveMessage(message,extra) end return 0 end -- Update the model. That is, update the roation and move/jump if necessary. function object:Update() if zombie_mode == 1 then local selfposition = EntityPosition(model) local cameraposition = EntityPosition(self.target) local distance = EntityDistance(model, self.target) if distance > 15 then if self.moveSpeed ~= 0 then SendEntityMessage(model, "SetMovement=") end self.heading = self.heading + 1 else self.heading = math.atan2(cameraposition.z - selfposition.z, cameraposition.x - selfposition.x) * 180 / math.pi - 90 if distance > 3 then if self.moveSpeed == 0 then self.model:EmitSound(self.class.run_sound,30,1.0,0) end SendEntityMessage(model, "SetMovement=MOVE_FORWARD") else if self.moveSpeed ~= 0 then SendEntityMessage(model, "SetMovement=") end self.heading = self.heading + 1 --AppLog("rotating...") end if distance < 5 and self.moveSpeed ~= 0 then SendEntityMessage(model, "Jump") end end end self.matrixUpdateIsInternal = 1 -- Update directions self.curMoveDirAdd = CurveAngle(self.moveDirAdd, self.curMoveDirAdd, class.TURN_STEPS*(1.0/AppSpeed())) --if self.moveSpeed > 0.0 then self.curHeading = CurveAngle(self.heading, self.curHeading, class.TURN_STEPS*(1.0/AppSpeed())) --end RotateEntity(model, Vec3(0, self.curHeading+self.curMoveDirAdd+180, 0)) self.controller:Update(self.curHeading + self.moveDir + self.curMoveDirAdd, self.moveSpeed, 0, self.jump*class.JUMP_FORCE, 500, 1, 0) self.jump = 0 local curpos = EntityPosition(model) targetPos = EntityPosition(self.controller) curpos.x = Curve(targetPos.x, curpos.x, class.MOVE_STEPS*(1.0/AppSpeed())) curpos.y = Curve(targetPos.y, curpos.y, class.MOVE_STEPS*(1.0/AppSpeed())) curpos.z = Curve(targetPos.z, curpos.z, class.MOVE_STEPS*(1.0/AppSpeed())) PositionEntity(model, curpos) self.matrixUpdateIsInternal = 0 end -- Render update. Plays the animations. function object:Draw() object.matrixUpdateIsInternal = 1 -- Update animations object:updateAnimation() object.matrixUpdateIsInternal = 0 end -- External movement and rotation requires special threatment since the model is controlled by a cc. function object:UpdateMatrix() if self.matrixUpdateIsInternal == 0 then -- Force heading self.heading = EntityRotation(self.model).y-180 self.curHeading = self.heading self.moveDirAdd = 0 -- Force position if self.controller ~= nil then PositionEntity(self.controller, EntityPosition(self.model)) end end end function object:Reset() self.matrixUpdateIsInternal = 0 object:UpdateMatrix() end -- Free callback. Frees the model and the cc. function object:Free(model) --RemoveHook("Flip", object.Render) --free all bodies self:ClearJoints() if self.controller ~= nil then FreeEntity(self.controller) end self.super:Free() end -- Call initialize func object:Init() --AddHook("Flip", object.Render) SendEntityMessage(object.model, "die", nil, 5000) --let's kill him end
-
It's radeon on the 6700 HD series ( i run many today games even Unreal 4 and all shaders and effects). So it works on your models , you mean it displays ok in LE3 editor 3D viewport applying it on models , not BSP. I'll upload some model if you have some time to test ( but they are pretty standard FBX).
-
In some engines ragdoll is simply based on bones, sometimes you need to do nothing or just adjust collision volumes. Anyway having out of the box someday in LE3 would be good for all people making games with LE3, not only me
-
It will perhaps come i 2015 with some other post effects (see LE3 2015 plans). I would like it to see some day also
-
I needed to make one for prorotyping droids AI that will fire at you, so i took some character and some other weapon from LT3D for testing purpose (because all is mainly ripped from games) Blender is so cool and fast for characters : - Auto Rig - Attach weapon to bone - Copy and symmetry a pose of animation - IK to quickly make smooth animations. It really worth learning it.
-
I don't know if someone made it successfull and easy to implement ? But i would like to see ragdoll coming some day as opponents lying on the air is not looking so good.
-
Thanks a lot Rick, (I always forgot Wiki as it's not on LE3 main site )
-
How to make face a character to the player in Lua ? Because when the character have reached the player at some distance and stops following, it's Lua control of it's actions and i would need it to always turn to the player.
-
Have amazing screenshots Submit once you have more stuff done I agree (some trees, rocks,would have helped your game look, it looks very empty). Also use some road barriers , and other blocking objects to avoid the player to go anywhere with the car and make it some 4*4 offroad game. This would force the player to have a driving section than he would have to let the car to make a walking combat section. Juts my personnal taste. Your game is coming nicely, keep going on
-
Did you have some time to test ? Anyway i think i will stick with my original shader and just paint myself in 2D progam the parts i need to be reflective and the amount, this will be more easy i think to make it adapated for the shader.
-
This version uses PhysicSetposition and you update the position physics each loop in the program. I made another version using SetVelociy, so your bullet velocity is constant and just initiated at start. Both methods have their advantages, like moving the bullet manually with physiSetposition to make any trajectory you want , or SetVelocity when you need a direct streightforward trajectory. http://www.leadwerks.com/werkspace/files/file/512-turret-v2-setvelocity-physics/
-
Flying Droid ion Silo 2 Export to Blender for adding detail meshes, cables.