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
4 registered members (NewbieZorro, Grant, TipmyPip, AndrewAMD), 13,346 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
Why? Oo #174173
12/21/07 10:53
12/21/07 10:53
Joined: Jun 2007
Posts: 63
Italy
Sonic220 Offline OP
Junior Member
Sonic220  Offline OP
Junior Member

Joined: Jun 2007
Posts: 63
Italy
I'm becoming crazy, I'm stop here trying to fix this from one week.
So, I'm here to ask you help, cause I think that what I've done mustn't work like this.
Code:
action moveplayer
{
my.enable_entity=on;
my.event = Touch_me;
player = me;
my.push=1;
my.polygon=on;
ready_to_play = 0;
while (my.z > 100) /cutescene
{
my.x += 8 * time;
my.z -= 5 * time;
if (my.z > 220)
{
vec_set(temp, my.x);
vec_sub(temp, camera.x);
vec_to_angle(camera.pan, temp);
}
else {
camera.x = my.x - 100;
camera.z = my.z + 20;
camera.y = my.y;
vec_to_angle(camera.tilt, temp);
}
wait (1);
}
// Now start the game
playershoot();
while (1)
{ c_move (my, nullvector, vector(5, 0, 0), glide);
camera.x = my.x + 120;
camera.z = my.z + 500;
camera.tilt = -90;
camera.roll = 0;
ready_to_play = 1;

// move the ship

if (key_cul == on && my.y < 210) // press and hold the "Up" arrow key to move
{
c_move (my, nullvector, vector(0, 5, 0), glide);
if (my.roll < 30)
{
my.roll += 3 * time;
}
}
if (key_cur == on && my.y > -210) // press and hold the "Down" arrow key
{
c_move (my, nullvector, vector(0, -5, 0), glide);
if (my.roll > -30)
{
my.roll -= 3 * time;
}
}
wait (1);
}
}


Tha's the action of the player, ok, this work fine, the problem is with the enemy.
Code:

action enemy {
my.push=1;
my.polygon=on;
while(ready_to_play == 1)
{
my.z = player.z;
if(my.x <= (player.x + 330)){
c_move(me,nullvector,vector(-2,0,0), glide);
}
wait(1);
}
}


All of this doesn't work, i really don't know why,
Create a while loop after the cutescene, then,
if the player is close to the enemy 330(x), the enemy start moveing.
enemy.z = player.z (this piece is important, why it doesn't work?)

Thx all for help


~Vision Divine~
Re: Why? Oo [Re: Sonic220] #174174
12/21/07 10:58
12/21/07 10:58
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
I am not exactly sure what you mean, but maybe try vec_dist...

Code:

action enemy {
my.push=1;
my.polygon=on;
while(ready_to_play == 1)
{
if (vec_dist(my.x, player.x) <= 330) {
c_move(me,nullvector,vector(-2,0,0), glide);
}
wait(1);
}
}



Not tested, though.

Thanks,
Adoado


Visit our development blog: http://yellloh.com
Re: Why? Oo [Re: adoado] #174175
12/21/07 16:05
12/21/07 16:05
Joined: Jun 2007
Posts: 63
Italy
Sonic220 Offline OP
Junior Member
Sonic220  Offline OP
Junior Member

Joined: Jun 2007
Posts: 63
Italy
It doesn't work
All the code that I write in the action doesn't work.
Y____Y


~Vision Divine~

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