Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, degenerate_762, AndrewAMD, ozgur), 774 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
i made enemy but he not have a gravity #303851
01/02/10 23:22
01/02/10 23:22
Joined: Aug 2004
Posts: 87
IDontLikeSoccer Offline OP
Junior Member
IDontLikeSoccer  Offline OP
Junior Member

Joined: Aug 2004
Posts: 87
Did someone can show me some example gravity code for my enemy script.
Thx!

Re: i made enemy but he not have a gravity [Re: IDontLikeSoccer] #304658
01/09/10 18:48
01/09/10 18:48
Joined: Jun 2009
Posts: 38
H
hungryhobo Offline
Newbie
hungryhobo  Offline
Newbie
H

Joined: Jun 2009
Posts: 38

using the physics engine

phent_settype(me, PH_RIGID, PH_SPHERE); //what kind of entity?
phent_setmass(me, 5, PH_SPHERE);
phent_setfriction(me, 100);
phent_setdamping(me, 40,40);
phent_setelasticity(me, 10, 10); //set elasticity

put this in the action for your entity. it sets all the physics stuff and of course you can play with the values.

then in your main function put

"ph_setgravity(vector(0,0,-380));"

should be good.

Re: i made enemy but he not have a gravity [Re: hungryhobo] #304665
01/09/10 20:01
01/09/10 20:01
Joined: Nov 2009
Posts: 43
Turkiye
M
Machera Offline
Newbie
Machera  Offline
Newbie
M

Joined: Nov 2009
Posts: 43
Turkiye
owww, as far as i know, we cant use physics for characters (like human enemy).
in your character action just write c_move expression. like
c_move(me,movement_vector,vector(0,0,-10*time_step),USE_BOX);

edit: this was c-script topic. i dont know c-script version


Last edited by Machera; 01/09/10 20:10.
Re: i made enemy but he not have a gravity [Re: Machera] #304743
01/10/10 16:16
01/10/10 16:16
Joined: Aug 2004
Posts: 87
IDontLikeSoccer Offline OP
Junior Member
IDontLikeSoccer  Offline OP
Junior Member

Joined: Aug 2004
Posts: 87
Thanks guys.

I add some code in my enemy but i have problem my enemy fall down verry fast:
Quote:
vec_set (temp, my.x);
temp.z -= 10000;
trace_mode = ignore_me + ignore_passable + use_box;
walk_speed.z = -trace (my.x, temp) * time; // i add *time for slowly falling
ent_move(walk_speed, nullvector);


How fix this?
Thx

Re: i made enemy but he not have a gravity [Re: IDontLikeSoccer] #304746
01/10/10 17:04
01/10/10 17:04
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
Read the posts in this thread:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=301933

Blackchuck had a similar problem. Here's how you fix it without using the physics half of the engine. Blackchuck was kind enough to write a Lite-C version of my fix as well, so anyone else with the same problem needs to see this post.


Eats commas for breakfast.

Play Barony: Cursed Edition!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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