Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/06/23 11:29
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
7 registered members (fairtrader, Quad, miwok, Martin_HH, AndrewAMD, alibaba, dpn), 581 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
when an enemy die near the walls #284321
08/12/09 19:09
08/12/09 19:09
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline OP
Member
Erick_Castro  Offline OP
Member
E

Joined: Mar 2009
Posts: 207
I would like to know if is it possible when my enemy die and run de frames of "death" and it is near the wall , dont stay incrusted in the wall.

thanks

Re: when an enemy die near the walls [Re: Erick_Castro] #284380
08/13/09 06:23
08/13/09 06:23

C
chris_oat
Unregistered
chris_oat
Unregistered
C



u can check out AUM 40. Deadly Spiders, there is a code wen the spiders hit the wall they turn around. if that is wat u need.
btw. do u have the Pro version?

Re: when an enemy die near the walls [Re: ] #284394
08/13/09 08:07
08/13/09 08:07
Joined: Nov 2008
Posts: 946
T
the_clown Offline
User
the_clown  Offline
User
T

Joined: Nov 2008
Posts: 946
He's talking about the clipping errors when models look like they're stuck in walls I think.
One way to stop that are ragdolls; another way, much easier but not perfect would be to activate the NEAR / ZNEAR flag.

Re: when an enemy die near the walls [Re: the_clown] #284458
08/13/09 12:57
08/13/09 12:57
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline OP
Member
Erick_Castro  Offline OP
Member
E

Joined: Mar 2009
Posts: 207
I dont have any idea about to use znear

I wrote it in that cycle


while (death_percentage < 100) {
my.znear=ON;
ent_animate(my, "death", death_percentage, null); death_percentage += 3 * time;
my.passable = on;
wait (1);
}

But i can look the dead enemy from every where of my game. It looks trough walls and ignores every wall.

Re: when an enemy die near the walls [Re: Erick_Castro] #284463
08/13/09 13:04
08/13/09 13:04
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline OP
Member
Erick_Castro  Offline OP
Member
E

Joined: Mar 2009
Posts: 207
The clown, what is to use "ragdolls"?

Re: when an enemy die near the walls [Re: Erick_Castro] #284471
08/13/09 13:16
08/13/09 13:16
Joined: Jul 2009
Posts: 150
B
Blackchuck Offline
Member
Blackchuck  Offline
Member
B

Joined: Jul 2009
Posts: 150
Wright everithing in Lite c and make this to your main script:


__________________________________________________________________________________

#include <acknex.h>
#include <default.c>

//make your bodyparts
#define PRAGMA_PATH "bodyparts";

VECTOR Hinge1, Hinge2;

var GroupID = 2;
var low_rot_dist = 5;

function DEAD();
//function damage();

void updateBoneHinge(ENTITY* hingeEnt, STRING* bodyPart, ENTITY* actor) {
VECTOR temp_pos, temp_ang, temp_mov, temp_ang_1;

ENTITY* hingePointer = hingeEnt;
ENTITY* actorPointer = actor;
STRING* updatePart = bodyPart;

while(hingePointer) {

ent_bonereset(actorPointer, updatePart);

vec_for_bone(temp_pos, actorPointer, updatePart);
ang_for_bone(temp_ang, actorPointer, updatePart);

vec_set(temp_mov, hingePointer.x);
vec_sub(temp_mov, temp_pos);

temp_mov.x /= actorPointer.scale_x; temp_mov.y /= actorPointer.scale_y; temp_mov.z /= actorPointer.scale_z;
//vec_rotateback (temp_mov, temp_ang);
temp_ang.x = 360-temp_ang.x; temp_ang.y = 360-temp_ang.y; temp_ang.z = 360-temp_ang.z;

vec_set(temp_ang_1, nullvector);
ang_add(temp_ang_1, vector(temp_ang.x,0,0));
ang_add(temp_ang_1, vector(0,temp_ang.y,0));
ang_add(temp_ang_1, vector(0,0,temp_ang.z));

ang_rotate(temp_ang_1, hingePointer.pan);
ent_bonerotate(you, updatePart, temp_ang_1);
// ent_bonemove(you, updatePart, temp_mov);

wait(1);
}
}

