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.

Newcomers DBPro Corner / Dark AI: enemies life variables

Author
Message
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 2nd Mar 2009 22:14 Edited at: 2nd Mar 2009 22:17
I spend the whole weekend trying to figure out how to make working life variables to the enemies of my game.
Im using Dark Ai, and i do have two teams (not really importment), each teams is made of "multiple ententies/enemies".
Everything is working great exept that when one enemy dies all other enemies in the team dies too. This is caused sence "i" represent all members in the team, but i dont know what to write instead to make just one enemy die (hide object) when it get hit.







object 11 is the bullet

Hello!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 2nd Mar 2009 23:10
try this.



Dark Physics makes any hot drink go cold.
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 3rd Mar 2009 12:43
Thank you for such a fast anwer!

That code is working exept enemy entity "dies" and is hidden after just one hit. And sence...

..the zero could bee any object all objects that collide the bullet (object 11) "dies" and is hidden. I think it should be something more like this

to specify the enemy objects (25 & 26) but nothing is changed, still everything that colllide the bullet will get hidden.

Hello!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 4th Mar 2009 12:25
The value that gets put into killed it what object 11 hit, you then make some code that say if killed=i(Entity) is hit then dec enehealth for entity i.

Dark Physics makes any hot drink go cold.
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 4th Mar 2009 22:00
Oki thanx! i try that out

Hello!
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 10th Mar 2009 00:50 Edited at: 10th Mar 2009 00:55
Hi again HowDo!

Im still working for a solution and im almost done, i hope. Now i each enemy object can get killed and they will die if enehealth = 0 (enemies healthbar). But only one enemie can die, cause there seems to be only one healthbar!




Do you know a way to make one healthbar per each enemy? Cause now when first enemy is dead the otherone wont die.


Hello!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 10th Mar 2009 14:00
do something like this.

dim enehealth(number_of_enemy)

then use like this



Dark Physics makes any hot drink go cold.
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 12th Mar 2009 12:07
Oki thanx again HowDo!

Now i first have to learn Dim and arrays, try that out once i done =)

Hello!
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 12th Mar 2009 22:49 Edited at: 12th Mar 2009 22:52
Finally its all solved(atleast this problem), i was findng usefool advices in the multiple array tutorial of Steve Vink (newsletter april 2005).
A very big hug to HowDo for taking time helping me solving this problem!
I learned a lot.

Hello!
HowDo
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th Mar 2009 23:34
Your welcome, You'll be learning all the time you are doing this it never stops.

Dark Physics makes any hot drink go cold.
Gamer Making
18
Years of Service
User Offline
Joined: 20th Sep 2006
Location: sitting at the comp programming
Posted: 13th Mar 2009 02:18
Hmmm, btw hows the game your making going by so far? I might be able to help if you run into more trouble

Bach Tran
SAAB Driver
19
Years of Service
User Offline
Joined: 1st Nov 2005
Location:
Posted: 14th Mar 2009 01:08
Great, thank you Gamer Making.
Right now im working on a top-down shooter. Theres a lot more stuff to do so i really appreciate all help i can get.
Like HowDo said "it never stops."

Hello!

Login to post a reply

Server time is: 2024-11-16 04:17:11
Your offset time is: 2024-11-16 04:17:11