Jump to content

Shard

Members
  • Posts

    293
  • Joined

  • Last visited

Everything posted by Shard

  1. Thanks Marley and Darth Raff, both your suggestions have made it work perfectly.
  2. After having tried both suggestions, I got the same result. Below is a screencap of the runtime window. The white box should be a blue star. [Edit] I used one of the dds files that came with the engine for the camera node (which wasn't showing up before) and now it is. I believe this is due to the code working, but our star dds still doesn't show with the same code. Also, a quick question about partial alpha. Would that code be able to render partially transparent images, say at 17%?
  3. Hey guys. I am trying to create a HUD with several transparency sprites and draw them to the screen and I've had a couple of problems with them. Loading and drawing a DDS with no transparency works just fine, but loading ones with it result in one of these three problems depending on the setting used: 1) A bad pointer error 2) The transparency loads as black. 3) The transparency loads as white. 4) The entire sprite loads as white. This leads me to as a couple questions. 1) How are we supposed to create DDS with texture? 2) How am I supposed to call the render functions? I was originally calling the update of the HUD like this: //Main loop while(!KeyHit(KEY_ESCAPE) && !AppSuspended()) { controls->Update(); player->Update(); aiManager->Update(); world->Update(); frameWerk->Update(); frameWerk->Render(); hud->Update(); Flip(); } But after reading this, I changed my code to set it to the transparency layer, but that didn't change the reults. //Main loop while(!KeyHit(KEY_ESCAPE) && !AppSuspended()) { controls->Update(); player->Update(); aiManager->Update(); world->Update(); frameWerk->Update(); frameWerk->Render(); frameWerk->GetTransparency().SetWorld(); hud->Update(); frameWerk->GetMain().SetWorld(); Flip(); } //Hud Code void HUD::Update() { DrawImage(LoadTexture("star.dds")); } Attached is the image of what settings we are currently using for the creation of the DDS. What am I doing wrong here?
  4. So I downloaded it and looked through the SDK files and I found example.bmx which looks like the source for running the game but I didn't see any animation handling code in there at all. I did however find a few functions that looked interesting which I tried to find on the wiki, but they were not there. Do you know anything about this at all? - TPlayer - TGun - SetFlashLightMode(True)
  5. Thanks, I still don't know 100% how the rendering works, so this fact slipped my mind.
  6. I meant the 3D position of the center of the screen.
  7. Thanks for that, TFormVector is what I was looking for. Just a quick question, how do I determine the position of the center of the screen?
  8. I am trying to draw an image to the screen and when using Framewerk, the image does not show up to the screen. Please see the code below: Code that doesn't [and should] work: #include "leo.h" using namespace LEO; #include "framewerk.h" using namespace leadwerks; int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nShowCmd ) { Engine engine("Zero Hour", 1024, 768) ; // Calls Initialize(), SetAppTitle() and Graphics() internally Framewerk fw; fw.Create(); TTexture texture = LoadTexture("abstract::door1.dds"); while(!KeyHit(KEY_ESCAPE) && !AppTerminate()) { DrawImage(texture); fw.Update(); fw.Render(); Flip(); } return engine.Free(); } Code that works: #include "leo.h" using namespace LEO; #include "framewerk.h" using namespace leadwerks; int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nShowCmd ) { Engine engine("Zero Hour", 1024, 768) ; // Calls Initialize(), SetAppTitle() and Graphics() internally Framewerk fw; fw.Create(); TTexture texture = LoadTexture("abstract::door1.dds"); while(!KeyHit(KEY_ESCAPE) && !AppTerminate()) { DrawImage(texture); fw.Update(); //fw.Render(); //<--------- error caused by this line Flip(); } return engine.Free(); } [Edit] Of course this is a scaled down example version from my actual game, which is very close to being completed, so I can't not use Framewerk now because too much of the project is reliant on it. [Edit] Of course since I'm not using Render, the Game World doesn't update, so I can't move around the world at all. Is this a bug or am I missing something?
  9. I checked developer.leadwerks.com and I could not find the project. All I found was the tutorials and the engine back versions.
  10. I had a few questions about doing bullet raycasting. I have a gun, whose position and range I know. How do I do a raycast in a straight line from the gun? What I'm really meaning to ask is, if the player is turned sideway, what value should I increment so that the raycast is performed in a straight line from the players perspective? Also, the Pick will return a Pick Object which will have a TEntity object in it. I recall a long time ago that it was possible to create a pointer to my coded classes (for enemies and whatnot) using , I think, Object userdata. Does anyone know how this works? Basically I want to be able to trace if what was hit with the raycast, and if its a AI type, reduce its health. If its a wall, etc, create a bullet hole texture.
  11. So I have the reload animation, and I know the start and end frames. My question is how do I know when the reload animation is completed? How do I check for this? Current Code else if(aniState == reloading) { aniStart = weapon->reloadStart; aniEnd = weapon->reloadEnd; world->frameWerk.GetRenderer().SetFarDOFRange(Vec2(0,50)); world->frameWerk.GetRenderer().SetFarDOFStrength(200); world->frameWerk.GetRenderer().SetFarDOF( true ); frame=AppTime()/30.0; } frame=fmodf(frame,aniEnd-aniStart)+aniStart; Animate(playerBody,frame,1.0,0,true);
  12. We're moving on to the hand-gun animations and I was wondering how the forums handles their animations. Currently I've been thinking about two options: 1) Having the hand gun animations all in one file for each gun. (i.e, running with assault, reloading with assault, running with sniper, reload with sniper, etc) 2) Attaching the gun to the hands and the screen and creating animations for the arms that go with it. Currently, option one sounds the most appealing because it allows for the most flexibility with the guns and hand animations. How do you guys handle your hand-gun animations?
  13. Is it possible to use the abstract file system to load text files? Currently I am trying to load a text file so that I can save my scene data on it and then later be able to load it and read off of it.
  14. Thanks, I should have definitely done this a long time ago.
  15. Thanks. I did this and I got a new error error C2664: 'LoadMesh' : cannot convert parameter 1 from 'const char *' to 'str' I did a Google search on the error but I couldn't find a solution.
  16. Hey guys. I'm coding a specific version of our game for a cinematic. Basically, Porsche will create animations in 3DS and then we will place it in the code. Then the code will read it in and create mesh objects for them. Finally, he can hit "play" and all the animations would run from start to finish. Then we will Fraps it. The problem that I'm having is doing this: //Initialization string objectName; // For aStar stuff if(className == "animation") { TMesh mesh; className = "\"abstract:" + className; className = className + ".gmf\""; mesh = LoadMesh(className); //<------ error C2664: 'LoadMesh' : cannot convert parameter 1 from 'std::string' to 'str' } The object name is defined in the Editor and is the same as the gmf file.
  17. My apologies. I was being silly. I forgot to move the new engine files to my project folder :/ Sorry about that all. /thread
  18. I just did an update minutes ago and the character controller won't work anymore. I've attach a picture with the Run Time Failure and it has something to do with the Function Pointers in Engine.cpp Code TController player = CreateController(1.8,0.4,0.5,45); //<------ Breaks after executing this EntityType(player,1); SetBodyDamping(player,0.0); SetBodyMass(player,100);
  19. Shard

    HUD's

    I'm about to start working on the HUD for my Applied Project game and I wanted to know what the common ways the forum does it. We have a HUD layout [attached] where we will have different sprites for gun models, an ammo count and a two layer health meter (shields/health). From what I figure we would create a plane of some sort that would always be in front of the camera and we would draw the sprites onto the plane and make it see through but I'm not a hundred percent sure how one would go about doing this. So forum, how do you make your HUD's?
  20. How do I find a pointer or reference to the terrain that gets loaded so that I can pass it into TerrainElevation. I am using Framewerk but I don't see any functions for get terrain. Thanks
×
×
  • Create New...