Crystal Space
Welcome, Guest. Please login or register.
April 16, 2014, 11:56:20 am

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7580 Members
Latest Member: Charlesgribble
* Home Help Search Login Register
  Show Posts
Pages: [1]
1  Associate Projects / CEL Discussion / Troubles with billboard on: December 12, 2010, 08:29:46 am
Hello, I have a problem and need your advice. I can`t make billboard clickable. Actually, it don`t react to any my activities. I`m new in this subject, CELL and CS I mean, help me please.
 Here my billboard:
Code:
        _g3d->BeginDraw (CSDRAW_2DGRAPHICS);
       
//adding billboard factory
        if (!_pl->LoadPropertyClassFactory ("cel.pcfactory.2d.billboard"))
                printf("Error loading pcbillboard factory!");
       
//loading textures
        iTextureWrapper* txt2 = _engine->CreateTexture("start", "gameData/start.png", 0, CS_TEXTURE_2D);
        txt2->Register (_g3d->GetTextureManager ());
        _engine->CreateMaterial ("start", txt2);
       
//Creating entity
        menu_entity1 = _pl->CreateEntity ("menu_start", _bl, "menu_behave",
                "pc2d.billboard",
                CEL_PROPCLASS_END);
       
//creating pcBillboard (each pcBillboard controls one billboard)
        csRef<iPcBillboard> start_g = celQueryPropertyClassEntity <iPcBillboard> (menu_entity1);
       
//enable events processing
        start_g->EnableEvents(true);
        if(!start_g->AreEventsEnabled())
                printf("pcBillbord events are disabled!");
       
//billboard creating + some parametres for it
        start_g->SetBillboardName("start");
        iBillboard* b1 = start_g->GetBillboard();
        b1->SetSize(73143, 75143);
        b1->SetMaterialNameFast("start");
        b1->SetPosition(65000,55600);
        b1->SetTextBgColor(csColor(0,0,0));
        b1->StackTop();
       
//billboard contol flags switching on
        csFlags& f1 = b1->GetFlags();
        f1.SetAll(true);
        f1.Set(CEL_BILLBOARD_CLICKABLE, true);
 
+++++++++++++++++++++++++++++++++++++++++++++++++
//behaviour for billboard events
BehaviourMenu::BehaviourMenu( iCelEntity* entity, BehaviourLayer* bl, iCelPlLayer* pl)
                                  : CommonBehaviour (entity, bl, pl) {
//catching message
        id_pcbillboard_select = pl->FetchStringID ("cel.billboard.select.down");//*/("pcbillboard_select");
//using [u]pcbillboard_select[/u] instead of [u]cel.billboard.select.down[/u] changes nothing
}
 
bool BehaviourMenu::ReceiveMessage( csStringID msg_id, iMessageSender* sender, celData& ret,
                                    iCelParameterBlock* params ) {
//getting entity name to compare
                const char *entityName = _entity->GetName();
//static pointer to call RunFirstlevel
                GameApplication *p = GameApplication::getApp();               
                if( !strcmp( entityName, "menu_start")) {
                        p->RunFirstLevel();
                        printf("***Start clicked***");
                } else if ( !strcmp( entityName, "menu_exit")) {
                        p->CloseApp();
                        //printf("Goodbye!");
                } else if( !strcmp( entityName, "options")) {
                        printf("***Options clicked***");
                }
        return true;
}

2  Associate Projects / CrystalBlend Discussion / Blender2Crystal problem with quests on: November 09, 2010, 10:22:23 am
Hi everyone! Need your help urgently!
I want to bind the quest to one of the entities in the world. I created it in the quest manager, he has two status. In the first status is set MeshSelectTrigger and add it to the second award newstate status. Exporting. It creates an xml addon in it all as in the manual. But when I run your world application it gives error

cel.questmanager.load:  Unknown reward type 'newstate' while loading quest 'crush'!

xml entities_world

<?xml version='1.0' encoding='UTF-8'?>
<world>
  <sector name='Scene'>
    <addon plugin='cel.addons.questdef'>
      <quest name='crush'>
        <state name='celaya'>
          <trigger type='meshselect'>
            <fireon entity='$this'/>
            <reward message='first udar' type='debugprint'/>
            <reward state='polovina' type='newstate' entity='$this'/>
          </trigger>
        </state>
        <state name='polovina'>
          <trigger type='meshselect'>
            <fireon entity='$this'/>
            <reward message='second state' type='debugprint'/>
          </trigger>
        </state>
      </quest>
    </addon>
    <addon entityname='boxforcrush' plugin='cel.addons.celentity'>
      <propclass name='pcobject.mesh'>
        <action name='SetMesh'>
          <par name='name' string='boxforcrush'/>
        </action>
      </propclass>
      <propclass name='pcobject.mesh.select'>
        <property bool='1' name='sendup'/>
        <property bool='1' name='senddown'/>
        <property bool='1' name='global'/>
        <property bool='1' name='sendmove'/>
        <action name='SetCamera'>
          <par name='entity' string='camera'/>
        </action>
        <action name='SetMouseButtons'>
          <par name='buttons' long='2'/>
        </action>
      </propclass>
      <propclass name='pclogic.quest'>
        <property name='state' string='celaya'/>
        <action name='NewQuest'>
          <par name='name' string='crush'/>
        </action>
      </propclass>
      <propclass name='pclogic.quest'>
        <action name='NewQuest'>
          <par name='name' string='crush'/>
          <par name='actor' string='camera'/>
          <par name='target_op_on' string='light_on'/>
          <par name='target_op_off' string='light_off'/>
          <par name='on_distance' string='1'/>
          <par name='off_distance' string='-1'/>
        </action>
        <property name='state' string='celaya'/>
      </propclass>
      <behaviour name='level_behave'/>
    </addon>
  </sector>
</world>


why?!
sorry, my english lang is very bad.
3  Associate Projects / CEL Discussion / Message system on: May 09, 2010, 08:13:30 pm
Hi! sorry for my english. You wrote: "A very important part of CEL is the message system", but where I can get all messages?
Of couse I  can get they from property classes. But "Property classes are one of the main generators of messages" and I think they nonunique generators of messages.
help, please.
Pages: [1]
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.252 seconds with 17 queries.