Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / AI enemies attack function

Author
Message
MightyRy
8
Years of Service
User Offline
Joined: 19th Oct 2010
Location:
Posted: 6th Dec 2010 20:33
At the moment i have loaded the enemy ai



and i have added ai to player in a make player function which is called before the do loop



i have created a funtion called enemeies() which will be called in main do loop. but have struggled getting ai to work.

and have tried following the zone tutorial and a few others.

All i want is once the player (2) walks in the radius of the enemy, is the enemy to follow and fire.

any help would be great thanks
GreenDixy
10
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 7th Dec 2010 12:38 Edited at: 7th Dec 2010 12:39
here is my setup lines a bit messy i think still got to readjust but it still does work



======================================

GreenDixy Productions http://GreenDixy.Com
MightyRy
8
Years of Service
User Offline
Joined: 19th Oct 2010
Location:
Posted: 7th Dec 2010 13:01 Edited at: 7th Dec 2010 13:03
Thanks for helping but i want to use a function for the enemies

i have decided to stick with the enemy defending zones

i have since added this to load the enemies.



and in a function





ai has been added to the player as before and global dim shootTimer(3) as float has been defined at the top of the programme.

but the enemy ai are not repsonding.
GreenDixy
10
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 7th Dec 2010 14:04
sorry i cant be more of help on this subject im still getting use to it all also since i switched from fpsc

======================================

GreenDixy Productions http://GreenDixy.Com
HowDo
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 7th Dec 2010 16:26
this might be a little quicker when loading. it only loads the object once and then copies it each time you make another one. then delete the first one at the end.



Dark Physics makes any hot drink go cold.
MightyRy
8
Years of Service
User Offline
Joined: 19th Oct 2010
Location:
Posted: 8th Dec 2010 13:11
Cheers guys, i have sorted this out before. im only having a problem with the function part now. The 3rd code snippet of my second post!
MightyRy
8
Years of Service
User Offline
Joined: 19th Oct 2010
Location:
Posted: 8th Dec 2010 18:37 Edited at: 8th Dec 2010 18:38


This is my function so far when i run it i get this error

array does not exist or array subscript out of bounds at this line 602 which is the line with the arrow heads next to it.

what does this mean?
HowDo
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 8th Dec 2010 23:03
one of your varables needs to be global as the function does not know it's value so it thinks its zero which makes the error .

Dark Physics makes any hot drink go cold.
MightyRy
8
Years of Service
User Offline
Joined: 19th Oct 2010
Location:
Posted: 9th Dec 2010 00:44
i have the following global variables

global dim shootTimer(3) as float
global speed#
global currtime#
global lasttime#
HowDo
16
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 9th Dec 2010 10:03 Edited at: 9th Dec 2010 10:05
where are the other 496 dim slots? you.ve dim four but at the end where it goes wrong it starts on 501 that hasn't been dim-ed yet.

either change the way you use e, or up the dim value to 530.

global dim shootTimer(3) as float

for e = 501 to 530

Dark Physics makes any hot drink go cold.
MightyRy
8
Years of Service
User Offline
Joined: 19th Oct 2010
Location:
Posted: 15th Dec 2010 16:21 Edited at: 15th Dec 2010 17:08
Thanks for the help howdo!

I want to add collision, so the enemy ai cant collide with the map.

The map is a .dbo and all one object.

do you know how i would add collision?

Login to post a reply

Server time is: 2019-06-17 09:35:19
Your offset time is: 2019-06-17 09:35:19