Crystal Space
Welcome, Guest. Please login or register.
December 21, 2014, 06:25:54 pm

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9297 Members
Latest Member: Adrihjapa
* Home Help Search Login Register
  Show Posts
Pages: [1] 2 3 ... 6
1  Crystal Space Development / Support / Re: Question about blender2crystal on: February 29, 2008, 11:05:15 pm
Download
1.) Blender
2.) Python2.5.1
3.) PyXML
4.) Python Imaging Library
5.) blender2crystal
from here: http://b2cs.delcorp.org/index.php/ArtistInstall

Using CS and CEL 1.2
2  Crystal Space Development / Support / Re: [Resolved] CEGUI subscribeEvent on: February 29, 2008, 10:58:42 pm
Ah good Smiley

If you referenced one of the other header files that already had CEGUIWindowManager.h included then you had it referenced twice; I've seen weird issues when that happens.
3  Crystal Space Development / Support / Re: csRef<iPcLinearMovement>->SetFullPosition not placing the mesh correctly on: February 29, 2008, 12:32:26 am
Honestly I don't know, I got it from PlaneShift; removing it doesn't place the mesh at the passed in coordinates however Sad
4  Crystal Space Development / Support / Re: csRef<iPcLinearMovement>->SetFullPosition not placing the mesh correctly on: February 28, 2008, 08:46:31 pm
Any idea?

Thanks Smiley
5  Crystal Space Development / Support / Re: CEGUI subscribeEvent on: February 28, 2008, 07:14:12 pm
I had this problem and had to initialize CS objects outside of the "main" class in a different manner then GetObjectRegistry(). Here is an example:

Code:
// Initialize the Keyboard class
bool Keyboard::Initialize(iObjectRegistry* obj_reg)
{
    object_reg = obj_reg;
randSteps = 0;
battleEnd = false;
done = false;

    keybd = csQueryRegistryOrLoad<iKeyboardDriver> (object_reg,
        "crystalspace.driver.input.generic.keyboard");
    if (!keybd)
    {
        csReport (object_reg,
    CS_REPORTER_SEVERITY_ERROR, "Phage.keyboard",
"Can't load the keyboard driver!");
        return false;
    }   

    return true;
}

The problem here is that you need to get the specific plug-in name which puts you are the mercy of the public API (they are given in the General Description of the class, if at all). Or you can ask for help on the boards looking for the specific plug-in name.
6  Crystal Space Development / Support / Re: Question about blender2crystal on: February 25, 2008, 05:19:26 am
Quote
Yep, I've got Python 2.5.1, PyXML v0.8.4 and Python Imaging Library v1.1.6 installed (using binary installers).

If you use the above, the latest version of Blender you can use is 2.44 (2.5 being the newest on their site). If you go into their repository you can download 2.44; with which blender2crystal should work with the above components.
7  Crystal Space Development / Support / Re: Attach attributes to a CEL entity? on: February 24, 2008, 12:26:26 am
whoops hehe Smiley

I looked in the manual and in the API but i must be missing it somehow. is there a listing somewhere of all the properties? I've looked through all the stuff i can find at:
http://www.crystalspace3d.org/main/Documentation ?

Like the manual says to load the specific factories, although only "mesh" is given. I tried:

Code:
if (!pl->LoadPropertyClassFactory ("cel.pcfactory.tools"))
return false;

EDIT -
Well, the proper plug-in name is:
Code:
<propclass name="pctools.properties" />


Is there a listing of them (properties/plugins) somewhere to browse?

Thanks!
8  Crystal Space Development / Support / Re: Attach attributes to a CEL entity? on: February 23, 2008, 06:59:00 pm
I added

Code:
<propclass name="tools.property" />

to the entity file name but the engine bugs out when the file is loaded. It says there is no factory to load the property class too.

the entity file:
Code:
<world>
  <plugins>
    <plugin name="celentity">cel.addons.celentity</plugin>
  </plugins>

  <sector name="Scene">

    <addon plugin="celentity" entityname="Muck1">

      <propclass name="pcobject.mesh">
        <action name="LoadMesh">
  <par name="filename" string="/lib/Muck/library" />
  <par name="factoryname" string="spr3dSphere" />
