PASSABLE flag not applicable to map entities?

Posted By: Redeemer

PASSABLE flag not applicable to map entities? - 04/14/10 18:16

Hello,

I've been trying to write a script that makes an invisible, passable block appear and become solid once a variable (boss_dead) is set:

Code:
var boss_dead = 1; // the boss is dead

action obj_hidden
{
  my.passable = on;
  my.alpha = 0;
  my.transparent = on;

  while( my )
  {
    if( boss_dead ) // if boss has died
    {
      if( my.transparent == on )
      {
        my.passable = off;
        my.alpha += time_step*4;
        if( my.alpha >= 100 )
        {
          my.alpha = 100;
          my.transparent = off;
        }
      }
    }
    wait(1);
  }
}



But the passable flag seems to have no effect when I attach my action to a map entity. My player object still collides with the map entity, even though it has PASSABLE set on. Is there any way I can get around this? I tried giving the map entity a lower push value than the player and using "IGNORE_PUSH" when I move player, but it makes no difference.
Posted By: Progger

Re: PASSABLE flag not applicable to map entities? - 04/14/10 18:26

when u use c_move u should use ignore_passable in c_move
WFG Progger laugh
Posted By: Redeemer

Re: PASSABLE flag not applicable to map entities? - 04/16/10 15:37

I have that flag on too. It makes no difference.
Posted By: Superku

Re: PASSABLE flag not applicable to map entities? - 04/16/10 15:52

var boss_dead = 1 ;

Is this a mistake in your post or in your code?
Posted By: Redeemer

Re: PASSABLE flag not applicable to map entities? - 04/16/10 22:58

That's a mistake in my post.
Posted By: Superku

Re: PASSABLE flag not applicable to map entities? - 04/16/10 23:23

action obj_hidden2
{
my.passable = on;
}

Can your player move through map entities with this action attached, too?
Posted By: Redeemer

Re: PASSABLE flag not applicable to map entities? - 04/17/10 20:35

Nope. The passable flag doesn't seem to be having any effect on my map entities. I even tried using a negative push value for the map entity and IGNORE_PUSH in my player's c_move instruction, but to no avail.

I'm beginning to think that this is a problem with A6, because I don't think I'm making any mistakes in my code...
Posted By: Superku

Re: PASSABLE flag not applicable to map entities? - 04/17/10 22:18

Then please post the movement code!
Posted By: DLively

Re: PASSABLE flag not applicable to map entities? - 04/18/10 16:12

First; Im sorry - cause Im not sure what the problem is -

However I did try to make a mario game with A7 a while back, and had the same problem;

I was Trying to have it set up so that there was an invisible, passable block, that came visible when you hit with your head, but you could still stand on it while it was inactive..

So I dont believe it to be a problem with A6.



I do have a solution -

what if the initial block was a model, so you can have it passable, and then when the boss is dead, it ent_creates the map_entity, and removes the model.


Good luck!
Devon.
Posted By: testDummy

Re: PASSABLE flag not applicable to map entities? - 04/18/10 22:15

While setting the PASSABLE flag via C-Script (?in the first frame?) might not work, compiling the map entity with the PASSABLE flag set in WED might make the map entity passable.
WMB compiled settings might override script settings.
Posted By: Pappenheimer

Re: PASSABLE flag not applicable to map entities? - 04/18/10 22:41

What about just creating the map entity after the boss is dead instead of switching from passable to solid?
Posted By: Redeemer

Re: PASSABLE flag not applicable to map entities? - 04/19/10 03:10

Quote:
What about just creating the map entity after the boss is dead instead of switching from passable to solid?

My client wants to be able to place the object in the level editor before it appears. But anyway, I have found a solution:

I had forgotten this, but in my player code I set the player's push value to -1 to stop his own bullets from damaging him. So, when I attempted to use a work around such that the wall has a -1 push value and the player uses IGNORE_PUSH, it didn't work.

Of course, now that I've realized these things, I instead set the wall entity's push value to -2 or lower. The player can now pass through it without any problems. It seems to work just as good as the PASSABLE flag, although I'm still somewhat bewildered over why the PASSABLE flag seems to have no effect on map entities.
Posted By: Superku

Re: PASSABLE flag not applicable to map entities? - 04/19/10 12:25

Good to hear but the PASSABLE flag does work with map entities, I use it in my own project!
Posted By: DLively

Re: PASSABLE flag not applicable to map entities? - 04/19/10 12:37

Quote:

I do have a solution -

what if the initial block was a model, so you can have it passable, and then when the boss is dead, it ent_creates the map_entity, and removes the model.

Posted By: Redeemer

Re: PASSABLE flag not applicable to map entities? - 04/19/10 15:31

Quote:
Good to hear but the PASSABLE flag does work with map entities, I use it in my own project!

Perhaps the PASSABLE flag is affected by the push value of any colliding objects..? This would explain why it didn't work for me, as my player entity had a lower push value than the map entity.
© 2024 lite-C Forums