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
is that posible #96597
10/30/06 15:05
10/30/06 15:05
Joined: Aug 2006
Posts: 68
A
alex5801 Offline OP
Junior Member
alex5801  Offline OP
Junior Member
A

Joined: Aug 2006
Posts: 68
is it possible to program a game that allow user to switch player as in the game level, for example the 2nd character follow 1st character as a dummy and user can switch to use the 2nd character?

if yes, how can it be made?

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 Offline
Expert
Xarthor  Offline
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
A
alex5801 Offline OP
Junior Member
alex5801  Offline OP
Junior Member
A

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?


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