Jump to content

cassius

Members
  • Posts

    2,834
  • Joined

  • Last visited

Everything posted by cassius

  1. I just found that adding a little body force to the player fixes the problem I had when the player seemed to go thru the oildrums. Now it makes them look solid and works just like in the editor.
  2. Is it possible to set an objects stepmode either in the editor or in code?
  3. Whats the best way of copying and pasting these listings without destroying the formatting?
  4. Thanks for advice. Setting flip to 1 has helped. I had it on 0. Collisions now less violent.
  5. I am still having the same collisions problem even with macklebee's corrected code but since around 50 other people have downloaded it and noone else has reported a similar problem I can only assume I am getting something wrong elsewhere, possibly in the editor, but I can't see what. the game runs fine in the editor. I am using the version of phygen that came with 2.3 and all my models have new phy files.
  6. Let us know what happens as I am considering windows 7,
  7. i have had no such problem when using obj format.
  8. I use convex hull mainly cos its such a pain doing anything else. Takes me ages to do spheres and cylinders.
  9. I got rid of the cube (playermesh and changed entitytype player to 3. thanks again. It worked.
  10. I added the cube ( playermesh)because I was having the problem before. One of the oildrums came with the sdk I dont know the type of phy file it has but it flies around just the same. but thanks i will go back to your original code.
  11. I have got oildrums,barrels etc in my game all of which have a convex hull type body.When the player collides with them they go haywire and fly around. This did not happen at first but has occured as I put more stuff in my code.In the log "failed to load sound" is the only warning or error.Seems to work ok in the editor. SuperStrict Framework leadwerks.framewerk GCSetMode(2) RegisterAbstractPath AppDir Graphics(800, 600,32) Global fw:TFramewerk = TFramewerk.Create() If Not fw RuntimeError "Failed to initialize engine." 'Set global objects for lua scripted entities SetGlobals() 'Set collisions SetCollisions() 'Load scene Local scene:TEntity = LoadScene("abstract::game02.sbx") Local entity:TEntity AmbientLight([0.3, 0.3, 0.3]) 'debugphysics(1) 'create controller Local player:TController = CreateController(1.8,0.5) Local playermesh:TMesh =CreateCylinder(32) ScaleMesh(playerMesh,Vec3(0.8,1.2,0.8)) HideEntity playermesh EntityType player, 2 PositionEntity(player, StringToVec3(scene.getkey("cameraposition"))) SetBodyMass(player, 4.0) 'movement variables Local move:Float = 0.0 Local strafe:Float = 0.0 Local camrotation:TVec3 = Vec3(0) Local mx:Float = 0.0 Local my:Float = 0.0 Local jump:Float = 0.0 HideMouse() '================================================ Local door_1:TEntity Local key:TEntity Local gotkey:Int = False For Local e:TEntity = EachIn CurrentWorld().Entities Select GetEntityKey(e, "Name") Case "key" key = TEntity(e) Case "door_1" door_1 = TEntity(e) EndSelect Next '=================================================== Repeat If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit 'camera movement mx = Curve(MouseX() - GraphicsWidth() / 2, mx, 6) my = Curve(MouseY() - GraphicsHeight() / 2, my, 6) MoveMouse(GraphicsWidth() / 2, GraphicsHeight() / 2) camrotation.X = camrotation.X + my / 10.0 camrotation.Y = camrotation.Y - mx / 10.0 RotateEntity(fw.Main.camera, camrotation) 'controller movement move = KeyDown(KEY_W) - KeyDown(KEY_S) strafe = KeyDown(KEY_D) - KeyDown(KEY_A) jump:Float = 0.0 If KeyHit(KEY_SPACE) & Not ControllerAirborne(player) jump = 4.0 End If If KeyDown(KEY_LSHIFT) | KeyDown(KEY_RSHIFT) move = move * 3.0 strafe = strafe * 3.0 End If Local playerpos:TVec3 = EntityPosition(player) playerpos.Y = playerpos.Y + 0.90 PositionEntity(fw.Main.camera, playerpos) UpdateController(player, camrotation.Y, move * 6, strafe * 6, jump, 1500, 1) If EntityDistance(player,key) < 2 And KeyHit(KEY_G) HideEntity key gotkey = True EndIf If gotkey = True If EntityDistance(player,door_1) < 3 MoveEntity door_1,vec3(0.1,0,0) EndIf EndIf PositionEntity playermesh,entityposition(player) fw.Update() fw.Render() Flip(1) Forever fw.renderer.gbuffer = Null GCCollect() End Function SetGlobals() 'SetGlobalObject("listener", CreateListener(fw.Main.camera)) SetGlobalObject("world_main", fw.Main.world) SetGlobalObject("world_transparency", fw.transparency.world) SetGlobalObject("world_background", fw.background.world) SetGlobalObject("camera_main", fw.Main.camera) SetGlobalObject("camera_transparency", fw.transparency.camera) SetGlobalObject("camera_background", fw.background.camera) SetGlobalObject("renderer_world", fw.renderer) SetGlobalObject("fw", fw) SetGlobalObject("listener", CreateListener(fw.Main.camera)) End Function Function SetCollisions() Collisions(1, 1, 1) Collisions(1, 2, 1) Collisions(1, 3, 1) Collisions(2, 2, 1) Collisions(2, 3, 1) Collisions(3, 3, 1) End Function Function StringToVec3:TVec3(text:String, scale:Float = 1.0) Local t:TVec3 = Vec3(1) Local sarr:String[] sarr = text.split(",") If sarr If sarr.length > 0 t.x = Float(sarr[0]) * scale If sarr.length > 1 t.y = Float(sarr[1]) * scale If sarr.length > 2 t.z = Float(sarr[2]) * scale EndIf Return t EndFunction
  12. Is there a list of what framewerk does anywhere?
  13. Some example code uses gamelib wrapper,leo wrapper,c++ and now lua.A lot for a beginner to take in. .
  14. Thanks maclebee. I am using the listing you gave the community. I have added a cube (invisible) and parented to the controller. It works fine for collisions but need a bit more impetus going up stairs. I will check acceleration.
  15. without the cube collision with objects did not look right, the controller seemed to pass thru them and although it did knock them over you could not see the collision clearly.The wiki tutorial uses a cube.
  16. My player has difficulty climbing stairs. It gets half way up then stops. I have a cube in front of it. Whats the best way to give it more impetus?
  17. Loadscene does produce lights in my case but not sound. Models are all there too. but maybe I misunderstand your problem.
  18. am not getting oildrum sound in my app. Its ok in editor. Script folder is in my projects folder. I got this code in app SetGlobalObject("listener", CreateListener(fw.Main.camera)) Any ideas? Thanks.
  19. Yes I mean the name of the entity in the property dialog. At the moment when I run my game in bmax I just get a black screen. I assume I am not landing inside the level which is an interior level.If thats not the case then something else is wrong. EDIT:Ah! its working now.I just took camera position numbers from sbx file and started game tat that point.Thanks.
  20. I am trying to use a light as a playerstart point using its name as reference. Should it be reffered to as "name" or "classname"
  21. Change the cone angles from 0.0 to some higher figure.
  22. I too would like to repay the community for fantastic help over a long period but mostly my lack of expertise prevents it. I do however recommend le and the community at every oportunity. It might be nice to have a "How to" section on the forum like: How to open and close doors in a game How to make an elevator go up and down How to pick up objects....etc
×
×
  • Create New...