Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,619 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Rope Physics problem! #44032
04/09/05 13:29
04/09/05 13:29
Joined: May 2004
Posts: 66
Brazil
key_46 Offline OP
Junior Member
key_46  Offline OP
Junior Member

Joined: May 2004
Posts: 66
Brazil
i've been created a rope physics, works fine with the "Base" segment and the second, but after the segments are like this:



here is the code:

Code:
 


action AddSecondaryCable
{
my.tilt -= 90;

my.skill10 = your.skill10-1;

var OtherPos[3];
//
phent_settype(my,PH_RIGID,PH_CYLINDER);
phent_setmass(my,10,PH_BOX);
phent_setfriction(my,50);
phent_setgroup(my,2);
phent_setdamping(my,0,50);

my.skill2 = phcon_add(PH_BALL,my,0);
phcon_setparams1(my.skill2,my.x,nullvector,nullvector);

if(my.skill10 > 0)
{
vec_for_vertex(OtherPos,my,14); //The Rope Tail vertex
ent_create("Cable_Tick.mdl",OtherPos,AddSecondaryCable);
}

while(1)
{
phent_enable(my,0);
vec_for_vertex(my.x,you,14);
phent_enable(my,1);
phcon_setparams1(my.skill2,my.x,nullvector,nullvector);
wait(1);
}
}


action AddBaseCable
{
my.skill10 = your.skill1 - 1;


var OtherPos[3];

vec_for_vertex(OtherPos,my,14);
//
phent_settype(my,PH_RIGID,PH_CYLINDER);
phent_setmass(my,10,PH_BOX);
phent_setfriction(my,50);
phent_setgroup(my,2);
phent_setdamping(my,0,50);
//
my.skill2 = phcon_add(PH_BALL,my,0);
phcon_setparams1(my.skill2,my.x,nullvector,nullvector);
//
BaseSkill = my.skill10;
if(my.skill10 > 0)
{
ent_create("Cable_Tick.mdl",OtherPos,AddSecondaryCable);
}
}

//use Segments_1,Segments_2,Segments_3,Segments_4,Link_1,Link_2,Link_3,Link_4
action Cloth_Line_support
{
my.polygon = on;

var Point1[3];
var Point2[3];
var Point3[3];
var Point4[3];

var To1[3];
var To2[3];
var To3[3];
var To4[3];

vec_for_vertex(Point1,my,1);
vec_for_vertex(Point2,my,2);
vec_for_vertex(Point3,my,3);
vec_for_vertex(Point4,my,4);

if(my.Segments_1 > 0){ent_create("Cable_Tick.mdl",Point1,AddBaseCable);}

}





what is wrong?


ADPA Ataque Dos PĂ´neis Assassinos! Atack Of Killer Ponys! ADPA(R) all rights reserved
Re: Rope Physics problem! [Re: key_46] #44033
04/11/05 22:55
04/11/05 22:55
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
There might be a delay between calling ent_create and executing its action. Wait for a few frames before activating gravity or ent_create all segments in advance and then activate them all in the same frame.


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