Gamestudio Links
Zorro Links
Newest Posts
Executing Trades on Next Bar Open
by Zheka. 06/20/24 14:26
Lapsa's very own thread
by rki. 06/19/24 11:27
A simple game ...
by VoroneTZ. 06/18/24 10:50
Face player all the time ...
by bbn1982. 06/18/24 10:25
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 1,194 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 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: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
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 | 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