2 registered members (RealSerious3D, rvl),
1,187
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: is that posible
[Re: alex5801]
#96598
10/30/06 15:38
10/30/06 15:38
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
yes it is possible. You could use a state_skill, a skill which represents the status of the entity. Example: if its control by player the state_skill is 1, if not its 0
Now in the entities while loop you have to check which state is set and if the player controls it, set the cam to it + move it by a move vector which is set via the control keys. (basic movement) If it is not controlled by the player, you could two things: a) just turn towards the player and run b) use pathfinding to get near the player
Another possiblity would be, if the player changes from character A to B: -remove player_a, remove computer_b -create computer_a, create player_b
You could also implement "orders" so the player could decide if the other character should follow or hold his position.
Last edited by Thunder; 10/30/06 15:40.
|
|
|
Re: is that posible
[Re: Xarthor]
#96599
10/30/06 18:18
10/30/06 18:18
|
Joined: Aug 2006
Posts: 68
alex5801
OP
Junior Member
|
OP
Junior Member
Joined: Aug 2006
Posts: 68
|
okei.... so i need to define state skill at begining player1.state_skill=1 and for example if "q" is press player1.state_skill=0 and Player2.state_skill= 1 ------------------------------------------------------------------------------ entity* computer; var vec[3]=0,0,0;
action player_action{ my.gravity = 3; my.z_offset = 6; player = my; ent_create("player2.mdl", you.x, computer_player); ent_create("player1.mdl", my.x,);
if(key_q==1){ if(player1.state_skill=1 && Player2.state_skill= 0) { function player_selection{ ent_remove (my); my = ent_add ("player2.mdl", my.x); ent_remove(you); you = ent_add ("player1.mdl",you.x); } else if(player1.state_skill=0 && Player2.state_skill= 1) { function player_selection{ ent_remove (my); my = ent_add ("player1.mdl", my.x); ent_remove(you); you = ent_add ("player2.mdl",you.x); } } wait(1); WHILE (1) { handle_gravity(); handle_movement(); handle_camera(); handle_animation(1); wait(1); } action computer_player{ computer = me while (computer !=NULL) { me.vec[0] = you.vec[0]-60; me.vec[1] = you.vec[0]-60; if(key_g ==1){ me.vec[0] = you.vec[0]+60; me.vec[1] = you.vec[0]+60; } if(key_b==1){ me.vec[0] = you.vec[0]-60; me.vec[1] = you.vec[0]-60; }
}
------------------------------------------------------------------------------
and i use a invisible box in WED to fix the starting location for the player? by the way do u know any tutorial that can learn about the order the 2nd character to follow player to attack same anemy, attack nearest enemy or even pick up item?
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|