Page 1 of 1
Event: once only
Posted:
Sat Feb 05, 2005 8:27 pm
by Fenrir
ok, so I got my player to walk against some sarkophags, and as player collides with one of them it will open. Problem is that this event will repeat itself for as long as my player collides with the sarkophag. I want it to open only once, but still keep the physical response between actors.
Help me.. anyone, please I'll buy you a car if you do!
Posted:
Sat Feb 05, 2005 11:28 pm
by brutalDeluxe
on player collision with sarkophag
script
physical response ( player only )
change anim ( open sarkophag )
Perhaps while adding the collision event you selected "repeat while colliding".
Posted:
Sun Feb 06, 2005 9:32 am
by Fenrir
This doesn't stop the sarkophag from opening at every and each collition.
Thanks anyway man!
Posted:
Sun Feb 06, 2005 5:35 pm
by ingsan
Try to create a variable coll_once.
On create, coll_once = 0 ;
On collision, coll_once ++ ; // sarekophag opens when coll_once == 1
if coll_once > 2, coll_once = 2; // No more collision actions
Posted:
Sun Feb 06, 2005 7:29 pm
by Fenrir
ingsan wrote:Try to create a variable coll_once.
On create, coll_once = 0 ;
On collision, coll_once ++ ; // sarekophag opens when coll_once == 1
if coll_once > 2, coll_once = 2; // No more collision actions
I don't understand how or for whom I should put this into the script.
Posted:
Sun Feb 06, 2005 7:48 pm
by Fenrir
Nevermind, I found another solution by destroying the sarkophag on inpact and creating a new sarkophag.
But thanks for your help!
Posted:
Mon Feb 07, 2005 8:12 am
by ingsan
On
your_Actor A :
On event CreateActor, Action Script >
On event Collision (with sarkophag), Script >
coll_once ++ ;
if (coll_once > 2)
{
coll_once = 2 ;
}
On actor
Sarkophag :
on event DrawActor, Script >
if (coll_once == 1)
{
ChangeAnimation(your animation) ;
}
Posted:
Mon Feb 07, 2005 11:44 am
by Fenrir
ingsan wrote:On
your_Actor A :
On event CreateActor, Action Script >
On event Collision (with sarkophag), Script >
coll_once ++ ;
if (coll_once > 2)
{
coll_once = 2 ;
}
On actor
Sarkophag :
on event DrawActor, Script >
if (coll_once == 1)
{
ChangeAnimation(your animation) ;
}
I want to keep the physical response to the sarkophag, but only change animation upon the first collition.
Posted:
Mon Feb 07, 2005 1:14 pm
by micro
add an animation finish event
"add"
"animation finish"
(the animation that opens sarkophag)
"add action"
"change animation"
Actor: sarkophag
Animation: sarkophag(not the one that opens the sarkophag)
direction: forward
"add"
"immediate action"
i hope this will work
Posted:
Mon Feb 07, 2005 2:50 pm
by ingsan
On your_Actor A :
On event CreateActor, Action Script >
On event Collision (with sarkophag), Script >
Physical Response ;
coll_once ++ ;
if (coll_once > 2)
{
coll_once = 2 ;
}
On actor Sarkophag :
on event DrawActor, Script >
if (coll_once == 1)
{
ChangeAnimation(your animation) ;
}
Posted:
Mon Feb 07, 2005 3:05 pm
by Fenrir
Thanky Ingsan, so very much!
I know you had your hopes up for the car, but alas there is none. If I ever get one, I'll send it to you. Any requests of model?