|
2 registered members (Quad, AndrewAMD),
1,007
guests, and 6
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Collision box
#326111
05/30/10 14:10
05/30/10 14:10
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
Hey dudes, I want to make an door go open when an event is triggered. here is the code:
action door_me()
{
door = me;
}
action checker_me()
{
checker = me;
phent_settype(me,PH_RIGID, PH_BOX);
}
function door_opener()
{
var proz;
while(you == checker)
{
ent_animate(door,"auf",proz,0);
proz += 0.25*time_step;
c_setminmax(door);
wait(1);
}
}
action checker_act()
{
checker = me;
while(me)
{
c_scan(my.x, my.pan, vector(360,180,50), IGNORE_SPRITES | IGNORE_ME);
{
if(you == checker)
{
door_opener();
}
wait(1);
}
}
}
That works, but my problem is, when the two side of the door are going away from each other (open) the collision box is strange. I cant go trough them. I set Polygon, c_setminmax and all this but my player cant go trough the door. Here is a picture: Two sides were made in MED, first together, then i seperated them.
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Collision box
[Re: Progger]
#326115
05/30/10 14:28
05/30/10 14:28
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
Yes, maybe. But I want a smooth function that opens the door, nur just BAM and its open 
Last edited by TheLiam; 05/30/10 14:35.
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Collision box
[Re: Liamissimo]
#326116
05/30/10 14:30
05/30/10 14:30
|
Joined: Apr 2006
Posts: 737 Ottawa, Canada
Ottawa
User
|
User
Joined: Apr 2006
Posts: 737
Ottawa, Canada
|
Hi!
i noticed that you have
2 actions with checker = me;
There could be confusion in the code because of this.
Hope this helps! Ottawa  Ver 7.86.2 Pro and Lite-C
|
|
|
Re: Collision box
[Re: Ottawa]
#326120
05/30/10 14:41
05/30/10 14:41
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
Okay, now I can get trough it, but it is still too strange. Red = Passable Green = Solid 
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Collision box
[Re: Liamissimo]
#326134
05/30/10 16:37
05/30/10 16:37
|
Joined: Apr 2010
Posts: 265
Vinous_Beret
Member
|
Member
Joined: Apr 2010
Posts: 265
|
Hi!
i noticed that you have
2 actions with checker = me;
There could be confusion in the code because of this. that's true.
|
|
|
Re: Collision box
[Re: Vinous_Beret]
#326138
05/30/10 16:57
05/30/10 16:57
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
I already deleted it. That wasnt the problem. Now I use my ONE Model where the animations is splitting it into two different shapes. Now, in the middle isnt everything, but still with Polygon, A7 says there is a Bounding Box. 1.Picture = Beginning, all good 2.Picture = Without c_setminmax 3.Picture = With c_setminmax Picture:    Any way to remove this? Or any example for a good door? Code:
action door_me()
{
door = me;
}
action checker_me()
{
checker = me;
phent_settype(me,PH_RIGID, PH_BOX);
}
function door_opener()
{
var proz;
while(you == checker)
{
ent_animate(door,"auf",proz,0);
proz += 0.1*time_step;
c_setminmax(door);
wait(1);
}
}
action checker_act()
{
while(me)
{
c_scan(my.x, my.pan, vector(360,180,50), IGNORE_SPRITES | IGNORE_ME);
{
if(you == checker)
{
door_opener();
}
wait(1);
}
}
}
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
Re: Collision box
[Re: Liamissimo]
#326140
05/30/10 17:16
05/30/10 17:16
|
Joined: Apr 2010
Posts: 265
Vinous_Beret
Member
|
Member
Joined: Apr 2010
Posts: 265
|
I don't have a clue about what you'r trying to do,but i'll give you some advice: function door_opener() { var proz; while(you == checker) { ent_animate(door,"auf",proz,0); proz += 0.1*time_step; c_setminmax(door); wait(1); } } why using 'ent_animate' and 'c_setminmax()' it's rather slow" seting c_setminmax() every frame" and not really needed here,use tow separate models and move them using 'c_move' it's easier,and allot logical.
|
|
|
Re: Collision box
[Re: DLively]
#326157
05/30/10 19:29
05/30/10 19:29
|
Joined: Jul 2009
Posts: 1,198 Berlin, Germany
Liamissimo
OP
Serious User
|
OP
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
I dont want to use c_move  To... i don't know.. Okay, so I've splitted them into two pieces but still, it is terrible. Here is a picture: RED = SOLID GREEN = PASSABLE   Code:
action door_me()
{
door = me;
}
action door2_me()
{
door2 = me;
}
action checker_me()
{
checker = me;
phent_settype(me,PH_RIGID, PH_BOX);
}
function door_opener()
{
var proz = 0;
var proz2 = 0;
while(you == checker && proz < 100)
{
ent_animate(door,"auf",proz,0);
proz += 1*time_step;
c_setminmax(door);
ent_animate(door2,"auf",proz2,0);
proz2 += 1*time_step;
c_setminmax(door2);
wait(1);
}
}
action checker_act()
{
while(me)
{
c_scan(my.x, my.pan, vector(360,180,50), IGNORE_SPRITES | IGNORE_ME);
{
if(you == checker)
{
door_opener();
}
wait(1);
}
}
}
And when it starts, i get 4 errore in door_opener (Invalid arguments) 
"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen." -JCL, 2011
|
|
|
|