</action>
      </propclass>

      <propclass name="pcobject.mesh.select" />
<propclass name="tools.property" />

      <propclass name="pcmove.linear">
        <action name="InitCD">
  <par name="body" vector=".2,.2,.2" />
  <par name="legs" vector=".2,.2,.2" />
  <par name="offset" vector="0,-.3,0" />
</action>
      </propclass>

      <behaviour name="box_behave" />

    </addon>

  </sector>
</world>

and the C++ code:
Code:
battle1_entity = pl->FindEntity("Muck1");
csRef<iPcProperties> pcprop = CEL_QUERY_PROPCLASS_ENT (battle1_entity, iPcProperties);
pcprop->SetProperty("Health", muckHealth);

I must be missing something?
9  Crystal Space Development / Support / Re: Attach attributes to a CEL entity? on: February 23, 2008, 03:15:20 pm
Awesome, thanks!
10  Crystal Space Development / Support / Attach attributes to a CEL entity? on: February 23, 2008, 01:15:45 am
Is it possible to attach attributes, like Health and Strength directly to an entity?

Thanks!
11  Crystal Space Development / Support / Re: csRef<iPcLinearMovement>->SetFullPosition not placing the mesh correctly on: February 22, 2008, 10:04:31 pm
Sure Smiley

I end up in the new sector properly but at csVector3(2,1,-8); and it's not always at (2,1,-8). It seems like it varies upon where I am in the original sector.
12  Crystal Space Development / Support / Re: csRef<iPcLinearMovement>->SetFullPosition not placing the mesh correctly on: February 22, 2008, 09:04:32 pm
Sure, this is the function call:
Code:
MoveHero (csVector3(2,2,15), "Scene2");

I basically expected the hero to show up at 2,2,15 in the new sector.
13  Crystal Space Development / Support / Re: csRef<iPcLinearMovement>->SetFullPosition not placing the mesh correctly on: February 22, 2008, 06:50:05 pm
Quote
Perhaps try with a debugger or printf to print out the values of the location that you pass to SetFullPosition()

Have already, everything is getting passed in right Sad

It shouldn't matter that I'm moving from 1 sector to another, as long as I measure the position in the new sector properly right?
14  Crystal Space Development / Support / Re: csRef<iPcLinearMovement>->SetFullPosition not placing the mesh correctly on: February 22, 2008, 02:49:26 pm
Sure Smiley

Code:
// Set up the application
bool Phage::Application()
{
    ...

if (!LoadLevel ("Phage1"))
    return ReportError ("Error loading level!");

   ...
}

Load the game level

Code:
// Load an initial game level
bool Phage::LoadLevel(csString level)
{
// Some flags to allow for 'in-game' movement and actions
LevelFlag = true;
StartCamFlag = false;
string levelName = "";
string libName = "";
string entitiesFile = "";
levelName = "/lev/" + level;
libName = "/lib/" + level;
    entitiesFile = level + "_entities";

const char* load_level = levelName.c_str ();
    const char* load_lib = libName.c_str ();
const char* load_entities = entitiesFile.c_str ();

#ifdef CS_DEBUG
Report (CS_REPORTER_SEVERITY_NOTIFY, "Attempting to load Map 1 level ...");
#endif

// Create the level entity
  level_entity = pl->CreateEntity ("level", bl, "level_behave",
    "pcworld.zonemanager",
    CEL_PROPCLASS_END);
  if (!level_entity)
    return ReportError ("Error creating level entity!");

  // Now get the iPcZoneManager interface so we can setup the level.
  csRef<iPcZoneManager> zonemgr = CEL_QUERY_PROPCLASS_ENT (level_entity,
  iPcZoneManager);
  iCelZone* zone = zonemgr->CreateZone ("main");
  iCelRegion* region = zonemgr->CreateRegion ("main");
  zone->LinkRegion (region);

  // Load the mapfile
  iCelMapFile* mapfile = region->CreateMapFile ();
  mapfile->SetPath (load_level);
  mapfile->SetFile ("world");

  // Load the entities file for the initial map
  iCelMapFile* entitiesfile = region->CreateMapFile ();
  entitiesfile->SetPath (load_lib);
  entitiesfile->SetFile (load_entities);

  return true;
}

