Jump to content

Shard

Members
  • Posts

    293
  • Joined

  • Last visited

Everything posted by Shard

  1. Thanks for replying, AndyGFX. Three questions. 1) The ini file is just a text doc with a different extension, right? 2) What are the default values I should put in the ini file? 3) I'm having a little trouble parsing the name: http://leadwerks.com/werkspace/index.php?/topic/274-parsing-from-a-scene-with-2-3-editor/page__gopid__2351entry2351
  2. A what? Do I need to parse them in code and then interpret them myself?
  3. Thanks. I've done this for my player position but for things like rendering water, I would need to know its class name. The code I have below is supposed to get its call name but the class name always comes up blank. Entity name always works fine but I need class name to see if I need to render water or not. What am I doing wrong in it? int i=0; int child_count; TVec3 objectPosition; string entityclass; string classname; string objectName; char temp[1024]; child_count = CountChildren(this->level->GetScene()); for( i=1; i<=child_count; i++ ) { entity=GetChild(this->level->GetScene(),i); light=NULL; entityclass = GetEntityKey(entity,"class"); objectName = GetEntityKey(entity,"name"); if(objectName == "player") { objectPosition = EntityPosition(entity); PositionEntity(player->player,objectPosition); } classname = GetEntityKey(entity,"classname"); //Water ====> class name never shows up if (classname=="water_plane") { //make water } }
  4. As stated before, Lua now loads all the lights in Leadwerks. I've found that directional and ambient lights are not loading automatically. Even though the point and spot work just fine without the need for processing. I've also tried to load them using a Process Scene but it doesn't recognize any of the class names. //Directional light else if (classname=="light_directional") { light=CreateDirectionalLight(this->level->GetScene()); SetEntityMatrix(light,GetEntityMatrix(entity)); CopyEntityKeys(entity,light); HideEntity(entity); entity=light; } Am I doing something wrong or is something up with the engine?
  5. Hey everyone. Got another question for ya'll. I've had a couple problems loading levels. I've noticed that every time I load a level with vegetation in it, the game exits without even going into the main loop and I get the below error, even though all the files are included directly from the engine folder "Private". What are some common reasons that the game exists before the main loop? Loading shader "zip::/source code control/appiled project/current version/shaders/shaders.pak//terrain/terrain_flat.vert", "zip::/source code control/appiled project/current version/shaders/shaders.pak//terrain/terrain.frag"... Loading model "d:/source code control/appiled project/current version/private/vegetation_tree_spruce_2.gmf"... Loading mesh "d:/source code control/appiled project/current version/private/vegetation_tree_spruce_2.gmf"... Loading material "d:/source code control/appiled project/current version/private/tree_spruce_leaf_df.mat"... Warning: Failed to load texture "d:/source code control/appiled project/current version/private/tree_spruce_leaf_DF.dds": Path not found. Loading texture "zip::/source code control/appiled project/current version/private/spruce.pak//tree_spruce_leaf_df.dds"... P.S. I apologize for asking so many questions at once. It seems like in order to get one thing working I need to fix another and another just keeps adding to the stack
  6. I would like to pack away the basic Lua classes like base, properties, etc so that the user doesn't have access to them. I've found that when I do dofile("abstract::base.lua") in the windmill object, it works and loads fine but when I did it in the waterplane entity it didn't work and I received the following error in the Engine.log: Loading model "d:/source code control/appiled project/current version/models/entities/environment/waterplane/environment_waterplane.gmf"... Loading mesh "d:/source code control/appiled project/current version/models/entities/environment/waterplane/environment_waterplane.gmf"... Lua error: cannot open abstract::base.lua: Invalid argument Is there some way I can make all these dofiles abstract so that I can hide away all the basic Lua files?
  7. Really? I thought (and have seen) that everything loads through Lua script now. How do I load water? The old ProcessScene didn't have anything for water.
  8. Hey everyone. So I've got my code loading new 2.3 Editor maps with Lua script and its starting to look amazing. I did have one question. I would like to create Nodes, much like the AI node so that I can create a player start position as well as different enemy nodes so that I can parse it and load an object in code as well as the model. My question however is how I create and parse the nodes so that I can do the processing in code. I have looked at the tutorial but it seems with the new editor, parsing is a bit different.
  9. Yup, I thought you meant just the barrel script and I didn't realize that I had to move all of them
  10. Hahah, seems like I've found a question already. How does one go about rendering water with the new system?
  11. Thanks everyone. After doing as Marley suggested, I found that it didn't work. So I took a look at the text that prints out after the engine runs. It seems like all the Lua files (the ones included in the SDK folder) need to be included and I didn't know this. After porting it over all the Lua code, everything started work perfectly. For the time being anyways
  12. I did do as you suggested, but seems like I have the same problem. When I don't do ProcessScene, I don't collide with objects, even though there is Lua code that goes with it. And when I do enable Process Scene, the ground disappears. #include "Include.h" #include "ProcessScene.h" int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nShowCmd ) { TWorld world; TCamera cam; Initialize(); //Create a graphics context Graphics(800,600); //Create a world world=CreateWorld(); if (!world) { MessageBoxA(0,"Error","Failed to create world.",0); goto exitapp; } //Create render buffers TBuffer gbuffer=CreateBuffer(800,600,BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL); TBuffer lightbuffer=CreateBuffer(800,600,BUFFER_COLOR|BUFFER_DEPTH); //Create a camera cam=CreateCamera(); CreateListener(cam); SetGlobalObject("world_main",world); SetGlobalObject ("camera_main",cam); //Load the scene TEntity scene; scene =LoadScene("abstract::simple.sbx"); //ProcessScene(scene); //Texture quality settings TFilter(1); AFilter(4); //Create the spectator TBody spectator=CreateBodySphere(); SetBodyMass(spectator,1); SetBodyGravityMode(spectator,0); SetBodyDamping(spectator,1.0); SetBodyElasticity(spectator,0.0); SetBodyBuoyancyMode(spectator,0); EntityType(spectator,2); PositionEntity(spectator,Vec3(0,2,-4)); float mx=0.0,my=0.0; float move=0.0, strafe=0.0; TVec3 camrotation; HideMouse(); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); Collisions(1,1,1); Collisions(1,2,1); Collisions(1,3,1); Collisions(2,3,1); //================================================================ //Main loop //================================================================ while(!KeyHit(KEY_ESCAPE)) { //Camera looking mx=Curve(MouseX()-GraphicsWidth()/2,mx,3); my=Curve(MouseY()-GraphicsHeight()/2,my,3); MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); camrotation=EntityRotation(cam); camrotation.X+=my * 0.1; camrotation.Y-=mx * 0.1; RotateEntity(cam,camrotation); //Camera movement 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,cam,0); AddBodyForce(spectator,force); UpdateAppTime(); UpdateWorld(AppSpeed()); //Position the camera where the spectator body is PositionEntity(cam,EntityPosition(spectator)); //Render the main world SetBuffer(gbuffer); RenderWorld(); //Render lighting SetBuffer(BackBuffer()); RenderLights(gbuffer); Flip(); } exitapp: return Terminate(); } I think that Josh should do a tutorial for this soon, even if he doesn't so much for other stuff, because those work for the most part and this is a fairly integral part of making a project work properly.
  13. I have looked at this thread but so much of it is in BlitzMax and I don't understand that so well.
  14. So I looked through the tutorial for loading a scene and it seemed simple enough. I followed the code and ran it but the lights and barrels didn't appear even though they showed up in the editor. So I took a level from my teammates work. I loaded it, no processing. There was collision with the terrain but not the object in the scene. I did I process scene, the terrain disappeared but I got collision with the object. I'm wondering if there is something weird in 2.3 or if the version of Process Scene in the tutorial is super old. How do you guys process scene?
  15. Hey all. So I'm sure you have all seen my previous posts on clouds. Now that I have the cloud system figured out, I'm wondering how I make the lifecycle of a particle infinite. Currently I have the particles cycle mode set to 1 which makes them appear instantly instead of having to fill up over time. All I need to do is make it so that the clouds don't automatically dissolve away. Any ideas?
  16. Hey, so is there a way to make a mesh (CreateSphere) be see through instead of white? I want to do this so that when I apply the cloud layer texture to my sky sphere I can see the blue sky texture on the skybox outside the sky sphere.
  17. Hi everyone. I am a SDK owner so I was looking through the tutorials and I just noticed that they all link to a zip file with all the files that are used in it. I tried clicking on it and I got a message box asking for username and password. I tried my forum creds but it didn't let me in. What should I do?
  18. Whats coming... this means that it hasn't been released yet? When can we expect it?
  19. Hey, in one of my previous threads, Josh replied saying that there would be a new "Destruction" tool coming that would allow us to make objects be destroyed on significant impact to which he also posted a video. My question is if this is in the 2.3 Editor and if not, will it be coming soon?
  20. Hello all. Its Sharad. Changed my name to Shard.
×
×
  • Create New...