Jump to content

Marleys Ghost

Members
  • Posts

    2,157
  • Joined

  • Last visited

Everything posted by Marleys Ghost

  1. Something along the lines: TController player = CreateController(playerheight,0.4,0.5, 46); TMesh mesh=LoadMesh("crawler.gmf"); MoveEntity(Mesh,"To where you want it"); EntityParent(Mesh, player); PositionEntity(player,Vec3(0,5,0)); EntityType(player,1); SetBodyMass(player,1); then you wont need to up date it. off the top of my head.
  2. Have you tried Parenting the animated model to the contoller?
  3. Nice work Niosop, I will have a small glass of whatever your character has been drinking
  4. Models can have a stepmode value of 1 or 0. saying you can step onto it or you can't. and its normally in the oildrum.ini Not played with this yet in 2.3
  5. Marleys Ghost

    12-14-2009

    Cool !! ... hang on, I don't remember making any lol ...
  6. Yes, while in VC++ 2008 hit ctrl + F7 Seriously though, you will need to add to the code your SDK path and what ever name you want to use for your map. Plus an .exe of this would not allow you to turn on/off any of the Post Processing FX.
  7. hmm, probably just me .. but is the texture inverted on the front of it?
  8. oh no ... you made the dumpster dirty ... thanks Gimpy
  9. not in the code. Its added by the wizard to the project and included from framewerk.
  10. Using VC++ 2008 Express Use the 2.3 Project Wizard to create a new project I simply called the example "sceneloading" Delete the generated example code in sceneloading.cpp Replace with the following code: #include "Framewerk.h" int main(int argc, char** argv) { Initialize(); RegisterAbstractPath("PATH TO YOUR SDK FOLDER"); Graphics(800,600); leadwerks::Framewerk fw; fw.Create(); // Setup Global Objects SetGlobalObject ("world_main", fw.GetMain ().GetWorld ()); SetGlobalObject ("world_transparency", fw.GetTransparency ().GetWorld ()); SetGlobalObject ("world_background", fw.GetBackground ().GetWorld ()); SetGlobalObject ("camera_main", fw.GetMain ().GetCamera ()); SetGlobalObject ("camera_transparency", fw.GetTransparency ().GetCamera ()); SetGlobalObject ("camera_background", fw.GetBackground ().GetCamera ()); TListener listener= CreateListener(fw.GetMain ().GetCamera ()); SetGlobalObject("listener", listener); // Setup Initial Post Processing FX fw.GetRenderer().SetGodRays(1); fw.GetRenderer().SetHDR(1); fw.GetRenderer().SetSSAO(1); fw.GetRenderer().SetBloom(1); fw.GetRenderer().SetAntialias(1); fw.GetRenderer().SetReflectionRenderComponents(ENTITY_RENDERABLE); // Load Skybox fw.GetRenderer().SetSkybox(LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat")); // Setup On Screen Stats Info fw.SetStats(2); // Setup Collisions Collisions(1, 1, 1); Collisions(1, 2, 1); Collisions(1, 3, 1); Collisions(2, 2, 1); Collisions(2, 3, 1); Collisions(3, 3, 1); LoadScene("abstract::YOUR_SCENE.sbx"); // Setup spectator TBody spectator=CreateBodySphere(); SetBodyMass(spectator,1); SetBodyGravityMode(spectator,0); SetBodyDamping(spectator,1.0); EntityType(spectator,3); SetBodyBuoyancyMode(spectator,0); PositionEntity(spectator,Vec3(0,75,0)); TVec3 camrotation=Vec3(0); float mx=0; float my=0; float move=0; float strafe=0; HideMouse(); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); // MAIN LOOP while (!KeyHit(KEY_ESCAPE)) { 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.GetMain().GetCamera(),camrotation); move=KeyDown(KEY_W)-KeyDown(KEY_S); strafe=KeyDown(KEY_D)-KeyDown(KEY_A); TVec3 force = Vec3(strafe*10.0,0,move*10.0); force=TFormVector(force,fw.GetMain().GetCamera(),0); AddBodyForce(spectator,force); UpdateAppTime(); UpdateWorld(AppSpeed()) ; PositionEntity(fw.GetMain().GetCamera(),EntityPosition(spectator)); fw.Update(); fw.Render(); Flip(0); } fw.Free(); return Terminate(); } Add existing items Framewerk.cpp Layer.cpp Renderer.cpp (Right click on the sceneloading solution, add/existing item and navigate to your SDK's CPP folder) Copy to the sceneloading project folder shaders.pak Scripts folder from your 2.3 SDK folder *You will need to make sure you have wobbledot3.dds in the materials folder in your SDK folder. I found without it, using emitters in a scene will casue the app to crash on loading. I am not sure if 2.3 comes with this file and my download just missed it, or its not included. I took mine from a previous install. Simply place it in the root of the materials folder. I made it so the code points to the SDK folder so nothing, other than the scripts folder and textures.pak need to be moved to the sceneloading app dir. Create a scene and save it in the maps folder in your SDK folder, note though as far as I can tell you will have to load the skybox manually via code (as per above code) or parse it and the waterplane via a small ProcessScene function. You need to update the oildrum.lua file with this (Thanks to Macklebee): dofile('Scripts/base.lua') -- We need the base class entity --Time between hit noises hitnoisedelay=100 --Minimum collision speed to make noise hitthreshhold=3 lasthitnoisetime=0 hitnoisetimevariation=50 maxhitsources=10 --Load some noises to play hitnoise={} hitnoise[0]=LoadSound('abstract::impact_metal12.wav') hitnoise[1]=LoadSound('abstract::impact_metal13.wav') hitnoise[2]=LoadSound('abstract::impact_metal07.wav') material_dust=LoadMaterial('abstract::dust.mat') --Spawn entity function Spawn(model) local entity=base_Spawn(model) return entity end --Add collision noise function Collision(model,entity,position,normal,force,speed) local entity=entitytable[model] local time,i if fw~=nil then listener = fw.listener else listener=GetGlobalObject("listener") end if EntityDistance(listener,model)<30 then if speed>hitthreshhold then time=AppTime() if time-lasthitnoisetime>hitnoisedelay then --Check how many impact noises are already active local countsources=0 for i=0,2 do if hitnoise[i]~=nil then countsources=countsources+hitnoise[i]:ActiveSources() end end --Only emit a sound if there are fewer than the allowed max sources if countsources<maxhitsources then i=math.random(0,2) if hitnoise[i]~=nil then entity.model:EmitSound(hitnoise[i],30,1.0,0) end end lasthitnoisetime=time+math.random(0,hitnoisetimevariation) end end end end This is only a very basic example using framewerk. Hope this is of some help to someone.
  11. Have a look through this thread and threads linked from it. Might be of some help.
  12. I'm aware of the definition, was just curious how you apply it to something you have already completed a deal on. Terrain Layers Global illumination Seems they are coming, eventually.
  13. This is all looking very good indeed TylerH.
  14. I have tried Macks code, the controller set to a body mass of 10, without the adjustment to the collisons that is: Collisions(1, 3, 1) The barrels will fly all over the place when bumped into .. but using the suggested adjustment: Collisions(1, 3, 3) They act normally for me.
  15. I am currently using 1.35 .. have had no obvious problems thus far with 2.3
  16. Yes, thank you Gordon, I shall have a look through those later.
×
×
  • Create New...