Jump to content

macklebee

Members
  • Posts

    3,946
  • Joined

  • Last visited

Everything posted by macklebee

  1. You need to reset the values of the camera variables (camerapitch, camerayaw,and camera) and create a new controller. You are only calling them in the beginning and then you are freeing the frame work then never initializing the values again. Easiest is to just make a function out of the controller creation with these variables included and then call them where you are setting the initial controller and then inside the main loop's if-statement when you are loading a new scene. require("Scripts/constants/collision_const") require("Scripts/constants/engine_const") require("Scripts/LinkedList") require("Scripts/filesystem") require("Scripts/math/math") function round(num, idp) return tonumber(string.format("%." .. (idp or 0) .. "f", num)) end function playercreation() --Function to create a player controller and set camera variables controller=CreateController(1.8,0.45,0.25,45) controller:SetCollisionType(COLLISION_CHARACTER,0) controller:SetMass(10) if standalone==1 then controller:SetPosition(Vec3(-20,1,-5)) else controller:SetPosition(fw.main.camera.position) end camerapitch=fw.main.camera.rotation.x camerayaw=fw.main.camera.rotation.y-110 camera = fw.main.camera end BLEND_NONE=0 BLEND_ALPHA=1 if fw==nil then --we are not in Editor RegisterAbstractPath("") Graphics(1680,1050) fw=CreateFramework() scene=LoadScene("Maps/terrain_base.sbx") scene:SetCollisionType(COLLISION_SCENE) TFilter(1) AFilter(4) standalone=1 end dx=0.0 dy=0.0 camerapitch=0.0 camerayaw=0.0 move=0.0 strafe=0.0 playercreation()--Call the controller function HideMouse() MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2) --position function DrawHUD(contr) SetBlend(BLEND_ALPHA) DrawText("position: "..round(contr.position.x,1)..","..round(contr.position.y,1)..","..round(contr.position.z,1),1,FontHeight()*1) --DrawText("rot: "..round(contr.rotation.x,3)..","..round(contr.rotation.y,3)..","..round(contr.rotation.z,3),1,FontHeight()*6) SetBlend(BLEND_NONE) end --main function while KeyHit(KEY_ESCAPE)==0 do jump=KeyHit(KEY_SPACE)*6.0 if controller:IsAirborne()==1 then jump=0 end local time = AppTime()/3200.0 local frame = time*(179.0-96.0)+96.0 frame=Clamp( frame, 96, 179 ) --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,-89.99) fw.main.camera:SetRotationf(camerapitch,camerayaw,0,1) movespeed=4 movesmoothing=10 if controller:IsAirborne()==1 then movesmoothing=200 end --Player movement move=Curve( (KeyDown(KEY_W)-KeyDown(KEY_S))*movespeed,move,movesmoothing) strafe=Curve( (KeyDown(KEY_D)-KeyDown(KEY_A))*movespeed,strafe,movesmoothing) --Update controller controller:Update(camerayaw,move,strafe,jump,40,10) fw:Update() --Position camera camera:SetPositionf(controller.position.x,controller.position.y+0.8,controller.position.z,1) time=AppTime() fw:Render() DrawHUD(controller) --new Framework--------------------------------------------------------------------------------------------------- if KeyHit(KEY_F)==1 then FreeFramework(fw) fw=CreateFramework() SetGlobalObject("fw",fw) scene=LoadScene("Maps/terrain_base2.sbx") playercreation()-- call the controller function again to create new controller and camera variables end ------------------------------------------------------------------------------------------------------------------ Flip(0) end controller:Free() ShowMouse()
  2. hmmm weird. no, i have tried various names and ports... but i do not ever see anyone connected in the players list... everything is just blank... i type something then it just disconnects after some time period..
  3. ehh... not that i know of... it asked me when i first ran the program if i wanted to unblock the program... but other than that i have no issues with xfire,teamspeak, or ventrilo... or even a chat program made using vbscript... i will try other ports... I assume you mean this is working for others?
  4. i hit the client button... it shows the leadwerks server... i click that... i dont see other players there... i type something and hit enter... i dont see my text in the textbox afterwards... then after 60 seconds or so it disconnects... running as admin... **edit-- is there supposed to be something to let the client know he actually connected?
  5. does this work? i just get disconnected....
  6. object.body:SetParent(object.cube,1)
  7. I assume he is referring to wh1sper's downloader. Sounds like an issue that someone else reported here with their wireless where it was causing problems with the download. If I remember correctly once they used a hardline, it fixed the issue.
  8. can you not connect with a hardline instead of a wireless connection?
  9. oh... thought you were just trying to get fullscreen... AppSetting might not have a lua equivalent... Graphics(800,600,32,60,0) not that you need AppSetting... you could easily make your own boolean variable to be used to toggle the fullscreen
  10. its exactly the same...
  11. no. the base lua file doesn't exist any more in the latest update to single state lua. You need to do a clean install.
  12. no you can do it per entity as well... SetBodyGravityMode
  13. require("scripts/class") local class=CreateClass(...)
  14. what version did you update from? there was a change in phy files for 2.28.
  15. i havent looked but i assume they were done like my second suggestion where node1 is linked to node2 and node3 is linked to node1 etc....
  16. Click on Tools>Link Index and change the number... now the question is how to iterate thru the number of links? or link node1 to node2... then link node3 to node1 all in the same link index...
  17. does your controller have a mass? That is required.
  18. actually thats a good idea going back to what DJDD was suggesting where the separate body parts would all be combined via script... hmmm... that also opens up the ability to sever body parts as well... thats how CoD had done it at one time... Have basically one body and then the head was another model parented to the body...
  19. edit--- youre right. My question might have come off less than sincere. My apologies. Yes, I am not disagreeing that instancing will solve some issues. But you combine instancing with niosops method and you can limit the performance hit and still have tons of possibilities.
  20. and thats where instancing would come in and Josh has already said he would look into implementing it but note that you will lose performance... so I don't know why you keep beating a dead horse... can you not be satisfied with anything or do you just like to complain?
×
×
  • Create New...