Jump to content

Shard

Members
  • Posts

    293
  • Joined

  • Last visited

Everything posted by Shard

  1. Hi, I'm doing some A* work and I need to raycast so that I only get the terrain in the pick, so I can determine the height of the terrain. Is there a way to filter out everything else except the terrain? Thanks
  2. Well if you notice the directional light has been placed at 0,0,0 and is rotated at that spot. But the corona has to be up in the sky. I did try it in code but it didn't result with any changes.
  3. Hey everyone. So I've written a(n okay) day-night cycle but I'm having a little trouble placing the corona for the sun to make it look realistic and I was wondering if someone code help my code out a little bit. The problem I'm having right now is making the corona show up and making it rotate along with the light. void World::CreateCycle(int time = 0) { time = (15*time) - 90; this->cycle = true; //Sunlight this->sunLight = CreateDirectionalLight(); PositionEntity(this->sunLight, Vec3(0,0,0)); RotateEntity(this->sunLight,Vec3(time,0,0)); sun = CreateCorona(); PaintEntity(sun, LoadMaterial("abstract::flare1.mat")); SetCoronaRadius(sun,10,30); PositionEntity(sun,Vec3(0,500,0)); ////Moonlight //this->moonLight = CreateDirectionalLight(); //PositionEntity(this->moonLight, Vec3(0,0,0)); //RotateEntity(this->moonLight,Vec3(time + 180,0,0)); //EntityColor(this->moonLight,Vec4(0)); } void World::UpdateCycle() { TurnEntity(this->sunLight,Vec3(.5,0,0),1); TVec3 sunPos = EntityPosition(sun); sunPos.X = 500*cos(.5); sunPos.Y = 500*sin(.5); PositionEntity(sun,sunPos); }
  4. They have already updated all their drivers as well as installed OpenAL.
  5. No errors on either side. What is LCP1?
  6. So our game, "Zero Hour" just went into pre-alpha and we're giving it to a few friends to test on their pc's. One of them had a problem being able to run it at all. He ended up just getting a blank grey screen but when I run the same project folder everything run just fine. This leads me to believe that I need to have him install other things onto his computer in order to be able to run it but I don't know what these files need to be. Has anyone ever packaged a Leadwerks Project for installation?
  7. Any chance you could go into a little bit more detail? I remember that the ini files were used at once but I thought they would be replaced by Lua files. As for adding a new property to a Lua script, would I just define a property named class and then define it to whatever it needs to be?
  8. Hey guys, quick question. In the SBX, the Editor generates all the data for files. One of the keys for each entity is "class". Does anyone know how I can change that in the editor or in Lua so that I can simply hand off these files to the artist for object placement in levels? The main point of this is to be able to parse things in through code easily and reducing the artists work, who won't have to name each object of the same class several times overs. Model { path="oildrum.gmf" position=5.00000000,0.000000000,5.00000000 rotation=-0.000000000,-0.000000000,0.000000000 scale=1.00000000,1.00000000,1.00000000 id=362643880 "class"="Model" //<-------------- Changing this class in Lua or the Editor "collisiontype"="1" "impactsound"="abstract::impact_metal12.wav,abstract::impact_metal07.wav,abstract::impact_metal13.wav" "mass"="6" "name"="oildrum_1" "stepmode"="0" }
  9. Hey everyone. I'm trying to draw 3D lines in my game world but I don't know if Leadwerks can support that so I was contemplating drawing 2D lines based off of the 3D positions. Does anyone know if I can just draw a 3D line or if I have to take some alternate approach? Also, the reason I'm doing this is to debug my A* grid, which I want to draw on the screen and be able to see the placement and shape of the grid and the block off areas and whatnot by rendering them.
  10. Hey everyone, I'm doing the raycast check for my A* to determine if the square is open or not and I needed a little help figuring some variables out. I'm looking to get the following variables: - The max step height - The terrain height - The terrain slope I did take a look at the wiki but it seems the wiki only accepts an x and y coordinate for parameters. I can only assume this is based of the resolution of the map. In which case, how do I get the resolution of the map? And how would I go about converting a TVec3 into x and y coordinates?
  11. I am actually planning to use a combination of the two methods. First do a raycast to see if the bullet would hit. Then if it would, create a sphere and give it a force. This eliminates a significant number of spheres being created that are complete missed shots and still maintains the realistic feel of bullets being affected by physics.
  12. Thanks Josh, but I know how to open it. the problem that I'm having is that I don't know how to define a class in code. From my level sbx: Model { path="info_player_node.gmf" position=-1.00000000,1.00000000,18.0000000 rotation=-0.000000000,-0.000000000,0.000000000 scale=1.00000000,1.00000000,1.00000000 id=211024872 "class"="Model" "name"="baseEnemy" } Instead of the name being baseEnemy, I want the class to be baseEnemy for all my baseEnemy nodes.
  13. Hey guys, I have a quick question. How do I create a Lua file so that I can declare the class of each object? I want to do this so that I can read in each object with out having to check for each objects name, because that requires that each object be individually named and there can be typos and whatnot that can go wrong. If I code the class before hand, that problem is dealt with easily. Thanks -Shard
  14. Hey all! I've been working on creating some nodes for myself that I can parse in code and I was wondering how I would go about coding a Lua node so that it draws a lines in the editor. What I'm trying to do is create the navArea maps for my AStar so I want to be able to place two nodes, which then create the diagonals for a square. It would be nice to be able to draw the square on screen but I'm not sure how to go about this as my Lua is very weak. Thanks -Shard
  15. I have already tried doing that but point entity takes an entity as a second parameter, which I don't have. I only have TVec3.
  16. Hey guys, got another question. (Sorry about that btw, working on a tight deadline and having a few last minute troubles) I need to move an Entity smoothly between multiple TVec3's that I have and I'm not having any luck doing it right. Essentially it is a Way point navigation but the only problem that I'm having is getting a Entity to move between two points at a time. Currently I've had to resort to jumps between the locations but I would really like it to be smoothed out. Any code samples would be greatly appreciated. Current Code if(KeyHit(KEY_SPACE)) { wayPoints[current+1].Y = currentPos.Y; PositionEntity( enemyController, wayPoints[current+1]); }
  17. How do I get the length and width of the terrain so that I can create an appropriate size AStar map?
  18. Is there a method for getting the length and width of an object? I need this so that I can load up the scene in my process scene so that I can zero out the blocks of objects for my A Star map.
  19. Does it work for multi level buildings? Like a three floor in door scene?
  20. Hey guys, I'v started working on A* and I'm wondering how Leadwerks does it/implements it. Currently I'm creating a "grid" of nodes that contain x-y coordinates and 8 pointers to other nodes around it (n,s,e,w, etc) , where I will parse in the scene to detect objects and then mark off the location of the objects in the grid as impassable. The currently problem that I'm running into is that this leads to the grip taking up a very large chunk of memory (a 512x512 map would take up 10 Megabytes of memory) and isn't efficient for 3D maps at all (like indoors maps). Plus I'm not sure how to detect the slope of the terrain to determine if a character controller can climb up it or not. How have you guys implemented your A* maps? MapGrid.h #pragma once enum aStar{blocked,clear}; struct Node { aStar value; Node *n; Node *s; Node *e; Node *w; Node *ne; Node *se; Node *nw; Node *sw; }; class Map { public: Node **grid; int sizeX; int sizeY; Map(); Map(int,int); }; MapGrid.cpp #include "MapGrid.h" #include "Windows.h" Map::Map() { //Woo I'm a default constructor. } Map::Map(int sizeX, int sizeY) { this->sizeX = sizeX; this->sizeY = sizeY; this->grid = new Node* [sizeX]; for(int i=0;i<sizeX;i++) { grid[i] = new Node[sizeY]; } //Making each node point to all the nodes around it for(int i = 0; i < sizeX; i++) { for( int j = 0; i < sizeY; j++) { if(i == 0) { grid[i][j].w = NULL; if(j == 0) { grid[i][j].n = NULL; } else if(j == sizeY-1) { grid[i][j].s = NULL; } } else if(i == sizeX - 1) { grid[i][j].e = NULL; if(j == 0) { grid[i][j].n = NULL; } else if(j == sizeY-1) { grid[i][j].s = NULL; } } } } }
  21. Yes, I am trying to do it like Eve Online, where if your looking towards the star from very close, you see the corona and are basically blinded by it and at a distance it looks like a star. I don't want the star hidden, though. The problem that I'm having with it is making the star glow like it does in Eve instead of just the corona generated by Leadwerks.
  22. So, no one? Is there anything that you've implemented for this Josh?
  23. Hey guys, I'm making a small simulation of a solar system and I'm making a star. I want the star to glow and have a corona but I can't seem to get it right. The corona seems to only stay inside and the star doesn't glow when I'm close to it. And the corona looks really bad up close. Is there some way I can get this same result using lights and lighting effects? Star.h #pragma once #include "Body.h" class Star : public Body { public: TLight starLight; TCorona starCorona; Star(); Star(float *mass, float *radius, string* name, TVec3 *pos) { this->mass = (*mass); this->radius = (*radius); this->name = (*name); this->pos = (*pos); body = CreateBodySphere(this->radius); mesh = CreateSphere(20,body); int scale = (this->radius*2); ScaleMesh(mesh,Vec3(scale)); //this->starLight = CreateDirectionalLight(mesh); this->starCorona = CreateCorona(); PaintEntity(starCorona,LoadMaterial("abstract::flare1.mat")); SetCoronaRadius(starCorona,this->radius*5,this->radius*5); ScaleEntity(starCorona,Vec3(scale)); } };
  24. Looks like I figured out. I didn't include the shaders file in the project folder and thats why it crashed. Thanks guys! Edit: I do wish that the project creator copied over the Lua files and Shader files automatically upon project creation. That would be nice.
×
×
  • Create New...