Forum

> > Carnage Contest > Some questions about AI vars etc
ForenübersichtCarnage Contest-ÜbersichtEinloggen, um zu antworten

Englisch Some questions about AI vars etc

3 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Some questions about AI vars etc

DannyDeth
User Off Offline

Zitieren
Hi, I just have some questions about variables that i could use to edit the AI.lua file. I wanted to know whether there was an array or something that contained the x,y coordinates of the players, so that you could find an appropriate direction to go ( rather than the random movement, which sends many AI players into the drink ). I also figured that i could maybe use the "getwatery", which I am currently playing around with now, to stop the players from walking into the water.

alt Re: Some questions about AI vars etc

DannyDeth
User Off Offline

Zitieren
@Vectar666:

No i ahve not seen your Zombie Ai, but I'm gonna go check it out now

@DC:

Thanks for that, my mind is refreshend
I used this code to stop the AI from walking into water:
1
2
3
4
5
6
7
8
previouspos = getplayery(0)
if ( getplayery(0) == getwatery(0) +32 ) then
	goleft()
	if getplayery(0) < previouspos then
		goright()
	else
		goleft()
end

But i guess the collisions woud work better, like just scan the entire terrain, and determin which of the pixels are an obstacle or just air.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenCarnage Contest-ÜbersichtForenübersicht