Jump to content

AggrorJorn

Members
  • Posts

    4,816
  • Joined

  • Last visited

Everything posted by AggrorJorn

  1. True, inside the pick if statement, it doesn't work. But before I click with my mouse I also check if the model is valid. And there is says that it is valid. The post kindof ruines the indenting of the code. That is why you can see the validation check message constantly. The model does get loaded as it can be seen in my program (when the picking is commented out).
  2. Can you make a video? I would like to see how the controllers are colliding (with debugphysics).
  3. Thanks for the reply. Yes, thats what I as thinking to. The bunker is valid though. Outside the if statement with the pick, I can do whatever I want. here is an exmaple: if (builder.bunker.IsValid) { Console.WriteLine("validation check"); LE.PositionEntity(builder.bunker, new TVec3(50,40,30))l; } if (LE.MouseHit(Mousebuttons.MOUSE_LEFT)) { //LE.HideEntity(character); if (LE.CameraPick(out pick, camera, new TVec3(LE.MouseX(), LE.MouseY(), 1000), 0, 0, null) == 1) { Console.WriteLine("Hit something!"); Console.WriteLine(pick.X.ToString() + " " + pick.Y.ToString() + " " + pick.Z.ToString()); if (builder.bunker.IsValid) { Console.WriteLine("is valid"); LE.PositionEntity(builder.bunker, new TVec3(pick.X, pick.Y + 0.25f, pick.Z)); } else Console.WriteLine("dero, something wrong with validation"); } With as result:
  4. I am trying to get a 3d position using a CameraPick. Unfortunately, when the pick hits something, it crashes the programm as soon as it uses the pick position for placing an entity. The values of the pick seem be ok. What could cause this? if (LE.MouseHit(Mousebuttons.MOUSE_LEFT)) { //LE.HideEntity(character); if (LE.CameraPick(out pick, camera, new TVec3(LE.MouseX(), LE.MouseY(), 1000), 0, 0, null) == 1) { Console.WriteLine("Hit something!"); Console.WriteLine("1:: " + pick.X.ToString() + " " + pick.Y.ToString() + " " + pick.Z.ToString()); LE.PositionEntity(builder.bunker, new TVec3(pick.X, pick.Y + 0.25f, pick.Z)); } else { Console.WriteLine("didn't hit something"); } }
  5. Tower defense games are my favorite casual games. The last few weeks I have been spending some free time on playing several of them. Steam had a lot of sales recently which gave me no choice but to buy them. Here are a few: Defense Grid: The awakening Orcs must die iBomber: Pacific They are quite addictive and found myself buying a lot of available DLC´s. Mutant Madness I want to build a simple tower defense game. That means: Build a tower on flat ground Tower shoots on enemy Enemy dies: you get money for a new tower If the enemy reaches your base, you base will get partially destroyed. You win the game by surviving all the waves. You loose if your base is destroyed. There are many things that can be build to improve the simple basics of this game. However, experience has learned that I have to keep it simple. Trying to complete something with easy rules, is complex enough. Todo On my current todo list: Building placement on flat terrain Simple GUI display Tower shooting Different enemies Steering behaviour
  6. Hi Rick, I actually made this for a school project. The way you describe it is perfectly fine for this. First you check the edge which is adjacent to the tile you are coming from. When there is no wall there, you can start looking for the other 3 (if you have square tiles) walls. pseudo: Check the tile next to me is walkable (water, lava etc) Check the origin-tile edge with the adjacent-tile edge. There is a wall? Done There is no wall? Check if the adjacent tile has 3 other walls (excluded the one you allready checked). If it has 3 walls: done. If it doesn't have 3 walls: Continue search algo.
  7. I do not have any experience in this. Some people do use Leadwerks in the dot.net framework though. Kinda like Pixel perfects stranded demo. http://www.youtube.com/watch?v=U-csE7nbVvg&feature=context&context=C4a437c4ADvjVQa1PpcFO0CVw4fO0V7sU1cy3RYviY8_AGaCAXiC4=
  8. C++ (or C#) is my recomendation. When it comes to managing it is just so much easier to have a good IDE at your side.
  9. No need to apologize Pixel, but thank you anyway.
  10. Found it: instead of checking null, I now simply check: LE.GetEntityTarget(currentNode).IsValid
  11. I like the documentation system. It is really clean. Another advantage is the generation chm files which can be offered offline. Real promising stuff right there.
  12. AggrorJorn

    Freaky Friday

    What was the outcome of your research? Pretty good week. I have been working on a cool school project: making a plugin for maya to realtime stream motion capture data and facial capture data. First time I have written in Python. I have been playing a lot of Tower defense type of games lately, which have inspired me to make a little game in Leadwerks.
  13. @Pixel: I am not sure I understand what you mean. If the target is null if (LE.GetEntityTarget(currentNode) != null) Then these lines shouldn't be executed nextNode = LE.GetEntityTarget(currentNode); Console.WriteLine(LE.GetEntityKey(nextNode, "name").ToString()); @Rick The script finds the models (see screenshot). And since there is no 17th node, the loop should stop.
  14. thanks for the reply. Isn't this line doing that? if (LE.GetEntityTarget(currentNode) != null)
  15. How can I prevent that an entity has not target and thereby crashes the program? //Get the path TEntity currentNode = LE.FindChild(level1, "node_1"); Console.WriteLine(currentNode.ToString()); bool pathEnded = false; while(pathEnded == false) { TEntity nextNode; if (LE.GetEntityTarget(currentNode) != null) { nextNode = LE.GetEntityTarget(currentNode); Console.WriteLine(LE.GetEntityKey(nextNode, "name").ToString()); path.Add(LE.EntityPosition(nextNode)); currentNode = nextNode; } else pathEnded = true; } the log reports that it finds all the nodes now, but as soon as the target is not present, my programm crashes.
  16. Particles normally are drawn in the forgroun world, so yes, that would make sense.
  17. I don't know what the best result is. Blast wave: I don't know if it is difficult to create an emitter that has a circular direction force. (ellipsoid I believe). Maybe someone else has experience with this. The heat haze: Maybe a small sphere with a translucent/heathaze shader (Like in the C++ tutorial) that quickly expands. It goes so fast that a player can not see that it is just a sphere with a transparancy texture on it.
  18. lets see.. Make a class Explosion damage smokeTrailsMinAmount smokeTrailsMaxAmount smokeTrailsMinHeight smoketrailsMaxHeight fireBallMinSize fireBallMaxSize blastWaveRadius [*]Add 4 particles Smoke trails (light grey. the amount should be random as well as its height ) fire balls (big slower, red, yellow) dark black smoke Blast wave (circular direction, short and white) [*]Ad a heat haze (not familiar with it further) [*]Get All objects in its range that have dynamic physics. [*]Calculate the distance per object and divide the damage variable with it. Apply the calculation value as a force from the explosion direction to the object I do not have any experience with it, but thats how I would start. good luck
  19. Thank you 2. I never heard about a symlink before. It is quite useful!
  20. Copy the scripts folder from the SDK to your project folder. That should solve the problem.
  21. Thanks for the answer Rick. As far as I can tell, it does find the object using only FindChild. To make sure that is it correct I have its name checked //Find the correct index with GetChild TEntity entTemp = LE.FindChild(level1,"node_1");//LE.GetChild(level1, i); //After every child index has been found, use GetEntityKey to search for Object with a name if (LE.GetEntityKey(entTemp, "name") == "node_1") Console.WriteLine(LE.GetEntityKey(entTemp, "name").ToString); I see now where the problem lies. I get the entity target but that target can be null. I get a system protected memory error. I think I can find whats wrong now. Just have to find out how I can solve this.
  22. I am working on a simple Tower defense tech demo and I have a little problem. I want to address a roadnode in the editor via C#. After that, I want to make a simple loop that goes though the nodes with GetEntityTarget. At the moment I search for the first road node in a level. Then I loop through the roadnodes to get a list that represents the path. The problem is, that it can not find a target in the scene, while the road nodes are deffinitly connected in the editor. //Load the first level TEntity level1 = LE.LoadScene("abstract::level1.sbx"); //Get the path TEntity currentNode = LE.FindChild(level1, "node_1"); List<TVec3> path = new List<TVec3>(); bool pathEnded = false; while(pathEnded == false) { TEntity nextNode = LE.GetEntityTarget(currentNode); if (nextNode == null) pathEnded = true; else { path.Add(LE.EntityPosition(nextNode)); currentNode = nextNode; } }
  23. There is. It is the PointEntity command. It even has a parameter for slowing the rotation. http://www.leadwerks...ointentity-r129
  24. Try this. bool mouse = true; //in the main loop: { if(KeyHit(KEY_ESCAPE)) { if(mouse ) { HideMouse(); mouse = !mouse; } else { ShowMouse(); mouse = !mouse; } } }
×
×
  • Create New...