void setLimit(VECTOR* vec1, VECTOR* vec2) {
vec_set(Hinge1, vec1);
vec_set(Hinge2, vec2);
}

void BodyPartInit(var mass, ENTITY* entityMe) {
set(entityMe, PASSABLE);

entityMe.pan = 180;

phent_settype(entityMe, PH_RIGID, PH_BOX);
phent_setmass(entityMe, mass, PH_BOX);

phent_setgroup(entityMe, GroupID);
phent_setfriction(entityMe, 35);
phent_setdamping(entityMe, 35, 35);
phent_setelasticity(entityMe, 8, 8);

reset(entityMe, PASSABLE);
}

void setHinge(ENTITY* constr_1, ENTITY* constr_2) {
var tempHinge;

// make constraint
tempHinge = phcon_add(PH_HINGE, constr_1, constr_2);
phcon_setparams1(tempHinge, constr_1.x, Hinge1, nullvector);
phcon_setparams2(tempHinge, Hinge2, nullvector, nullvector);
}

void setRagdollPart() {
set(my, INVISIBLE);
}

function DEAD() {
ENTITY* Ent_1;
ENTITY* Ent_2;
ENTITY* Ent_3;

GroupID += 1;

var tempVertex;

you = ent_create("test_ragdoll.mdl", nullvector, NULL);
set(you, PASSABLE);

Ent_1 = my;
setRagdollPart();
BodyPartInit(20, Ent_1);
setHinge(Ent_1, Ent_1);

vec_for_vertex(tempVertex, Ent_1, 23);
Ent_2 = ent_create("leg_up_left.mdl", tempVertex, setRagdollPart);
setLimit(vector(1,1,1), vector(-40,40,0));
BodyPartInit(5, Ent_2);
// make constraint
setHinge(Ent_2, Ent_1);
updateBoneHinge(Ent_2, "leg_up_left", you);

// left lower leg
vec_for_vertex(tempVertex, Ent_2, 9);
Ent_3 = ent_create("leg_down_left.mdl", tempVertex, setRagdollPart);
setLimit(vector(0,1,0), vector(0,120,0));
BodyPartInit(20, Ent_3);
// make constraint
setHinge(Ent_3, Ent_2);
updateBoneHinge(Ent_3, "leg_down_left", you);

// right upper leg
vec_for_vertex(tempVertex, Ent_1, 22);
Ent_2 = ent_create("leg_up_right.mdl", tempVertex, setRagdollPart);
setLimit(vector(1,1,1), vector(-40,40,0));
BodyPartInit(5, Ent_2);
// make constraint
setHinge(Ent_2, Ent_1);
updateBoneHinge(Ent_2, "leg_up_right", you);

// right lower leg
vec_for_vertex(tempVertex, Ent_2, 9);
Ent_3 = ent_create("leg_down_right.mdl", tempVertex, setRagdollPart);
setLimit(vector(0,1,0), vector(0,120,0));
BodyPartInit(20, Ent_3);
// make constraint
setHinge(Ent_3, Ent_2);
updateBoneHinge(Ent_3, "leg_down_right", you);

// abs
vec_for_vertex(tempVertex, Ent_1, 21);
Ent_2 = ent_create("abs.mdl", tempVertex, setRagdollPart);
setLimit(vector(1,1,0), vector(-15,15,0));
BodyPartInit(20, Ent_2);
// make constraint
setHinge(Ent_2, Ent_1);
updateBoneHinge(Ent_2, "stomach", you);

//torso
vec_for_vertex(tempVertex, Ent_2, 17);
Ent_1 = ent_create("torso.mdl", tempVertex, setRagdollPart);
setLimit(vector(1,1,0), vector(-20,20,0));
BodyPartInit(55, Ent_1);
// make constraint
setHinge(Ent_1, Ent_2);
updateBoneHinge(Ent_1, "torso", you);

// left upper arm
vec_for_vertex(tempVertex, Ent_1, 21);
Ent_2 = ent_create("arm_up_left.mdl", tempVertex, setRagdollPart);
setLimit(vector(1,1,1), vector(-70, 116,20));
BodyPartInit(5, Ent_2);
// make constraint
setHinge(Ent_2, Ent_1);
updateBoneHinge(Ent_2, "arm_up_left", you);

// left lower arm
vec_for_vertex(tempVertex, Ent_2, 9);
Ent_3 = ent_create("arm_down_left.mdl", tempVertex, setRagdollPart);
setLimit(vector(1,1,0), vector(270,0,0));
BodyPartInit(20, Ent_3);
// make constraint
setHinge(Ent_3, Ent_2);
updateBoneHinge(Ent_3, "arm_down_left", you);

// right upper arm
vec_for_vertex(tempVertex, Ent_1, 22);
Ent_2 = ent_create("arm_up_right.mdl", tempVertex, setRagdollPart);
setLimit(vector(1,1,1), vector(-70,116,20));
BodyPartInit(5, Ent_2);
// make constraint
setHinge(Ent_2, Ent_1);
updateBoneHinge(Ent_2, "arm_up_right", you);

// right lower arm
vec_for_vertex(tempVertex, Ent_2, 9);
Ent_3 = ent_create("arm_down_right.mdl", tempVertex, setRagdollPart);
setLimit(vector(1,1,0), vector(270,0,0));
BodyPartInit(20, Ent_3);
// make constraint
setHinge(Ent_3, Ent_2);
updateBoneHinge(Ent_3, "arm_down_right", you);

// head
vec_for_vertex(tempVertex, Ent_1, 23);
Ent_2 = ent_create("head.mdl", tempVertex, setRagdollPart);
setLimit(vector(1,1,0), vector(-45,45,0));
BodyPartInit(25, Ent_2);
// make constraint
setHinge(Ent_2, Ent_1);
updateBoneHinge(Ent_2, "head", you);

while(you) {
vec_set(you.x, my.x);
vec_set(you.pan, my.pan);

if(key_p) {
phent_addvelglobal(my, vector(1000,1000,1000), nullvector);
}

wait(1);
}
}

