(SOLVED) subject to obstacle problem

Minor

Member
Hi,
i already put this in another topic, but deserve to be a "real" question.

I have a "subject to obstacle" for my chars, i explain with the screen below.

lNMPR6k.png

0LxsMqs.png


The green is when i need my chars to be blocked(obstacle). but when i go to the switch (the red obstacle at the top), all the vertical zone is blocked for my character, because of subject to obstacle.

I would like to remove "subject to obstacle" only for the red switch .what can i do for this?

thank you  ;)
 
you can make very simple scripts
here an example below
void subobs(int obs)
{// Set's subject to obstacle
    void self = getlocalvar("self");
    changeentityproperty(self, "subject_to_obstacle", obs);
}

void layer(int layer)
{// Set's enemy's layer
    void self = getlocalvar("self");
    changeentityproperty(self, "setlayer", layer);
}

void subscreen(int screen)
{// Set's subject to screen
    void self = getlocalvar("self");
    changeentityproperty(self, "subject_to_screen", screen);
}

void subhole(int hole)
{// Set's subject to hole
    void self = getlocalvar("self");
    changeentityproperty(self, "subject_to_hole", hole);
}

void subwall(int wall)
{// Set's subject to wall
    void self = getlocalvar("self");
    changeentityproperty(self, "subject_to_wall", wall);
}

void subplat(int plat)
{// Set's subject to platform
    void self = getlocalvar("self");
    changeentityproperty(self, "subject_to_platform", plat);
}

set it with @cmd subobs 0 - off
set it with @cmd subobs 1 - on

anim attack1
range 5 78
loop 0
delay 30
offset 100 189
bbox 79 97 50 91
followanim 1
followcond 3
hitfx data/sounds/beat2.wav
frame data/chars/1streetguy1/idle01.gif
delay 6
frame data/chars/1streetguy1/a100.gif
      @cmd        subobs 0
frame data/chars/1streetguy1/a101.gif
frame data/chars/1streetguy1/a102.gif
attack 121 106 59 20 13 0 0 0 13
frame data/chars/1streetguy1/a103.gif
attack 0 0 0 0
      @cmd        subobs 1
frame data/chars/1streetguy1/a102.gif

 
jonsilva said:

Thank you man!  ;)
But that's not exactly what i want i think.

I need to be blocked by the "green" obstacle and not by the "red" switch.
I put your script in my walk animation, it works, but i can pass through the "green" obstacle.

I would like to be always subject to obstacle (with all the animation of the character) except for the red switch.
 
well... its very hard to understand how your level is working
by looking at the image above... ive never saw a level working in comic zone style...

you can try using  platform  1 1 1 1 1 1 1 1 in all animations of the switch (red obstacle)
anim idle
loop 1
delay 6
offset 93 128
bbox 70 75 50 55
platform  1 1 1 1 1 1 1 1
frame data/chars/beyond/1cyb3/idle01.gif

it will remove the platform from the switch obstacle 
 
Thank you very much jonsilva ;D

Don't really understand how the platform works (i read your topic about this too), but it works!!

And sorry, the screenshots were not easy to understand.

Solved.
 
Back
Top Bottom