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
3 registered members (RealSerious3D, rvl, tomaslolo), 685 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
squik, AemStones, LucasJoshua, Baklazhan, Hanky27
19060 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
enemies chase player and ladder ? #79587
06/26/06 15:53
06/26/06 15:53
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
Does anyone know the scrpt just to make an enemy chase a player everytime he is near ?

Also does anyone know a good working ladder code, I tried doing search here but somehow none of the ladder codes given worked on my game, does anyone know a working one ?
I am planning in my game for the player to climb a wall.

thanks in advance.

Last edited by tek; 06/26/06 15:54.
Re: enemies chase player and ladder ? [Re: tek] #79588
06/27/06 17:07
06/27/06 17:07
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline
Senior Member
Roel  Offline
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
I got the chasing code:


var reaction_distance = 200;
action enemy
{
while(me)//while I exist in the level
{
//check for the player
if(player)
{
//turn to the player
vec_set(temp.x,player.x)
vec_sub(temp.x,my.x);
vec_to_angle(my.pan,temp.x);
if(vec_dist(my.x,player.x) < reaction_distance)
{
ent_move(vector(5,0,0),vector(0,0,-3)
}
}
wait(1);
}
}

I haven't tested it but, it should work


Check out the throwing game here: The throwing game
Re: enemies chase player and ladder ? [Re: Roel] #79589
06/28/06 00:00
06/28/06 00:00
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
Thanks alot Roel I am sure it works the only thing is it gave me a couple of errors one I fixed, the other I am not sure whats wrong,
the first was just it needed a semicolon the other one is this.

var reaction_distance = 200;
action enemy
{
while(me)//while I exist in the level
{
//check for the player
if(player)
{
//turn to the player
vec_set(temp.x,player.x);
vec_sub(temp.x,my.x);
vec_to_angle(my.pan,temp.x);
if(vec_dist(my.x,player.x) < reaction_distance)
{
ent_move(vector(5,0,0),vector(0,0,-3)
}
}
wait(1);
}
}

the error says

Quote:

< ent_move(vector(5,0,0),vector(0,0,-3) }>
MYNEWGAME.WDL 90:-1 Error(6): script error last line
.
error in script

engine shutdown




I am not sure how to fix this.

Last edited by tek; 06/28/06 00:03.
Re: enemies chase player and ladder ? [Re: tek] #79590
06/28/06 15:31
06/28/06 15:31
Joined: Aug 2005
Posts: 199
houston
S
seneca Offline
Member
seneca  Offline
Member
S

Joined: Aug 2005
Posts: 199
houston
add ";" to the end of ent_move,

ent_move(vector(5,0,0),vector(0,0,-3);


a8 commercial
Re: enemies chase player and ladder ? [Re: seneca] #79591
06/28/06 15:43
06/28/06 15:43
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
I tried that before it only gives me another error.

Quote:

< ent_move(vector(5,0,0),vector(0,0,-3)>
MYNEWGAME.WDL 179:0 Error(270): Syntax error--number of brackets
.
Error in script

Engine shutdown




Last edited by tek; 06/28/06 15:53.
Re: enemies chase player and ladder ? [Re: tek] #79592
06/28/06 16:09
06/28/06 16:09
Joined: Aug 2005
Posts: 199
houston
S
seneca Offline
Member
seneca  Offline
Member
S

Joined: Aug 2005
Posts: 199
houston
ent_move(vector(5,0,0),vector(0,0,-3));

sorry i didn't catch that before

add a ")" just before the ";" and after the last ")". check above


a8 commercial
Re: enemies chase player and ladder ? [Re: seneca] #79593
06/28/06 16:20
06/28/06 16:20
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
yes that worked thanks

Re: enemies chase player and ladder ? [Re: tek] #79594
06/29/06 02:35
06/29/06 02:35
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
Thanks to you guys the code worked )
I have done so many thinsg in my game.
This is the picture of the bats in my underground pyramid cave level.



and here are the bats following me and when I shoot it they disappear.




I know i'm pushing it, but I want my game to have everything I want to make a super game I am sorry for keep asking advice.
I would like to know how to make a entity appear for 5 seconds and dissapear for 5 seconds like in megaman.

The entity platform is on top of a lava pit (which I already made)so I must jump from platform to platform, the danger is the platform that I jump on must appear and disappear and then appear again and dissapear and keep on (like 5 seconds its there and 5 seconds it disappear and vice versa) making it harder for me to get to the other side
that's my ingenius plan.

Does anyone know how to do this, i tried coding this myself with everything I learned (ent_morph, functions etc etc) but I couldnt get the job done.
any help would be greatly appreciated.
What I did was something like this.
my.passable=on;
my.invisible=off;
sleep(5);
my.event=entity_dissapear;

then in the function entity_dissapear
something like
my.passable=off;
my.invisible=on;

but the code keep giving me errors and I don't believe I am even close to accomplishing what I have in mind. i am trying to learn and thank you for all u guys help because I gotten so far.
Does anyone know how I can do this ?

Last edited by tek; 06/29/06 02:43.
Re: enemies chase player and ladder ? [Re: tek] #79595
06/29/06 12:01
06/29/06 12:01
Joined: May 2005
Posts: 338
Brasil
Filipe Offline
Senior Member
Filipe  Offline
Senior Member

Joined: May 2005
Posts: 338
Brasil
you can do something like

action disappearing_platform
{
while(me)
{
my.passable=(my.passable== off);
my.invisible=(my.invisible== off);
sleep(5);
}
}

but this could cause a problem if the platform turns non-passable when another entity (like the player) is at the platform's position. the entity would get stuck in the platform until it turns passable again.

Re: enemies chase player and ladder ? [Re: Filipe] #79596
06/29/06 14:48
06/29/06 14:48
Joined: May 2005
Posts: 222
T
tek Offline OP
Member
tek  Offline OP
Member
T

Joined: May 2005
Posts: 222
yes it does cause a problem I tried the code but wed would not allow it.


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