Crystal Space
Welcome, Guest. Please login or register.
November 24, 2014, 04:27:08 pm

Login with username, password and session length
Search:     Advanced search
9018 Posts in 2046 Topics by 9108 Members
Latest Member: Nelsowska
* Home Help Search Login Register
  Show Posts
Pages: [1] 2
1  Crystal Space Development / Game Content Creation / Re: detecting hits on: February 06, 2006, 03:56:04 am
Has the online tutorial been updated? Where? I can't seem to find it.
2  Crystal Space Development / Game Content Creation / detecting hits on: February 03, 2006, 06:13:24 pm
I'm new at gamedev so this is a newbie question.

In a FPS, an enemy fires a weapon at the player and the player is hit. How is this detected? Is this through collision detection? I want to add a specific sound when the shot hits the player v/s when it misses.

Thanks in advance.
3  Crystal Space Development / Game Content Creation / Re: attaching weapons to camera on: January 24, 2006, 05:20:08 pm
Oops! Thanks!! It is working now Smiley
4  Crystal Space Development / Game Content Creation / Re: attaching weapons to camera on: January 24, 2006, 04:37:13 pm
Ok, I got that working. The issue is that the weapon keeps getting clipped off with a little bit of camera movement. E.g, after rotating right the weapon gets clipped off and re-appears when I rotate left. Same this happens when rotating left and moving forward. The weapon remains in view when the camera is moved backwards.
The center-point of the weapon is set to the center-point of the camera.
What could be causing this? Here is the relevant code:

void Test::ProcessFrame()
{
  csTicks elapsedTime = vc->GetElapsedTicks();
  float speed = (elapsedTime / 1000.0f);

  iCamera* camera = view->GetCamera();
  iMovable* movable = weapon->GetMovable();

  if (kbd->GetKeyState(CSKEY_RIGHT)) {
    camera->GetTransform().RotateThis(CS_VEC_ROT_RIGHT, speed);
    movable->GetTransform().RotateThis(CS_VEC_ROT_RIGHT, speed);
  }
  if (kbd->GetKeyState(CSKEY_LEFT)) {
    camera->GetTransform().RotateThis(CS_VEC_ROT_LEFT, speed);
    movable->GetTransform().RotateThis(CS_VEC_ROT_LEFT, speed);
  }
  if (kbd->GetKeyState(CSKEY_PGUP)) {
    camera->GetTransform().RotateThis(CS_VEC_TILT_UP, speed);
    movable->GetTransform().RotateThis(CS_VEC_TILT_UP, speed);
  }
  if (kbd->GetKeyState(CSKEY_PGDN)) {
    camera->GetTransform().RotateThis(CS_VEC_TILT_DOWN, speed);
    movable->GetTransform().RotateThis(CS_VEC_TILT_DOWN, speed);
  }
  if (kbd->GetKeyState(CSKEY_UP)) {
    camera->Move(CS_VEC_FORWARD * 4 * speed);
  }
  if (kbd->GetKeyState(CSKEY_DOWN)) {
    camera->Move(CS_VEC_BACKWARD * 4 * speed);
  }

  // position the weapon relative to the camera position
  movable->SetPosition(camera->GetTransform().GetO2TTranslation());

  if (!g3d->BeginDraw(engine->GetBeginDrawFlags() | CSDRAW_3DGRAPHICS))
    return;

  view->Draw();
}
5  Crystal Space Development / Game Content Creation / attaching weapons to camera on: January 23, 2006, 08:49:12 am
I'm constructing a tiny first-person-shooter and am trying to get the current weapon displayed on the screen such that it moves with the camera movement - ala half-life, doom, etc. How does one go about doing this?

Thanks in advance.

6  Crystal Space Development / Game Content Creation / Re: blender to cs on: January 22, 2006, 09:10:38 pm
Hmmm, also having troubles with blender 2.4 ...
Which version of python and 4suite did you take to get it running?

Version 2.3 of python and the lastest version of 4suite (4Suite-1.0a3-py23-win32.exe)

I think that for Blender 2.4 you need Python 2.4

Greetings,

Sorry. I should have mentioned that I reverted to version 2.37a of blender.
7  Crystal Space Development / Game Content Creation / Re: blender to cs on: January 21, 2006, 11:00:09 pm
Hmmm, also having troubles with blender 2.4 ...
Which version of python and 4suite did you take to get it running?

Version 2.3 of python and the lastest version of 4suite (4Suite-1.0a3-py23-win32.exe)
8  Crystal Space Development / Game Content Creation / Re: blender to cs on: January 21, 2006, 10:56:30 pm
Yes, the scripts were installed in .blender/scripts/
Doing the same thing for 2.37a worked.

