Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,618 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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