Gamestudio Links
Zorro Links
Newest Posts
Bug in train mode, or it seem to me
by jcl. 09/22/26 14:47
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 09/22/26 12:21
Capital slider is not saving in Z12
by Petra. 09/22/26 06:49
Parent/child object
by VoroneTZ. 09/22/26 05:52
Zorro tutorial ideas?
by AndrewAMD. 09/21/26 14:50
Trades during a running bar
by Martin_HH. 09/21/26 12:03
Avoiding pop-up training parameter results
by Martin_HH. 09/16/26 21:31
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 1,567 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
lopezsergio07, mistery, lokkalyansamiti, rahulbuilds, speedx
19237 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 | 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