Forum

> > Carnage Contest > Some questions about AI vars etc
Forums overviewCarnage Contest overviewLog in to reply

English Some questions about AI vars etc

3 replies
To the start Previous 1 Next To the start

old Some questions about AI vars etc

DannyDeth
User Off Offline

Quote
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.

old Re: Some questions about AI vars etc

DannyDeth
User Off Offline

Quote
@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.
To the start Previous 1 Next To the start
Log in to replyCarnage Contest overviewForums overview