Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Collision box #326111
05/30/10 14:10
05/30/10 14:10
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

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:

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: Liamissimo] #326114
05/30/10 14:28
05/30/10 14:28
Joined: Sep 2009
Posts: 496
P
Progger Offline
Senior Member
Progger  Offline
Senior Member
P

Joined: Sep 2009
Posts: 496
why not doing two models and use c_move and Polygon flag?
I think that is easier laugh
MFG PRogger laugh


asking is the best Way to get help laugh laugh laugh
Re: Collision box [Re: Progger] #326115
05/30/10 14:28
05/30/10 14:28
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

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 tongue

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
O
Ottawa Offline
User
Ottawa  Offline
User
O

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 laugh

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
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

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
V
Vinous_Beret Offline
Member
Vinous_Beret  Offline
Member
V

Joined: Apr 2010
Posts: 265
Quote:
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
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

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:
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
V
Vinous_Beret Offline
Member
Vinous_Beret  Offline
Member
V

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:
Quote:
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: Vinous_Beret] #326153
05/30/10 18:45
05/30/10 18:45
Joined: Apr 2005
Posts: 1,988
Canadian, Eh
DLively Offline
Serious User
DLively  Offline
Serious User

Joined: Apr 2005
Posts: 1,988
Canadian, Eh
you should ent_create 2 different models, instead of animating the original.


A8 Pro 8.45.4
YouTube: Create Games For Free
Free Resources: www.CGForFree.com
Re: Collision box [Re: DLively] #326157
05/30/10 19:29
05/30/10 19:29
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline OP
Serious User
Liamissimo  Offline OP
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
I dont want to use c_move laugh 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:
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) wink


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1