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.

Author
Message
sovr
14
Years of Service
User Offline
Joined: 2nd Jan 2010
Location: USA
Posted: 11th Apr 2010 05:07
Hello, I was wondering with dark ai how can you have it where two entities get close and start shooting each other. After a while the health of one of them will equal 0 and then die. The biggest problem I am having is what if/then statement should I have to tell the entities when to fight or not. Thank you very much for everyones help!

sov the game creator!
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th May 2010 18:20
Funnily enough I'm having a similar problem in that my entities will not fight.

AI enemies and friendlies should fight automatically once they can see each other.

You can normally see them 'squaring up' to each other when they get close enough but you can check what they are actually 'doing' using


You can then check that string to decide when your entity is "attacking":


Hope that helps!

Serge Adjo
17
Years of Service
User Offline
Joined: 3rd Aug 2006
Location:
Posted: 7th May 2010 22:36
@sovr Simply use 'AI Get Entity Can Fire ( Entity Number )'
try something like this:

the first line tell the program to shoot when the entity is aiming at its target, the second line decrease the life of the target...

also if you have many entities you may want to decrease the life of the entity that is shooted: you may use this command to know wich entity is shooted and wich isn't:
'AI Get Entity Target ID ( Entity Number, Target Index )'

-hope it helps, Serge.

GreenDixy
15
Years of Service
User Offline
Joined: 24th Jul 2008
Location: Toronto
Posted: 5th Jun 2010 04:59
Here is the code i was using for my attack but i am going to change it as the health goes down way to fast my guess is like the code above it needs a timer system



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

GreenDixy Productions http://GreenDixy.Com
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Jun 2010 10:51
Yes it needs a timer or it just causes an attack every other loop instead of every loop.

Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 11th Jun 2010 17:12
If I were you I wouldn't use DarkAI for anything other than the path finding.

You can get a "can see" result alot faster from a raycast between the character and the target than you can using the "AI get entity can see" command.

I want robotic legs.
Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 11th Jun 2010 17:13
If I were you I wouldn't use DarkAI for anything other than the path finding.

You can get a "can see" result alot faster from a raycast between the character and the target than you can using the "AI get entity can see" command. And the raycast will have actual collision with the level geometry, whereas the "AI get entity... " command will only do a none/mid/high detection,.

I want robotic legs.

Login to post a reply

Server time is: 2024-03-29 06:29:13
Your offset time is: 2024-03-29 06:29:13