Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, bigsmack, 7th_zorro, dr_panther), 1,364 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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 | 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