Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
enemy vision #374033
06/14/11 22:24
06/14/11 22:24
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
I am a programmer working with the free version of A8
I am making an action game where the enemy is a "close ranged" monster.
I want the monster to wait around until it "sees" you, then it starts to move forward.
Does anyone know what I can do for vision?
I tried having it shoot out invisible balls
that start its movement but I had too many problems with it.
Thanks for the help, I really appreciate it.
Rtsgamer706

Re: enemy vision [Re: rtsgamer706] #374037
06/14/11 22:47
06/14/11 22:47
Joined: Feb 2010
Posts: 886
Random Offline
User
Random  Offline
User

Joined: Feb 2010
Posts: 886
Look at the workshops and the aum and try it again.
When you still didn`t make it, pm me your try and I will fix it for you wink



Re: enemy vision [Re: Random] #374040
06/14/11 23:22
06/14/11 23:22
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
try what again?
can you please just give me a suggestion?
I finished the workshops a year ago, they taught me nothing even remotely relating to this.
I'm sorry for getting irritated, but it's a personal pet-peeve when I ask for help and get "do the tutorials again" as a suggestion.
Rtsgamer706

Re: enemy vision [Re: rtsgamer706] #374041
06/14/11 23:29
06/14/11 23:29
Joined: Feb 2011
Posts: 135
Myrkling Offline
Member
Myrkling  Offline
Member

Joined: Feb 2011
Posts: 135
Have a look at c_trace().

Re: enemy vision [Re: Myrkling] #374075
06/15/11 11:19
06/15/11 11:19
Joined: May 2009
Posts: 5,365
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,365
Caucasus
Better use "c_scan" and when it found "you" make a trace from enemy to "you" entity is visible then start chasing. If you don't know how to do this youself, take a look at workshops first (AUM workshops as well).


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: enemy vision [Re: 3run] #374093
06/15/11 13:39
06/15/11 13:39
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
do you have a link to the AUM workshops?
thanks

Re: enemy vision [Re: rtsgamer706] #374098
06/15/11 14:10
06/15/11 14:10
Joined: Jan 2011
Posts: 122
GUILIN , CHINA
tzw Offline
Member
tzw  Offline
Member

Joined: Jan 2011
Posts: 122
GUILIN , CHINA
my codes work fine. maybe help you.
Code:
int see_player(var view_angle,var view_range )
{
	VECTOR temp;
	vec_set(temp,me.x);
	if ((c_scan(temp.x, my.pan, vector(view_angle, 0, view_range), IGNORE_ME | SCAN_FLAG2) > 0) && (you == player))
{
		if (c_trace(my.x, player.x, IGNORE_ME | IGNORE_PASSABLE) > 0)
	{
			return 1;
		}
	}
	else 
	{
		return 0;
	}
}





if you just wanna enm see "player" only , you can just use c_trace combine some..
vec_XXX functions.
it will let game run a bit faster than combine c_trace & c_scan

Last edited by tzw; 06/15/11 14:14.

Full of my eyes are class struggles.....
Re: enemy vision [Re: tzw] #374106
06/15/11 15:00
06/15/11 15:00
Joined: Dec 2009
Posts: 361
R
rtsgamer706 Offline OP
Senior Member
rtsgamer706  Offline OP
Senior Member
R

Joined: Dec 2009
Posts: 361
Thanks so much for the code, there's just one issue.
In your c_trace there are a couple of variables that I don't have.
What do I change them to?
Thanks

Re: enemy vision [Re: rtsgamer706] #374109
06/15/11 15:22
06/15/11 15:22
Joined: Jan 2011
Posts: 122
GUILIN , CHINA
tzw Offline
Member
tzw  Offline
Member

Joined: Jan 2011
Posts: 122
GUILIN , CHINA
you mean¡­¡­which?
let me explain it.
firts of all. let the enm scan the player. if can scan it. but at the moment enm doesn't excatly "see" the player(for example the player hide back a wall which in front of the enm).
so,we use c_trace to test if there are some entities between the two guys

Last edited by tzw; 06/15/11 15:31.

Full of my eyes are class struggles.....

Moderated by  HeelX, Spirit 

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