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 / How can I get my allies to not shoot me and eachother and to shoot the enemies?

Author
Message
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 4th Feb 2003 01:58
I now know how to get them to follow me, but how can I get them to not shoot me or eachother and to shoot the opponents? Thanks!

P.S. I know there is a simple way to do this.. But I need help with making the code accurate and correct.
AlamDV, NHL, NHL 2K3....... The best combination ever!
Dr DooMer
21
Years of Service
User Offline
Joined: 22nd Dec 2002
Location: United Kingdom
Posted: 4th Feb 2003 02:45
Check back to your old post - I've put up another of my long-winded wisdom snippets; perhaps it'll help.

"I am a living, thinking entity who was created in the sea of information."
Arrow
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 5th Feb 2003 03:07
How about a simple if/then statment. Set up a varrable on all the guys with the sole purpose of determining alinment.

alinvar = 1 means it's an ally
alinvar = 2 means it's an enemy
alinvar = 3 means it's a civian

Have your allies only attack guys with alinvar = 2

Am I a butterfly dreaming I'm a man?
Or a bowling ball dreaming I'm a plate of samishi?
Never assume that what you see or feel is real.
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 5th Feb 2003 03:16
Ok, I understand that. But I am not very good at creating my own codes.. SO can you please tell me how to set up the code for doing the alinvar thing.. It most likely wont be something like what I'm thinking of:

if alinvar=2 then play animation x

and that code would make the ally get in his shooting animation.. and then for the muzzle flash I'd do

load image "muzzle.bmp","7"

and that would load the muzzle shot where I would then position it to where it should be and I'd lock it.. Then would come:

make object sphere 2,1
position object x,y,z (or whatever! )
blah blah

And then I'd have the ally shooting at the person with the alinvar equaling 2, and that would make the bullet and it'd load the animation for the guy when he is shooting. Would it go like something like that?

If not, please tell me different! Thanks!

AlamDV, NHL, NHL 2K3....... The best combination ever!
Arrow
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 5th Feb 2003 03:27
Yeah, basicly, but you might want to add a bit of detail, like checking if the enemy is not hiding behind civains or if the enemy can even be shot. For that part it's best to follow Doc DooMer posts on your other thread.

Am I a butterfly dreaming I'm a man?
Or a bowling ball dreaming I'm a plate of samishi?
Never assume that what you see or feel is real.
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 5th Feb 2003 04:07
So would something like this give me a sufficient working thing that I need?



Would that work to get what I need? And then where the ect ect blah blah is I add in the other things I need for the bullet and stuff? thanks

AlamDV, NHL, NHL 2K3....... The best combination ever!
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 5th Feb 2003 04:09
Oh how much do I wish we could edit posts...

But by that code I mean it should check to see if there is the enemy, which it would look for the model of the character, is less than 300 units away. And if it is, then it will play the animation of the ally getting his gun ready.. And if that person has an attribute alinvar=2 then he will shoot... And the bullet is the shpere and all.. Would that work, or is the searching for the enemy thing a little screwed up, like i think?

AlamDV, NHL, NHL 2K3....... The best combination ever!
Arrow
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 5th Feb 2003 04:38
Basiclly. I once played this game called "Carnage Heart" were the plot was to build and program robots to battle. If you can get your hands on it, it'll help out a bit (but it's rare!!!). In other words you gotta figure out what needs to be done for yourself. After a few time trying it out, you should see if something isn't right.

Am I a butterfly dreaming I'm a man?
Or a bowling ball dreaming I'm a plate of samishi?
Never assume that what you see or feel is real.
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 5th Feb 2003 04:51
Well I am just preparing for me to get DarkBasic, as I dont have it yet and my demo of both DarkBasic and DarkBasic Pro ran out! :-( Thanks for you help anyways. Guess I'll just have to beg my dad to get it, or i wont be making games any more for half a year.

AlamDV, NHL, NHL 2K3....... The best combination ever!
CarlTaylor
21
Years of Service
User Offline
Joined: 13th Jan 2003
Location: United States
Posted: 5th Feb 2003 08:38
What id suggest for avoiding them hitting you is have the comp draw an invisible line from their gun to the place theyre aiming, and if it collides with anything besides an enemy along the way, they dont shoot. i dont know if this has been mentioned on another post, i havent looked for it, but thats my suggestion.

baseball = life
Hockey07
21
Years of Service
User Offline
Joined: 18th Dec 2002
Location: United States
Posted: 5th Feb 2003 14:26
Ok, thanks to everyone who's helped me.

AlamDV, NHL, NHL 2K3....... The best combination ever!

Login to post a reply

Server time is: 2024-11-23 23:55:37
Your offset time is: 2024-11-23 23:55:37