EVENT_IMPACT

Posted By: Quad

EVENT_IMPACT - 03/08/08 00:30

im trying to make a sliding platform (just for expirement)

and i have that:

Code:
 function platform_event(){
if(your.skill1==-41){
my.skill1 *= -1;
}
}

action platform(){
my.emask = ENABLE_IMPACT;
my.event = platform_event;
my.skill1 = 1;
while(1){
c_move(me,vector(my.skill1*2,0,0),nullvector,IGNORE_SPRITES|IGNORE_PASSABLE|USE_BOX|IGNORE_PUSH);
wait(1);
}
}

action platform_nokta(){
my.skill1 = -41;
}



as you can see the "platfrom" is sliding thing here, it slides along x axis, and if it hits an entity with skill1 = -41 it starts to move opposite direction.I use "platform_nokta" s here. if platform hits platform_nokta it should start to move opposite direction.

But it's not working. I set the nokta's skill1 to -41 in wed also but it doesnt seem like they re acting as "you" when they got hit by platform.

p.s. when i set my player's skill1 to -41 and touch the platform it works. it only works for player.

using 7.07
Posted By: A.Russell

Re: EVENT_IMPACT - 03/08/08 06:36

I think event_impact is for when another entity moves into collision with your platform. To be sure, you can tell if the event is triggered or not by setting a breakpoint at the beginning of your event function.

Try a different type of event or check if your c_move was able to move your platform and reverse direction if not.
Posted By: Quad

Re: EVENT_IMPACT - 03/08/08 07:32

then if i edit the event for platform nokta's they should work, im giving it a try now thanks.


edit:yes it worked thanks.
© 2024 lite-C Forums