Crystal Space
Welcome, Guest. Please login or register.
October 25, 2014, 01:07:19 pm

Login with username, password and session length
Search:     Advanced search
9011 Posts in 2044 Topics by 8828 Members
Latest Member: Saikjanna
* Home Help Search Login Register
  Show Posts
Pages: 1 2 [3] 4 5 6
31  Crystal Space Development / Game Content Creation / Loading CEL entities into a non-CEL level. on: February 02, 2008, 06:33:48 am
Is this possible? I'd like to be able to load standard CEL entities into a standard CS level; i guess without the use of pcZoneManager. I guess I need to know if I'm going to use CEL entities does the code need to be all CEL, or can it be a mix of say a CS walktest level with CEL entities (monster, treasure chests, doors, etc ...) within it? if so, how can I spawn a CEL entity within a normal CS level?

Thanks Smiley
32  Crystal Space Development / Support / pcactormove->MouseMove() broken? on: February 02, 2008, 12:33:24 am
In either way I've tried it it doesn't seem to work right, it only moves on 1 axis.

Code:
bool Phage::OnMouseMove(iEvent& ev)
{
// We got a keyboard event.
 // csMouseEventType MouseEvent = csMouseEventHelper::GetEventType(&ev);
  //if (MouseEvent == csMouseEventTypeClick)
 // {
  float x = (float)csMouseEventHelper::GetX(&ev);
  float y = (float)csMouseEventHelper::GetY(&ev);

  pcactormove->MouseMove(x,y);

  return false;
}

Just stares at the ground and spins

This is what I used to use in just CS and it worked ok, this just moves on the Y-axis.

Code:
void Phage::MoveMouse()
{
static int frame;
bool stop = false;

if(++frame == 100)
{
frame=0;
stop=true;
}

  int w = g3d->GetDriver2D ()->GetWidth()/2;
  int h = g3d->GetDriver2D ()->GetHeight()/2;
  int x = mouse->GetLastX();
  int y = mouse->GetLastY();

   bool moved = false;

  if (hasfocus)
  {
    // Move the camera and rotate hero mesh with the mouse
//rotate.Set( ((y-h) * 0.51), ((x-w) * 0.51), 0 );
pcactormove->MouseMove(((x-w) * 0.51), ((y-h) * 0.51));
    g3d->GetDriver2D ()->SetMousePosition (w, h);
    moved |= (y-h)!=0;
    moved |= (x-w)!=0;
  }

  if(stop)
    stop=false;

}

Any Ideas?

Thanks Smiley

EDIT - Well I understand it more now, this actually moves the actor (still buggy tho). The reference to the camera isnt the same as initializing a csColliderActor to a camera in plain CS. I guess it's just learning CEL.
33  Crystal Space Development / Support / Re: cel.physicallayer plug in not loading on: February 01, 2008, 01:31:58 pm
Awesome thanks Smiley

Apparently I'm missing the reference to it however, I get an unresolved external symbol and I can't IntelliSense it. I've got all the pre-processor stuff and includes/libraries set up ( including #include <celtool/initapp.h>). Any idea?

Thanks!

EDIT - Must have been a project issue with one of my home projects, my work one works OK. Just having trouble creating a behavior now, gonna go work on that. Thanks for the help Smiley
34  Crystal Space Development / Support / Re: cel.physicallayer plug in not loading on: February 01, 2008, 01:19:22 pm
OK, makes sense Smiley However most of code is CS code and not CEL, can I have 2 initializers in my OnInitialize function? One for cs and one for cel? I had planned on only use CEL entities for objects in the world that were going to be interacted with.

Thanks!
35  Crystal Space Development / Support / cel.physicallayer plug in not loading on: February 01, 2008, 12:26:38 am
I've got everything built, all environment variables set and all dependency directories set too, but when I request the plugin with:

