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
2 registered members (RealSerious3D, rvl), 1,187 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Need help #98555
11/12/06 23:05
11/12/06 23:05
Joined: Aug 2006
Posts: 68
A
alex5801 Offline OP
Junior Member
alex5801  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 68
i button Q to swap charater in the game, but how ocme when i press q no effect?
Code:
  
ACTION attach_weapon {
player_weapon = my;
my.passable = on;
proc_late();
WHILE (you != null) {
vec_for_vertex(temp.x,you,1175); //hand palm base
vec_for_vertex(temp2.x,you,1240); //hand palm tip
vec_set(my.x,temp.x);
vec_diff(temp.x,temp2.x,temp.x);
vec_to_angle(temp.pan,temp.x);
vec_set(my.pan,temp.pan);
wait(1);
}
}

action player2_action{
player2 = me;
player1 = you;
ent_create("sword.mdl",my.x,attach_weapon);
my.gravity = 3;
my.z_offset = 6;
player1 = me;
player2=you;
my.shadow = on;
ent_create("sword.mdl",my.x,attach_weapon);



if(key_q==1)
{

ent_morph(me,char1);
ent_morph (you,char2);


}


wait(1);
WHILE (1) {

handle_player2_gravity();
handle_player2_movement();
handle_camera();
handle_player2_animation(1);
wait(1);
}
}



ACTION player1_action
{
my.gravity = 3;
my.z_offset = 6;
player1 = me;
player2=you;
my.shadow = on;
ent_create("sword.mdl",my.x,attach_weapon);



if(key_q==1)
{

ent_morph (me, char2);
ent_morph (you,char1);


}

wait(1);
WHILE (1) {

handle_player1_gravity();
handle_player1_movement();
handle_camera();
handle_player1_animation(1);
wait(1);
}
}




Re: Need help [Re: alex5801] #98556
11/13/06 20:35
11/13/06 20:35
Joined: Dec 2005
Posts: 252
MyOwnKingdom
nipx Offline
Member
nipx  Offline
Member

Joined: Dec 2005
Posts: 252
MyOwnKingdom
Quote:




if(key_q==1)
{

ent_morph (me, char2);
ent_morph (you,char1);


}




Because of that you placed wrong.

When you do it like that you check if(key_q==1) when the player was created but no more during the game.

insert it in your while(1) loop or use

Code:

function fMorpg_ent //morph
{
ent_morph (me, char2);
ent_morph (you,char1);
}
on_q = fMorph_ent;




Im just wondering that you dont get more errors

You use player2=you; ..... often but is you not an empty pointer? Dont know what you scripted else IMO you should get a few errors "empty pointer you".
Tell me if im wrong

nipx

Re: Need help [Re: nipx] #98557
11/15/06 19:50
11/15/06 19:50
Joined: Aug 2006
Posts: 68
A
alex5801 Offline OP
Junior Member
alex5801  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 68
ooo thx, it is working .
i trying point you to my 2nd character in the level, it it seems only the first character can switch but the second no effect?

Re: Need help [Re: alex5801] #98558
11/15/06 22:13
11/15/06 22:13
Joined: Dec 2005
Posts: 252
MyOwnKingdom
nipx Offline
Member
nipx  Offline
Member

Joined: Dec 2005
Posts: 252
MyOwnKingdom
Thats what I said

You use Code:
ent_morph (you,char1);  



but IMO you is an empty pointer... (not absolutely sure )

try not:

Code:

player1=me;
player2=you;




try this:

Code:
 
action player1_action
{
player1=me; //no player2=you; !! You do that in the action for player2
.....
.....
.....
.....
}

action player2_action
{
player2=me; //no player1=you; !! You do that in the action for player1
....
....
....
....
}

function fMorph
{
ent_morph (player1, char1); //morph player1
ent_morph (player2,char2); //morph player2
}

on_q = fMorph;




I didtn test it but should work.


nipx


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