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
3 registered members (AndrewAMD, juanex, Grant), 1,018 guests, and 8 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
c_rotate #102442
12/17/06 15:53
12/17/06 15:53
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
I don't understand how this works:
the manual states:
Returns:
>0 - Rotation successful.
0 - Entity was blocked by obstacles and could not be rotated.

and;
Gliding along walls is always activated. Otherwise the entity could easily become stuck on rotation.

So, c_rotate can never return zero when blocked, or am I wrong?


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: c_rotate [Re: Frits] #102443
12/18/06 10:19
12/18/06 10:19
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
Imagine your object is inside a small triangle-shaped room, touching the corners. Then it can't rotate no matter how much it glides.

Re: c_rotate [Re: jcl] #102444
12/18/06 11:26
12/18/06 11:26
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Yes, I understand that, but when I try to rotate a door with c_rotate and the player is blocking the door it will not stop rotating, the return value will never become zero.
When I use 'USE_AABB', it has no collision detection. The door will always rotate.
When I use 'USE_AXIS', the door rotates and move itself to a new position when it is blocked.
So, why is it not possible to stop rotation when blocked?

I tryed this with;
result=c_rotate (me, vector(-2*time_step,0,0),null);
if(result==0) {break;}
but this didn't work, because result gets never zero.


I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits
Re: c_rotate [Re: Frits] #102445
12/18/06 12:05
12/18/06 12:05
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
I suppose when you rotate a door with c_rotate and a player is in the way, the door will still rotate but glide out of its hinges. Thus you won't get a zero. c_rotate is not meant to be used for a door and to stop at an obstacle.

I haven't programmed c_rotate, so I'm not sure about my above assumptions, but I'll look into it. Maybe we can implement a flag for c_rotate in a future version so that it stops at an obstacle, rather than gliding.

Re: c_rotate [Re: jcl] #102446
12/18/06 14:46
12/18/06 14:46
Joined: Mar 2006
Posts: 724
the Netherlands
Frits Offline OP
User
Frits  Offline OP
User

Joined: Mar 2006
Posts: 724
the Netherlands
Would be a nice solution, then you can use c_rotate for other objects too.
Thanks.

Last edited by Frits; 12/18/06 14:46.

I like to keep scripting simple, life is hard enough as it is.
Regards,
Frits

Moderated by  old_bill, Tobias 

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