Page 2 of 2

Re: Enemy soldier scripting

Posted: Mon Mar 03, 2008 3:28 am
by timster0
I'm looking for this too. Trying everything. I'll post if I get something working.

Re: Enemy soldier scripting

Posted: Wed Mar 05, 2008 7:05 am
by dylanwinn
I want the simplest script possible that:

1) Can detect if the player is running or shooting, then determine the distance to the AI and cause AI to react if the player is too close

2) When the AI reacts to the player, it monitors its life. If its life is less than 75%, it finds cover/hides, if its life is less than 50%, it runs away/gets backup

3) Gets backup if it finds more than one other AI dead

4) Does everything the default AI does

Can this be done simply?

Re: Enemy soldier scripting

Posted: Wed Mar 05, 2008 11:21 am
by vrageprogrammer
bernie wrote:If you use perfectai script Next Order would be FindPointOrder;
Look for something similar in genericai.

Pointsetup maybe?

Personally I would always use perfectai because it covers all situations much better than genericai. It's much easier to adapt to your own needs I think.
Nope, it's setup.
I used setup, and it worked fine.

Bernie, I think paradox picked something up from your sig.
LOL

Re: Enemy soldier scripting

Posted: Thu Mar 06, 2008 1:49 am
by darksmaster923
dylanwinn wrote:I want the simplest script possible that:

1) Can detect if the player is running or shooting, then determine the distance to the AI and cause AI to react if the player is too close

2) When the AI reacts to the player, it monitors its life. If its life is less than 75%, it finds cover/hides, if its life is less than 50%, it runs away/gets backup

3) Gets backup if it finds more than one other AI dead

4) Does everything the default AI does

Can this be done simply?
it can be done. it depends on the amount of experience you have.
1) Yeah use this variable self.player_range

2) well you have to use script points for this. in your level add retreating and cover paths then set them when var life is below 75 etc

3) you have to use GetAttribute command to get the health of other allies. if theyre less than 1 make it follow retreat scriptpoint

4) just add those to the default ai

Re: Enemy soldier scripting

Posted: Thu Mar 06, 2008 7:58 pm
by incenseman2003
All the suggestions that have been posted are good ones but they are things that I have already tried.

It doesnt matter to me what script that I use. I am only interested in getting the pawn to patrol and then shoot at the player when the pawn sees the player. I have been banging my head and pulling my hair trying to get it to work. Thanks for the efforts.

Is there anyone that could post an html tut on the subject? I don't have internet at home right now so I can't DL any archive files. I have to use a public terminal and write down what I need.

Re: Enemy soldier scripting

Posted: Fri Mar 07, 2008 1:16 pm
by vrageprogrammer
Gimme your model, I'll make a level, add the pawn, and set things up for you.

Re: Enemy soldier scripting

Posted: Wed Mar 12, 2008 9:50 pm
by incenseman2003
vrageprogrammer wrote:Gimme your model, I'll make a level, add the pawn, and set things up for you.
Thanks for the offer vrageprogrammer. I simply used the virgil model. You should have that already. As I said before. I do not have a way to DL anything right now. I am using a coffee house terminal to access the net. I hope to have access at home soon though.

An html tut would be sooo much more helpfull. That way I could print it off and pay the per page fee and then take it home and follow it. Other people would be able to use it to.

There is an example level where the robots are following a path and the object is to get past them without being seen.

I have set my pawn and script points up using the example level as a template. Im not sure if another example will help me.

If there were detailed instructions however, that might make a difference.

I really appreciate all the help that you all have offered.

Re: Enemy soldier scripting

Posted: Fri Mar 14, 2008 2:00 pm
by vrageprogrammer
k, one HTML tut coming up~

Re: Enemy soldier scripting

Posted: Tue Mar 18, 2008 7:07 pm
by incenseman2003
I finally did get my pawn to patrol and then attack the player when the player is seen. The key was indeed using the perfectai.s.

The other scripts that I was using just didnt cut the muster it seems.

Thanks for all the really great input.