void main() {
vec_set(Hinge1, nullvector);
vec_set(Hinge2, nullvector);

fps_max = 60;

time_smooth = 0;
ph_iterations = 20;

level_load("test_level.wmb");
wait(5);

ph_setgravity(vector(0, 0, -1200));
ph_setcorrections(9000, 0);
ph_setcollisions(1000, 2);
wait(1);
}

action ragdoll()
{
//Your actor code
//then:
wait (1);
my.event = DEAD();
}

________________________________________________________________________________


And here ist your Ragdoll script.

PS: make yourself bodypices...

Last edited by Blackchuck; 08/13/09 13:17.

I have know Gamestudio/A7 Commercial Edition 7.84
Re: when an enemy die near the walls [Re: Blackchuck] #284480
08/13/09 14:10
08/13/09 14:10
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline OP
Member
Erick_Castro  Offline OP
Member
E

Joined: Mar 2009
Posts: 207
Thak you , Blackchuk, but...uffffffffffffffffffffff
it is very very advanced. I will have to study more.

Thanks

Re: when an enemy die near the walls [Re: Erick_Castro] #285008
08/16/09 16:10
08/16/09 16:10
Joined: Jul 2009
Posts: 150
B
Blackchuck Offline
Member
Blackchuck  Offline
Member
B

Joined: Jul 2009
Posts: 150
hihihihi lol!

no problem...


I have know Gamestudio/A7 Commercial Edition 7.84
Re: when an enemy die near the walls [Re: Erick_Castro] #285816
08/20/09 11:03
08/20/09 11:03
Joined: Jul 2009
Posts: 150
B
Blackchuck Offline
Member
Blackchuck  Offline
Member
B

Joined: Jul 2009
Posts: 150
I have a questin, were do you (or how) studey 3dgs?
I must lern everithing by my self.
I whant to studey it to!!!


I have know Gamestudio/A7 Commercial Edition 7.84
Re: when an enemy die near the walls [Re: Blackchuck] #285843
08/20/09 16:13
08/20/09 16:13
Joined: Mar 2009
Posts: 207
E
Erick_Castro Offline OP
Member
Erick_Castro  Offline OP
Member
E

Joined: Mar 2009
Posts: 207
By my self too, my friend! laugh

Page 1 of 2 1 2

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