Gamestudio Links
Zorro Links
Newest Posts
MRC.c and WFO
by joe_kane. 01/10/26 23:58
BarOffset (default = 940 for daily bars?
by joe_kane. 01/10/26 23:46
NOMAX undeclared identifier.
by Petra. 01/09/26 21:12
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 01/07/26 15:14
Zorro locks DLL
by jcl. 01/07/26 13:33
zorro with ccxt?
by qin. 01/07/26 07:50
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (joe_kane, 1 invisible), 5,557 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
joe_kane, Namitha_NN, Syndrela, agasior, mosfet
19189 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
2 problem #99127
11/18/06 08:05
11/18/06 08:05
Joined: Aug 2006
Posts: 68
A
alex5801 Offline OP
Junior Member
alex5801  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 68
Code:
 
action player2_action{
player2 = me;
player2_weapon=ent_create("uzi.mdl",my.x,attach_weapon_char2);
my.gravity = 3;
my.z_offset = 6;
my.shadow = on;
wait(1);
while (1)
{
if(state==1){
ent_remove(player2_weapon);
player2_weapon=ent_create("sword.mdl",my.x,attach_weapon_char1);
handle_char1_gravity();
// handle_char1_movement();
// handle_camera();
handle_char1_animation(1);


}
else{
if(state==0){
ent_remove(player2_weapon);
player2_weapon=ent_create("uzi.mdl",my.x,attach_weapon_char2);
handle_char2_gravity();
// handle_char2_movement();
// handle_camera();
handle_char2_animation(1);

}
}
if( state==0)
{
ent_morph (player1, char2); //morph player1
ent_morph (player2,char1); //morph player2
state=1;
}
else{
if(state==1)
{
ent_morph (player1, char1); //morph player1
ent_morph (player2,char2); //morph player2
state=0;
}
}
}
on_q = fMorph();


this code i use to change weapon when Q is press.
but when Q is press an error came out that ent_remove(player2_weapon) is an invalid argument.
can anyone help me with it?
what i want is to swap char and weapon when Q is press.

second question is how can i make weapon attach to my second char hand with the below code? cause it only not work with one of my character
Code:

ACTION attach_weapon_char2 {
my.passable = on;
while(you)
{
vec_for_vertex(my.x,you,12);
vec_for_vertex(hand_pos.x,you,10);
finger
temp.x = hand_pos.x - MY.X;
temp.y = hand_pos.y - MY.Y;
temp.z = hand_pos.z - MY.Z;
result = vec_to_angle(my_angle,temp);
my.pan = my_angle.pan;
my.tilt = my_angle.tilt;
my.roll = my_angle.roll;
wait(1);
}



Re: 2 problem [Re: alex5801] #99128
11/18/06 09:48
11/18/06 09:48
Joined: Sep 2003
Posts: 931
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 931
The first problem, maybe "uzi.mdl" was not found? Then player2_weapon is NULL and you get that error. Try:

if (player2_weapon) { ent_remove(player2_weapon); }

Your second problem, maybe the other character has different hand vertex numbers than 12 and 10?

Re: 2 problem [Re: Spirit] #99129
11/18/06 12:40
11/18/06 12:40
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline

Expert
aztec  Offline

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
I agree with spirit I think the second Problem is that the vertex are not the same

EDIT:
GOT YOUR FIRST PROBLEM

you got to define the entity put this before the code
Code:
 entity* player2_weapon; 



Last edited by aztec; 11/18/06 12:41.

Visit:
schwenkschuster-design.de
Re: 2 problem [Re: aztec] #99130
11/19/06 06:07
11/19/06 06:07
Joined: Aug 2006
Posts: 68
A
alex5801 Offline OP
Junior Member
alex5801  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 68
but how come so much different between the weapon location between 2 character. one fix propelly at palm but the other on the face?
and the one on the palm follow the direction of the character but the other one just folow the location without chaning the direction?


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