Ally

Posted By: Dante101

Ally - 04/18/09 21:03

i need an ally in my game...how exactly(with detail) would i go about that, coding wise...
Posted By: Rasch

Re: Ally - 04/19/09 01:25

what is an ally?
Posted By: Anonymous

Re: Ally - 04/19/09 08:03

to ally[en] = sich verbünden[de]
Posted By: Rasch

Re: Ally - 04/19/09 09:15

oO
Dann ist die Frage ein wenig komisch gestellt..

What do you want exactly?
Posted By: the_clown

Re: Ally - 04/19/09 12:01

He wants an AI bot that doesn't fight against the player but against the player's enemies. A friendly bot.


Well, I'm not really good at ally AI but I think you have to code an AI bot (look up the several tutorials in the AUM or somewhere else). Then, where you tell him to attack the player, just tell him to attack all entities who are not in his team. A little more detailed:
You have just one action, for both the ally and the enemy. In this ation, you have a decision making function. Normally, somewhere in this function you say "if player is in sight, attack him". Now you say him "if entity with skill x != my skill x in sight, attack it".
So you have a skill defined that stores the team and that you set to different values.
It's very hard to explain this in english, it's not my first language.
Maybe some of the more experienced coders that are good at AI coding can explain it better. (I'd know some but I don't want to push them ;))
Posted By: Blink

Re: Ally - 04/19/09 20:11

that actually sounds like it could work. i think i will give it a try. i never thought about something so simple as that concept.i guess including a type of function that would make the "ally" entity follow you until he had an enemy in his sights, and then afterwards, start following you again, would make for a pretty cool ally a.i. good luck, guys.
Posted By: Blink

Re: Ally - 04/20/09 12:57

ok, so not as easy as i thought, lol. i still cant figure out how to get the entity to attack someone other than me, and he walks up to me, and stops me, instead of following.
Posted By: Dante101

Re: Ally - 04/20/09 23:26

lol thanx u guys...i will try what you guys have suggested ;-)
Posted By: badapple

Re: Ally - 04/21/09 04:42

i created a small demo that lets you choose between two armies "red and blue" and then they battle eternaly, of course they can be killed , then new ones are created. depending on the team you choose - red or blue - you can create that color player and join in the battle , or just watch as your allies and your enemies duke it out forever

hopefully this will help you a bit

get it here
Posted By: the_clown

Re: Ally - 04/21/09 15:28

Nice one, badapple! This is really impressive, you could make a whole game out of it... Well, probably not, but it is nice!
And I think it will help clearing the, in my opinion, hardest part, namely a way to let the enemy decide which of HIS enemies to attack.
Posted By: Blink

Re: Ally - 04/21/09 23:10

greeting Badapple, you know i am going to ask if you are going to convert this to A6? you always have great codes and models.
Posted By: badapple

Re: Ally - 04/22/09 01:39

i should be able to convert this to a6 without much problem, maybe in the next day or two , glad you like it smile
Posted By: AdrianX

Re: Ally - 04/22/09 07:22

this is such a great example, badapple! I was wondering if this can be applied on an FPS game; so instead of swordfights they'd be duking it out using guns. Regardless, this won't affect any template code if i were to add this on a template-driven game, right?
Posted By: badapple

Re: Ally - 04/22/09 09:41

i dont use the templetes , so i dont know if mixing them would affect templete code or not. and this could easily be changed to attack with guns, as a matter of fact when i convert this to a6 i was going to do that, but with 3rd person player not first
Posted By: AdrianX

Re: Ally - 04/22/09 12:02

Originally Posted By: badapple
when i convert this to a6 i was going to do that, but with 3rd person player not first


Perfect; makes me want to wait for this script more. smile
Posted By: Dante101

Re: Ally - 04/25/09 19:44

sounds great lol...i will wait for that script to...
Posted By: the_clown

Re: Ally - 04/26/09 18:11

Well, but if you now make the allies shoot in the A6 code and use swords in the A7 code, you will hear "oh, could you please translate that shooting allies into lite-c" and "oh, what about having this swordfighting allies in c-script".
Think about that, badapple... wink
Posted By: Blink

Re: Ally - 04/27/09 03:16

well, to be fair to the "whole" community, you do what you can to help all and not just some, thats the nature of a contribution. a member like badapple is always mindful of the A6 and A7 users. there are great contributers to this community that are willing to help all of us.
Posted By: the_clown

Re: Ally - 04/27/09 14:49

I know, Blink. I didn't mean that he should not also make a c-script version. I have no problem with that.
I only wanted him to be prepared on the requests for the shooting code in lite-c that will surely come.
I myself have no problem with transfering code from lite-c to c-script or the other way round.
Posted By: Blink

Re: Ally - 04/27/09 17:18

i understand, no disrespect intended on my part. i am the first in this forum to ask for a A7 contribution to be converted to A6, because there is a great part of our community that still use A6, and some that will never convert over. my reason is purely financial, lol. but i appreciate your response.

Blink
© 2024 lite-C Forums