Now in-line, while the game is running:
Code:
// Process the current frame
void Phage::ProcessFrame ()
{
   ...

if (phageKeyboard->randSteps == 50)
{
if (loadBattle)
{
loadBattle = false;
//battleFlag = true;
//MouseMove = false;
worldPos = playerMesh->GetMovable()->GetFullPosition();
LoadBattleLevel ("Battle1");
//MoveHero (csVector3(-42,.5,-82), "Scene2");
MoveHero (csVector3(2,2,15), "Scene2");
LoadBattle1Enemies ();
TransformBattle1Entities ();
}
...

}

Load the battle map:

Code:
// Load the battle map
bool Phage::LoadBattleLevel (csString level)
{
string levelName = "";
string libName = "";
string entitiesFile = "";
levelName = "/lev/" + level;
libName = "/lib/" + level;
    entitiesFile = level + "_entities";
// Some flags to allow for 'in-game' movement and actions
LevelFlag = true;
StartCamFlag = false;
loadBattle = false;

const char* load_level = levelName.c_str ();
const char* load_lib = libName.c_str ();
const char* load_entities = entitiesFile.c_str ();

#ifdef CS_DEBUG
Report (CS_REPORTER_SEVERITY_NOTIFY, "Attempting to load Map 1 Battle 1 level ...");
#endif

// Create an entity for the battle map
battle_entity = pl->CreateEntity ("level", bl, "level_behave",
    "pcworld.zonemanager",
    CEL_PROPCLASS_END);
if (!battle_entity)
return ReportError ("Error creating level entity!");

  // Create a 2nd iPcZoneManager interface so we can setup the battle map
  csRef<iPcZoneManager> battle_zonemgr = CEL_QUERY_PROPCLASS_ENT (battle_entity,
  iPcZoneManager);
  iCelZone* battle_zone = battle_zonemgr->CreateZone ("Battle");
  iCelRegion* battle_region = battle_zonemgr->CreateRegion ("Battle");
  battle_zone->LinkRegion (battle_region);

// Create and load the battle map
iCelMapFile* battle_mapfile = battle_region->CreateMapFile ();
battle_mapfile->SetPath (load_level);
battle_mapfile->SetFile ("world");

// Load the entities file for the initial map
// iCelMapFile* battle_entitiesfile = battle_region->CreateMapFile ();
// battle_entitiesfile->SetPath ("/lib/Phage1");
// battle_entitiesfile->SetFile ("Phage1_entities");

// Get the starting position within the new map and initialize the sector
CamStartPos();

return true;
}


And finally:

Code:
// Move the hero to the new sector/map
bool Phage::MoveHero(csVector3 destPos, csString destSector)
{
// Variables for being able to move sectors
float yrot;
iSector* sector;

loadMap = false;
    string destinationSector = destSector;
const char* destination = destinationSector.c_str ();
// Get the zone manager from the battle level entity
csRef<iPcZoneManager> pczonemgr = CEL_QUERY_PROPCLASS_ENT (battle_entity,
  iPcZoneManager);

// Set the camera to the new region in the battle map
pccamera->SetZoneManager(pczonemgr, true, "Battle", "Camera");

// Position our mesh in the new sector
csVector3 oldPos = pccamera->GetCamera()->GetTransform().GetOrigin();
pclinmove->GetLastPosition (oldPos, yrot, sector);
sector = engine->FindSector (destination);
pclinmove->SetFullPosition (destPos, yrot, sector);

return true;
}

It all works as it should, it just doesn't place the hero/camera at the "Full" position passed, i think its doing the interpolated position or whatever.

Any ideas?

Thanks!
15  Crystal Space Development / Support / Re: csRef<iPcLinearMovement>->SetFullPosition not placing the mesh correctly on: February 22, 2008, 01:39:16 pm
Well I have a single map, then I load into another map and sector which for my intents is very similar to the same map. I basically want to be able to go to the same position in the new map/sector all the time, a fixed position.

But the SetFullPosition function doesn't do it. SetPosition seemed to move me to a point of: existing csVector3 + passed in csVector3, SetFullPosition seems to do the same.
Pages: [1] 2 3 ... 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 5.906 seconds with 16 queries.