I don't know... I just got blender2crystal to work with Blender 2.4. Are you sure you originally installed the scripts in the correct location?
9  Crystal Space Development / Game Content Creation / Re: blender to cs on: January 13, 2006, 05:42:26 pm
Thanks! Yes - got it working with blender version 2.37a and python 2.3
10  Crystal Space Development / Game Content Creation / Re: blender to cs on: January 13, 2006, 08:42:02 am
version 2.4 of blender. Win32 dynamic.
11  Crystal Space Development / Game Content Creation / Re: blender to cs on: January 13, 2006, 07:28:31 am
This is version 2.4 of blender on Windows XP SP2. As mentioned in the installation docs, I have included c:\python24; c:\python24\scripts in my PATH and I have also set the CRYSTAL environment variable.
12  Crystal Space Development / Game Content Creation / Re: blender to cs on: January 13, 2006, 05:03:07 am
OK - I installed python, 4suite, PIL, and blender2crystal as documented in that page. I get the File->Export->CrystalSpace menuitem too. When I click on it, blender dies. Sad

Has anyone experienced seen this? What do I do to get over this one?

Thanks!
13  Crystal Space Development / Game Content Creation / Re: blender to cs on: January 13, 2006, 12:32:05 am
Thanks!

I would need to have python as well for this plugin, correct?
14  Crystal Space Development / Game Content Creation / blender to cs on: January 13, 2006, 12:19:40 am
Hello all,

I have created a couple of objects in blender and now want to export them to CS? What is the recommended way to do this?

I tried to download blend2cs from http://projects.blender.org/projects/blend2cs/. The tarball for 0.2.5 seems to be corrupted. The other versions, as well as the windows versions, just do not download. I simply get blank page on the browser.

Thanks in advance.
15  Crystal Space Development / Support / Re: Loading sprites from mapfiles on: December 31, 2005, 07:38:07 am
Thanks Jorrit!

That makes sense as to why sprites come up as nodes.

In any case, I was able to use the node, childobject, and key-value pair functionality to get the sprite to display as I wanted.

In case anyone is interested, here is what I've done:

Added custom attributes to the sprite entity. These are spriteTextureName, spriteTextureFile and spriteFactoryFile. I then set the value of each attribute. This was in Hammer.

In my C++ code, I obtained a pointer to the iMapNode and obtained child objects corresponding to each custom attribute. For each attribute I then obtained the key-value pair, extracted the value and loaded the texture and mesh-factory that I'd specified in Hammer. The sprite displays just fine. Here's the relevant code-snippet (still WIP)

bool WaterPlay::DisplaySprite(iSector* sector, const char* spriteName)
{
  iMapNode* node = csMapNode::GetNode(sector, spriteName);
  if (!node) {
    csString msg("Unable to load sprite: ");
    return ReportError(msg + spriteName);
  }

  // get the required attributes
  csRef<iObject> o_txNameAttr = node->QueryObject()->GetChild("spriteTextureName");
  if (!o_txNameAttr) {
    csString msg("No spriteTextureName attribute for sprite: ");
    return ReportError(msg + spriteName);
  }
  csRef<iKeyValuePair> txNameAttr(SCF_QUERY_INTERFACE(o_txNameAttr, iKeyValuePair));

  csRef<iObject> o_txFileAttr = node->QueryObject()->GetChild("spriteTextureFile");
  if (!o_txFileAttr) {
    csString msg("No spriteTextureFile attribute for sprite: ");
    return ReportError(msg + spriteName);
  }
  csRef<iKeyValuePair> txFileAttr(SCF_QUERY_INTERFACE(o_txFileAttr, iKeyValuePair));

  csRef<iObject> o_factFileAttr = node->QueryObject()->GetChild("spriteFactoryFile");
  if (!o_factFileAttr) {
    csString msg("No spriteFactoryFile attribute for sprite: ");
    return ReportError(msg + spriteName);
  }
  csRef<iKeyValuePair> factFileAttr(SCF_QUERY_INTERFACE(o_factFileAttr, iKeyValuePair));

  // load the specified texture
  iTextureManager* txMgr = g3d->GetTextureManager();
  iTextureWrapper* txWrp = loader->LoadTexture(txNameAttr->GetValue(),
        txFileAttr->GetValue(), CS_TEXTURE_3D, txMgr, true);
  if (!txWrp) {
    csString msg("Unable to load texture for sprite: ");
    return ReportError(msg + spriteName);
  }

  // load the sprite template
  csRef<iMeshFactoryWrapper> meshFact(loader->LoadMeshObjectFactory(
      factFileAttr->GetValue()));
  if (!meshFact) {
    csString msg("Unable to load mesh-factory for sprite: ");
    return ReportError(msg + spriteName);
  }

  // add the sprite to the engine
  csRef<iMeshWrapper> sprite(engine->CreateMeshWrapper(
        meshFact, spriteName, sector, node->GetPosition()));

  sprite->SetZBufMode(CS_ZBUF_USE);
  sprite->SetRenderPriority(engine->GetObjectRenderPriority());

  csRef<iSprite3DState> spriteState(SCF_QUERY_INTERFACE(
        sprite->GetMeshObject(), iSprite3DState));
  spriteState->SetAction("default");
  return true;
}
Pages: [1] 2
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.199 seconds with 16 queries.