Jump to content

diedir

Developers
  • Posts

    258
  • Joined

  • Last visited

Everything posted by diedir

  1. yes the car model have wheels, in place exported from max with Arbuzz plugin with the chassis as the parent of model and a lowpoly was made making a rough phy file with phygen no bones required look at pic
  2. i put this in my "car.lua" : and it is working require("Scripts/class") require("Scripts/loop") require("Scripts/math/math") local class=CreateClass(...) function class:CreateObject(model) local object=self.super:CreateObject(model) function object:UpdateMatrix() self:UpdateTires() end function object:UpdateTires() local speed for n=0,3 do if self.tire[n]~=nil then self.tire[n]:SetMatrix( self.vehicle:GetTireMatrix(n) ) if self.emitter[n]~=nil then self.emitter[n]:SetMatrix(self.vehicle:GetTireMatrix(n)) self.emitter[n]:Pause() if self.vehicle:TireIsAirborne(n)==0 then speed = math.abs(self.model:GetVelocity(0).z) speed = (speed - 4) / 20.0 --20 speed = Clamp( speed, 0, 1 ) * 0.5 if speed>0.2 then -->0 self.emitter[n]:Resume() self.emitter[n]:SetColorf(1,1,1,speed) end end end end end end --local couronne local pivot local suspensionlength=0.2 --0.1 --0.2big local springconstant=280 --280 --70big local springdamper=500 --600 --220big object.vehicle=CreateVehicle(object.model) object.tire={} object.emitter={} pivot=object.model:FindChild("roue_avg") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[0]=LoadMesh("abstract::roue_avg.gmf",object.model) pivot:Hide() end pivot=object.model:FindChild("roue_avd") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[1]=LoadMesh("abstract::roue_avd.gmf",object.model) pivot:Hide() end pivot=object.model:FindChild("roue_arg") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[2]=LoadMesh("abstract::roue_arg.gmf",object.model) pivot:Hide() end pivot=object.model:FindChild("roue_ard") if pivot~=nil then tireradius=pivot.aabb.h/2.0 object.vehicle:AddTire(TFormPoint(pivot.position,pivot.parent,model),tireradius,suspensionlength,springconstant,springdamper) object.tire[3]=LoadMesh("abstract::roue_ard.gmf",object.model) pivot:Hide() end --object.emitter={} --object:UpdateTires() --[[setWorld(fw.transparency.world) for n=0,3 do if object.tire[n]~=nil then --createemitter(50,2000,Vec3... object.emitter[n]=CreateEmitter(1,100,Vec3(0,1,0),0,object.tire[n]) object.emitter[n]:SetPosition(Vec3(0,-object.tire[n].aabb.h/2.0,0)) object.emitter[n]:SetParent(model,1) object.emitter[n]:SetRadius(0,2) --1.6 object.emitter[n]:SetWaver(0.1) --1.0 object.emitter[n]:Paint(LoadMaterial('abstract::dust.mat')) object.emitter[n]:SetRotationSpeed(0.1) object.emitter[n]:Pause() end end SetWorld(fw.main.world) ]]-- -- object.model.buoyant=0 object.model:SetMass(2.6) --big2.20 object.model:SetFriction(0.9,0.9) --0.6,0.3 object.model:SetKey("Gravity",1) object.model:SetKey("collisiontype",COLLISION_PROP) ---object:UpdateTires() end in my folder i have the model gmf (with chassis as the parent of all pieces) and wheels (4 in my case) and in mycarDriver.lua : require("Scripts/constants/keycodes") require("Scripts/linkedlist") require("Scripts/filesystem") require("Scripts/math/math") require("Scripts/constants/engine_const") FlushKeys() HideMouse() local camera = fw.main.camera chassis=LoadModel("abstract::car_9.gmf") carobject=objecttable[chassis] car=carobject.vehicle if car==nil then Notify("Vehicle object not found.",1) chassis:Free() return end chassis:SetPosition(TFormPoint(Vec3(0,1,4),fw.main.camera,nil)) chassis:SetRotationf(0,camera.rotation.y+180.0,0) --Variables local dx=0.0 local dy=0.0 local camerapitch=camera.rotation.x local camerayaw=camera.rotation.y local move=0.0 local strafe=0.0 local steering = 0.0 local torque = 0.0 --0 local steerlimit = 30.0 local steerrate = 2.0 local steerangle=0.0 MoveMouse(Round(GraphicsWidth()/2),Round(GraphicsHeight()/2)) while KeyHit(KEY_ESCAPE)==0 do --Camera look --[[ gx=Round(GraphicsWidth()/2) gy=Round(GraphicsHeight()/2) dx=Curve((MouseX()-gx)/4.0,dx,3.0/AppSpeed()) dy=Curve((MouseY()-gy)/4.0,dy,3.0/AppSpeed()) MoveMouse(gx,gy) camerapitch=camerapitch+dy camerayaw=camerayaw-dx camerapitch=math.min(camerapitch,90) camerapitch=math.max(camerapitch,-90) fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1) ]]-- local tirespeed=-(KeyDown(KEY_UP)-KeyDown(KEY_DOWN))*6.0 --2 vitesse origine car:AddTireTorque(tirespeed,0) car:AddTireTorque(tirespeed,1) car:AddTireTorque(tirespeed,2) car:AddTireTorque(tirespeed,3) steermode=0 if KeyDown(KEY_RIGHT)==1 then steermode=steermode-1 end if KeyDown(KEY_LEFT)==1 then steermode=steermode+1 end if steermode==1 then steerangle=steerangle+4.0*AppSpeed() elseif steermode==-1 then steerangle=steerangle-4.0*AppSpeed() else if steerangle>0 then steerangle=steerangle-4.0*AppSpeed() if steerangle<0.0 then steerangle=0.0 end else steerangle=steerangle+4.0*AppSpeed() if steerangle>0.0 then steerangle=0.0 end end end steerangle=Clamp(steerangle,-25,25) car:SetSteerAngle(steerangle,0) car:SetSteerAngle(steerangle,1) ---didier retourne vehicule if KeyDown(KEY_SPACE)==1 then ---chassis:SetRotationf(0,180.0,0) marche a peu pres chassis:SetRotation(Vec3(0,180,0)) -- marche mieux end-- ---fin didier fw:Update() local campos=TFormPoint(Vec3(0,1,0),chassis,nil) fw.main.camera:SetPosition(campos) fw.main.camera:Move(Vec3(0,0,-8)) ---position camera derriere vh local t=TFormVector(Vec3(0,0,1),camera,chassis) a=-math.deg(math.atan2(t.x,t.z))+180.0 fw.main.camera:SetRotation(Vec3(15,CurveAngle(180+chassis.rotation.y,fw.main.camera.rotation.y,10),0)) --carobject.turret:SetRotationf(0,CurveAngle(a,carobject.turret.rotation.y,10.0/AppSpeed()),0) chassis:Hide() local pick = LinePick(campos,camera.position,0.5,COLLISION_PROP) chassis:Show() if pick~=nil then camera:SetPosition(pick.position) end fw:Render() Flip(0) end chassis:Free() chassis=nil camera=nil ShowMouse()
  3. diedir

    Steering

    Hi ithink you miss some lines i did : steerangle=Clamp(steerangle,-25,25) --25 here max angle car:SetSteerAngle(steerangle,0) car:SetSteerAngle(steerangle,1) hopeit was what you look for
  4. very cool ! I need that electric sphere ! would it be for LE2 or LE3 only ?
  5. did you loose your girl night-game because you're lying on a carpet, right now : GAME OVER !
  6. promised in few monthes this doll can be "posed" and make your anim... for 700 / 800 $ (apparently) here the link : could be very fun or gadget like... what do you think ?
  7. Hi a blog who refers to "60" free (for lot) great 3D models here the link http://www.hongkiat....model-websites/ enjoy
  8. Hi i am not a character modeler, proportions are not choking me , except double-knees and forearm volume masking elbow. in general too lean for my personal taste human body is the most hard to make, good work
  9. Well i am not a developer only a scripting guy from my work experience and i never feel confortable with C++ even if i tried sometimes to get in it, lua was new to me but its simplicity once avoided the "notalking" errors, was pretty convenient for my (bloated) style of scripting My UI is done, my core game too without a C++ line (except linked Dll from Rick to joystick) saving and loading data is easy too, six months of coding in lua was very pleasant. Not pretending it is well write or organize but functional and that is what i wanted. Lua responded great to my desire and surprisingly fast enough to forget it was script only. Concentrate now on modeling to populate what i call my game. Just my thought, hope to see your Sub or your tank moving soon Mike
  10. Josh thinking : " this guy is so smart that he can write his code without leaving hands from his pants... sure i will keep him !"
  11. have you check if the "cullface = 0" in your wall.mat ?
  12. Wow Brent what a work story line behind you ! I was reading you and thinking with all that background this guy is 60's old, but what no is 25 (near 26) ! All my respects guy for your work experience, you seem so convinced and full of certainty, hope the road still remain so straight for you. Having not a so far background --15 years (despite my age) i am coming from what you call first "google" group, but since i think with experiences and time, i crossed some of group membranes. I made VBA procedures for my work, started in computer with a quizz game for fun and learning 15 years ago. not debugging much as : is it working ? ok it's good=> run The only great reward of my work now is knowing that what i did 12 years ago is still working and useful at this time. Now i am focusing on VBS for my company but still happy to see where i am and from where i came. My point is, don't try to put anyone in a cell of a chart of a group, people can grow up by themselves, as not anybody got the chance to make long studies, got great diplomas (some just need money to get) sure they will take a lot more time than you to achieve something. But i can't imagine a person doomed in a position that he don't overtake a day, or he is not interested in that domain. So whatever work you done and proud of it, don't forget that only the time will tell you, you was not so wrong (don't ever think you are right) sorry if i misunderstood your words (not native english), i never had a 25 years old teacher
  13. Nice from France with FF, love your site very well done, pictures loading great and fast, love that shrink effect, very colorful game, great job.
  14. i guess cooking some fried eggs on Ipad3, new camper utility.
  15. sorry for your loss Rick, i understand what pain it is when you worked hard in editor and have to do it again. i try to keep always a copy of my "sbx" as soon as i can if i made a lot of changes... strange thing though
  16. Hi i even don't try but it look very interesting and useful thanks for (future) sharing
  17. Hi morad this demo is not an exhaustive joystick demo, it is based on dxinput code which expose some functions that (imo) are sufficient for driving a joystick through lua code, now if you want more functions (don't know what means input size) you are free to put your own.
  18. Hello and welcome glad to see particle becoming elementary hope you will show up some amazing effects !
  19. i don't think so, the abstract path read all the "leadwerks" folders/sub/folders
  20. are you sure your file is not "GUIManager.lua.TXT" ? or try to move it elsewhere more simple to be sure
  21. diedir

    Even Faster

    +1 so right, the more i use lua the more i like it, even my poorly written code is fast... so good
  22. it's look great, but the first time coming is abit long (pictures loading) loading times after that are very quick. Great introduction, want to know what happens next
  23. very cool MG any chance to see a bit of your code ? as i am working on this kind of game i am very interested thanks
  24. diedir

    Design Confusion

    ok thanks for clarifying this
  25. diedir

    Design Confusion

    Since i am not a native english, i hope that i misunderstood the part of not being able to launch a script as a whole game, currently all my game is based on lua scripts which call each other and a launch (F5) button is all what i need. I don't know 3DStudio but i hope we can do the same as now. Sorry for my fear but i hope someone will chill me out
×
×
  • Create New...