Gamestudio Links
Zorro Links
Newest Posts
WFO Training with parallel cores Zorro64
by Martin_HH. 02/24/26 19:51
Zorro version 3.0 prerelease!
by TipmyPip. 02/24/26 17:09
ZorroGPT
by TipmyPip. 02/23/26 21:52
Camera always moves upwards?
by clonman. 02/21/26 09:29
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 02/19/26 13:22
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
4 registered members (Martin_HH, TipmyPip, AndrewAMD, Grant), 5,825 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
alx, ApprenticeInMuc, PatrickH90, USER0328, Sfrdragon
19199 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Collision box [Re: Liamissimo] #326175
05/30/10 21:52
05/30/10 21:52
Joined: Apr 2010
Posts: 265
V
Vinous_Beret Offline
Member
Vinous_Beret  Offline
Member
V

Joined: Apr 2010
Posts: 265
hi man,as i told you before make tow separated models as doors and attach them this actions:
Click to reveal..
action door1_act()
{
while(!player){wait(1);}
var box_move=0;
while(1)
{
if(vec_dist(me.x,player.x)<150 && box_move<500)
{
box_move+=10;
c_move(me,vector(0,-20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
if(vec_dist(me.x,player.x)>150 && box_move>0)
{
box_move-=10;
c_move(me,vector(0,20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
wait(1);
}
}
action door2_act()
{
while(!player){wait(1);}
var box_move=0;
while(1)
{
if(vec_dist(me.x,player.x)<200 && box_move<500)
{
box_move+=10;
c_move(me,vector(0,20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
if(vec_dist(me.x,player.x)>200 && box_move>0)
{
box_move-=10;
c_move(me,vector(0,-20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
wait(1);
}
}


Re: Collision box [Re: Vinous_Beret] #326270
05/31/10 13:17
05/31/10 13:17
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
action door1_act()
{
while(!ball){wait(1);}
var box_move=0;
while(1)
{
if(vec_dist(me.x,player.x)<150 && box_move<500)
{
box_move+=10;
c_move(me,vector(0,-20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
if(vec_dist(me.x,player.x)>150 && box_move>0)
{
box_move-=10;
c_move(me,vector(0,20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
wait(1);
}
}
action door2_act()
{
while(!ball){wait(1);}
var box_move=0;
while(1)
{
if(vec_dist(me.x,player.x)<200 && box_move<500)
{
box_move+=10;
c_move(me,vector(0,20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
if(vec_dist(me.x,player.x)>200 && box_move>0)
{
box_move-=10;
c_move(me,vector(0,-20*time_step,0),nullvector,GLIDE | IGNORE_PASSABLE);
}
wait(1);
}
}

Like this it crashes, changed player to ball because my player is the ball tongue
And when I started first time, nothing happended... But I'll try it, thakns!


"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] #326278
05/31/10 13:35
05/31/10 13:35
Joined: Apr 2010
Posts: 265
V
Vinous_Beret Offline
Member
Vinous_Beret  Offline
Member
V

Joined: Apr 2010
Posts: 265
of course it will crashes.
Quote:
if(vec_dist(me.x,player.x)<150 && box_move<500)

don't forget change word(player)to (ball) in you'r script.
or simply keep it like this and put in you'r ball's action:
player=me.

Re: Collision box [Re: Vinous_Beret] #326303
05/31/10 14:56
05/31/10 14:56
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
Thanks Guy, thought I can be clever enough to now use c:move but sometimes if you are too clever you become like a NOOB. Like I was tongue

Okay thanks, works of course


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

Moderated by  HeelX, Spirit 

Gamestudio download | 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