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,449 guests, and 6 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
Grappling Hook? #34719
10/10/04 00:29
10/10/04 00:29
Joined: Nov 2002
Posts: 1,342
WizRealm Offline OP
Expert
WizRealm  Offline OP
Expert

Joined: Nov 2002
Posts: 1,342
I'm trying to create a grappling hook for my physic player (a ball) and I'm stuck..

Code:
 
//Customize tags

//Section: Controls
//Entry: Move Right Key Code
Var Move_Right=77;
//Entry: Move Left Key Code
Var Move_Left=75;
//Entry: Shoot Spike Key Code
Var Shoot_Spike=29;
//End-----------

action actplayer
{
var hingeID;
phent_settype(my, ph_rigid, ph_sphere);
phent_setmass(my, 1, ph_sphere);
phent_setelasticity(my, 61, 0);
phent_setfriction (my, 6);
my.skill1=my.y;
my.skill2=my.pan;
my.skill3=my.roll;
my.skill4=my.tilt;

while(1)
{
my.y=my.skill1;
my.pan=my.skill2;
my.roll=my.skill3;
my.tilt=my.skill4;

if(key_pressed(Move_Left))
{
phent_addforcelocal(my,vector(-50,0,0),nullvector);
}

if(key_pressed(Move_Right))
{
phent_addforcelocal(my,vector(50,0,0),nullvector);
}

if(key_pressed(Shoot_Spike))
{
var axis[3]=1,0,1;
var anchor[3];
//Get ceiling height
temp=trace(my.x,vector(my.x,my.y,my.z+10));
vec_set(anchor,target.x);
//--------------------
hingeID=phcon_add(PH_HINGE,my,0);
phcon_setparams1(hingeID,anchor,axis,nullvector);
}

wait(1);
}
}



This is for my gameinaday entry so I need help soon... The player will move correcty until I try to use the "grappling hook" ability.. any ideas?

A6 Com 6.30.0

Re: Grappling Hook? [Re: WizRealm] #34720
10/10/04 05:12
10/10/04 05:12
Joined: Aug 2001
Posts: 2,320
Alberta, Canada
William Offline
Expert
William  Offline
Expert

Joined: Aug 2001
Posts: 2,320
Alberta, Canada
You cannot directly set x,y,z,pan,tilt,roll to an entity set in the physics engine. If you want to change these paremeters, you would have to temporary disable the entity from the physics engine, then re-enable it once your done. Example:

phent_enable (my,0); //temporary disable
vec_set(my.x, temp.x);
my.tilt += 180;
my.pan += 180;
phent_enable (my,1); //enable


Check out Silas. www.kartsilas.com

Hear my band Finding Fire - www.myspace.com/findingfire

Daily dev updates - http://kartsilas.blogspot.com/
Re: Grappling Hook? [Re: William] #34721
10/10/04 05:26
10/10/04 05:26
Joined: Nov 2002
Posts: 1,342
WizRealm Offline OP
Expert
WizRealm  Offline OP
Expert

Joined: Nov 2002
Posts: 1,342
Edit: ( Nevermind )

Thanks for the help

Last edited by WizRealm; 10/10/04 05:27.

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