Code:
// Initialize the application
bool Phage::OnInitialize(int argc, char* argv[])
{
  if (!csInitializer::RequestPlugins(GetObjectRegistry(),
    CS_REQUEST_VFS,
    CS_REQUEST_OPENGL3D,
    CS_REQUEST_ENGINE,
CS_REQUEST_PLUGIN("crystalspace.font.server.freetype2",
iFontServer),
    CS_REQUEST_IMAGELOADER,
    CS_REQUEST_LEVELLOADER,
    CS_REQUEST_REPORTER,
    CS_REQUEST_REPORTERLISTENER,
CS_REQUEST_PLUGIN ("cel.physicallayer", iCelPlLayer),
    CS_REQUEST_PLUGIN("crystalspace.collisiondetection.opcode",
iCollideSystem),
CS_REQUEST_PLUGIN("crystalspace.console.output.standard",
iConsoleOutput),
CS_REQUEST_PLUGIN("crystalspace.sndsys.element.loader",
iSndSysLoader),
    CS_REQUEST_PLUGIN("crystalspace.sndsys.renderer.software",
iSndSysRenderer),
// CS_REQUEST_PLUGIN ("crystalspace.cegui.wrapper", iCEGUI),
    CS_REQUEST_END))
    return ReportError("Failed to initialize plugins!");
...

It fails. I know its just a setting/config thing because walktut works but I have no idea what I'm missing; it's the same on my home and work PCs Sad
36  Crystal Space Development / Support / Re: Anything similar to iPcMeshSelect in CEL but for mouse overs? on: January 31, 2008, 06:43:53 pm
Awesome thanks!

Now it's just a matter of whats easier: calculating the mouse position over the mesh position, or implementing CEL where I haven't yet.

Thanks again Smiley
37  Crystal Space Development / Support / Anything similar to iPcMeshSelect in CEL but for mouse overs? on: January 31, 2008, 04:41:32 am
I'm trying to do a few things and it looks like iPcMeshSelect will do most of them but I'd like to invoke a shader on a mesh when a mouse mouses over that mesh for things like showing the player what can be selected and what not. I'd also like to use it for changing the mouse icon from say a standard icon to a fight icon.

So is there similar property class?

Thanks!
38  Crystal Space Development / Game Content Creation / Re: loading between maps (xml world files) on: January 29, 2008, 05:49:16 pm
Yup, that was it Smiley

Thank you very much!
39  Crystal Space Development / Game Content Creation / Re: loading between maps (xml world files) on: January 29, 2008, 03:09:04 pm
Sure, I'm actually working in a Debug mode with the debug libraries. Where can I get you the information you need from MSVC 8? Also am I doing it the right way? Here is the code pieces:

First map load:
Code:
// Set up the application
bool Phage::Application()
{
...
  if (!LoadLevel1 ()) return ReportError ("Failed to load beginning level!");
 
  // Set the camera to our current sector and our maps start position
  view->GetCamera ()->SetSector (room);
  view->GetCamera ()->GetTransform ().SetOrigin (pos)

// Initialize our collider actor.
  if (!phageHero->SpawnHero(cdsys, engine, view)) return ReportError ("Failed to load Hero!");

..
}

Map init function:
Code:
// Load a level
bool Phage::LoadMap (csString level)
{
  // Clear the engine to load the new map
  engine->DeleteAll();
 
  // Change the VFS to the passed level string
  VFS->ChDir (level);
  // Report level loading
  Report (CS_REPORTER_SEVERITY_NOTIFY, "Level Loading ...");
  // Load the level file which is called 'world'.
  if (!loader->LoadMapFile ("world", false))
    ReportError("Error couldn't load level!");

  engine->Prepare();// (meter);
 
  // Determine starting position from the placement of the camera in the world map
  CamStartPos();

  return true; 
}

1st map:
Code:
// Load the 1st map
bool Phage::LoadLevel1()
{
...
// Load up the 1st level
level_name = "/lev/Phage_map1";
if (!LoadMap (level_name)) return false;

// Compute collision detection
  Report (CS_REPORTER_SEVERITY_NOTIFY, "Computing collision detection ...");
  csColliderHelper::InitializeCollisionWrappers (cdsys, engine);
 
  // Initialize the Muck monster
phageMuck = new Muck();
if(!phageMuck->CreateMuckFactory(GetObjectRegistry(), engine))
return ReportError("Failed to load the Muck factory!");

phageMuck->SpawnMuck(cdsys, engine, view, (pos + csVector3(0,0,5)), 1);
...
}

Load the 2nd map:
Code:
// Process the current frame
void Phage::ProcessFrame ()
{
...
if (LevelFlag)
  {
...
// Move the character if the console is closed
if (!console->IsVisible())
    {
...
if (phageKeyboard->randSteps == 50)
{
battleFlag = true;
if (!LoadLevel2 ()) return ReportError ("Failed to load second level!");
}
...
}

// Load the 2nd map
Code:
// Load the 1st map
bool Phage::LoadLevel1()
{
...
// Load up the 1st level
level_name = "/lev/Phage_battle_1";
if (!LoadMap (level_name)) return false;
...
}

When I try to load the 2nd map from within the 1st map, it crashes  on 'iRenderLoop* rl = s->GetRenderLoop ();' here in engine.cpp:
Code:
void csEngine::Draw (iCamera *c, iClipper2D *view, iMeshWrapper* mesh)
{
...
  iSector *s = c->GetSector ();
  if (s)
  {
    iRenderLoop* rl = s->GetRenderLoop ();
    if (!rl) rl = defaultRenderLoop;
    rl->Draw (rview, s, mesh);
  }
...
}
40  Crystal Space Development / Game Content Creation / loading between maps (xml world files) on: January 29, 2008, 04:32:04 am
Hello again Smiley

I'm trying to load between maps (xml world files), everything loads ok but when the engine goes to get the default render loop in engine.cpp it crashes. I thought I could just call engine->DeleteAll() to 'clear' the 3d engine of the previous map before loading the second but DeleteAll() doesn't seem to clear out the existing render loop. I don't want to use portals, I use those for some stuff but I had hoped to be able to load fairly seemlessly between xml world files.

Any ideas?

Thanks Smiley
41  Crystal Space Development / Game Content Creation / SCF Warnings, unreleased instances on: January 28, 2008, 07:05:18 pm
Smiley

I am getting a lot of unreleased instances of a lot of stuff. I am trying to close the application with:

Code:
csRef<iEventQueue> q = CS_QUERY_REGISTRY(Phage::GetObjectRegistry(), iEventQueue);
      if (q.IsValid()) q->GetEventOutlet()->Broadcast(csevQuit(Phage::GetObjectRegistry()));

In an external class, then:

Code:
// Exit loop
void Phage::OnExit()
{
engine->DeleteAll();
Phage::CloseApplication(object_reg);
Phage::DestroyApplication(object_reg);
}

In my base class, but it's not 'cleaning up' everything. What am I doing wrong?

Thanks!
42  Crystal Space Development / Game Content Creation / Rotate sprite 3d mesh in the factory file? on: January 25, 2008, 12:34:55 am
Hello,

I'm trying to rotate my mesh 90 degrees on the Y-axis, I would like to do this in the factory library file so its like a hard transform. I found this tag in spritecal3d:

<hardtransform
    rot_axis_x="0"
    rot_axis_y="1"
    rot_axis_z="0"
    rot_angle="180" />

but I can't seem to find its equivalent in the sprite3d.

Any ideas?
43  Crystal Space Development / Support / Anyway to catch a blender maps trigger? Using CS only, not CEL? on: October 29, 2007, 04:41:44 pm
The title pretty much says it all. Is this possible?

Thanks!
44  Crystal Space Development / Support / Re: Factories of Thing Meshes? on: October 22, 2007, 09:44:19 pm
Quote
Panch, so perhaps explain more specifically the issues you're getting with genmeshes and CD.

Sure. I create a spherical GenMesh using the same code from walktest:
Code:
// Create a GenMesh
bool Time::CreateGenMesh()
{
csRef<iGeneralFactoryState> fstate;

  // Create GenMesh Factory
  imeshfact = engine->CreateMeshFactory (
  "crystalspace.mesh.object.genmesh", "adversary");
  if (!imeshfact) return false;

  fstate = scfQueryInterface<iGeneralFactoryState> (
  imeshfact->GetMeshObjectFactory ());
  csEllipsoid ellips (
  csVector3 (0, 0, 0),
csVector3 (1, 1, 1));
  fstate->GenerateSphere (ellips, 10);

  if (!loader->LoadTexture ("adversary_texture", "/lib/stdtex/misty.jpg"))
    return ReportError ("Error loading 'misty' texture!");
  iMaterialWrapper* adversary_material = engine->GetMaterialList ()
  ->FindByName ("adversary_texture");
  imeshfact->GetMeshObjectFactory ()
    ->SetMaterialWrapper (adversary_material);

   //csRef<iMeshWrapper> adversary = view->GetEngine ()->CreateMeshWrapper (
  sprite = view->GetEngine ()->CreateMeshWrapper (
      imeshfact, "adversary",
room, csVector3 (0, 3, 3));

   return true;

}

When I try to detect collision detection with:
Code:
// Aggro for level 1
if(aggroList.GetSize()>0)
{
for (aggro_i; aggro_i<aggroList.GetSize(); aggro_i++)
{
string aggroName = aggroList.Get(aggro_i);
csRef<iMeshWrapper> aggroed = engine->GetMeshes()->FindByName(aggroName.c_str());

csReversibleTransform trans1 = hero->GetMovable()->GetFullTransform();
csReversibleTransform trans2 = aggroed->GetMovable()->GetFullTransform();
col_aggro = aggroed->QueryObject();

csRef <csColliderWrapper> hero_collider_wrapper =
csColliderWrapper::GetColliderWrapper (hero_object);

if(hero_collider_wrapper->Collide(col_aggro, &trans1, &trans2))
{
Print(col_aggro->GetName());
//aggroList.Delete(col_aggro->GetName());
//engine->RemoveObject(col_aggro);
}
}
}

The CD doesn't report properly, if you can imagine a circle around the circumference on the x-axis of the sphere, CD will work fine along that axis. However, it is not per polygon accurate.  It is however with Thing Meshes. I have my camera set a few marks behind my hero mesh for debugging purposes and I can see the hero mesh intersect with different pieces of the GenMesh with no response. However, if I jump up to the x-axis of the object I will collide properly. With Thing Meshes however I can collide against any polygon and return that collision accurately.

The idea is to create a sphere/cube around enemies that when collided with will let them know to attack me. I have nearly surrendered to the fact that I can not do it with the limitation of CS + ODE collision. It isn't too much of a big deal because I've come up with 2 very workable alternatives.

I would like to see the 'aggro' thing work though as I think my theory and code are sound!
45  Crystal Space Development / Support / Re: Factories of Thing Meshes? on: October 22, 2007, 03:23:11 am
Quote
That means there will be an internal iMeshObjectFactory but no iMeshFactoryWrapper.
Which means I won't be able to socket without an iMeshFactoryWrapper. So i'll try and create my thing meshes with a specifically defined factory.

Quote
Genmesh is preferred now.
Won't work for me because in all my testing, collision detection is not polygon accurate with genmeshes; although it still is with thing meshes.

Thanks!

Pages: 1 2 [3] 4 5 6
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 8.209 seconds with 17 queries.