Crystal Space
Welcome, Guest. Please login or register.
April 19, 2014, 06:11:50 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7597 Members
Latest Member: Drukareczka1989
* Home Help Search Login Register
+  Crystal Space
|-+  Associate Projects
| |-+  CEL Discussion
| | |-+  Where are the changes of 1.9?
« previous next »
Pages: [1] Print
Author Topic: Where are the changes of 1.9?  (Read 3069 times)
zamme
Newbie
*
Posts: 16


View Profile Email
« on: May 08, 2009, 08:07:54 pm »

Hi all!

I'm using cel 1.9 and I can't find a method to obtain the name of the entity trough the entity behaviour.
Where is the GetEntity function of iCelBehaviour? Can I do it by other way?

Thanks.
Logged
jorrit
Administrator
Hero Member
*****
Posts: 1704


View Profile
« Reply #1 on: May 09, 2009, 08:10:24 am »

Hi all!

I'm using cel 1.9 and I can't find a method to obtain the name of the entity trough the entity behaviour.
Where is the GetEntity function of iCelBehaviour? Can I do it by other way?

Thanks.

There is no GetEntity() since it is normally not needed. Can you tell me exactly what kind of behaviours you are using?

Greetings,
Logged
zamme
Newbie
*
Posts: 16


View Profile Email
« Reply #2 on: May 09, 2009, 12:39:51 pm »

Hi jorrit.

I'm making a menu with billboards. I made a behaviour class for all the billboards of the menu.
I want that by pcbillboard_select(mouse) can get the name of the billboard I selected to define the actions to do after. Now I can get the name of the behaviour that I clicked but not the name of the entity of this behaviour. Can I solve it with a billboardmanager?

For example:

BehaviourMenu::BehaviourMenu( iCelEntity* entity, BehaviourLayer* bl, iCelPlLayer* pl) : BehaviourCommon (entity, bl, pl)
{
  id_pcbillboard_select = pl->FetchStringID ("pcbillboard_select");
}

bool BehaviourMenu::SendMessage (csStringID msg_id, iCelPropertyClass* pc, celData& ret, iCelParameterBlock* params, va_list arg) {
  if (msg_id == id_pcbillboard_select) {
// Where I want to know what billboard clicked
     printf("billboard clicked");
      return true;

  } else
    return BehaviourCommon::SendMessage (msg_id, pc, ret, params, arg);

  return true;
}

Thanks.
Logged
zamme
Newbie
*
Posts: 16


View Profile Email
« Reply #3 on: May 09, 2009, 01:20:39 pm »

I solved it.
I assigned the entity name to a csString getting it from the behaviour constructor.

BehaviourMenu::BehaviourMenu( iCelEntity* entity, BehaviourLayer* bl, iCelPlLayer* pl) : BehaviourCommon (entity, bl, pl)
{
  id_pcbillboard_select = pl->FetchStringID ("pcbillboard_select");
  this->entity_clicked = this->entity->GetName();
}

bool BehaviourMenu::SendMessage (csStringID msg_id, iCelPropertyClass* pc, celData& ret, iCelParameterBlock* params, va_list arg) {
  if (msg_id == id_pcbillboard_select) {
     printf("billboard clicked: ");
     printf(this->entity_clicked);
      return true;

  } else
    return BehaviourCommon::SendMessage (msg_id, pc, ret, params, arg);

  return true;
}

See you.

P.D.: Are you thinking about updating the CS/CEL tutorials? There are a lot of problems with. Walktut, waterdemo, etc are outdated. If you need help with I'm documenting all the problems that I find learning CS/CEL, from compiling it in linux(within and without IDE) to develope an application with.
Logged
Vincent
Full Member
***
Posts: 191


View Profile WWW
« Reply #4 on: May 14, 2009, 10:16:53 pm »

P.D.: Are you thinking about updating the CS/CEL tutorials?

Yes, but that probably won't be done until after 1.4 is released
Logged
Pages: [1] Print 
« previous next »
Jump to:  

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.138 seconds with 16 queries.