Page 2 of 2

Posted: Tue Apr 18, 2006 3:51 am
by Green Beret
Well, I think it reacts the same in the stock SP maps my guys was never to fast at following me.

Or tighten the distance maybe?
jv_map wrote: $guy movedonedist 200 // maybe tweak

Posted: Tue Apr 18, 2006 5:40 am
by lizardkid
when they leapfrog like that, i think it's a hardcoded check in the AI that the area they're trying to move to is unoccupied, and yet they clump on top of each other at the end of a move, the only reason i think this is because they would do the EXACT same things in my SecondSquad thing, leapfrog, and then all clump on hte same spot. i had to manually script a randomized movement command... which SUCKED.
there's really no way around it other then to make them move different places, as far as i know.

you know... in hindsight like a 100line script implementing only chained runto's for each type of friendly would be so much easier than how they did it in friendly.scr... so clunky.

Posted: Tue Apr 18, 2006 6:47 am
by Broadus
I'm now able to see why there were hardly any teammates in Allied Assault. I desperately wanted to use your SecondSquad scripts, lizardkid, but I couldn't quite figure them out.
You're definitely right about the "leapfrogging". I didn't care about how they all gathered on the same spot, I just couldn't stand how far behind they would be, leaving the player to fend for himself against big groups of super-health enemies.
It turns out my biggest problem had been that the medic wanted to be closer than all of the other teammates, so he would move first. This would mean that the completely useless teammate (aside from healing) would be the first AI to jump into the fray.

So, my remaining questions are...

I can't script my own AI, so all I have to work with is the seemingly useless friendly.scr. I'm thinking of using the far superior Breakthrough friendly.scr. I say that because the problems I'm having on Allied Assault never came up in Breakthrough (though I couldn't get medics to work in Breakthrough, either).
The friendly.scr in Breakthrough might end up having the same following-the-player problems. Is there a way to get rid of all that "check your intervals" crap so they all move at the same time? I'm pretty sure the "leapfrogging" is meant to be realistic, but it's terribly inefficient in this particular game.

My previous question on the medic still stands. What are the many script things I can use to specify when a medic will heal others, and when/how many times he'll heal himself? I can't find anything anywhere that actually goes into detail about everything AI use to think, especially the rarely-used medic.
He's active on one level in Spearhead (I don't know if he uses friendly.scr), two levels in Allied Assault (they use friendly.scr), and in one level of Breakthrough for about ten feet, doing almost no healing at all (he's given his own script).

Posted: Tue Apr 18, 2006 11:44 am
by lizardkid
ya i didn't exactly design the SecondSquad scripts well... they're about as confusing as the stock ones (hmm) atm. i'll probably try and fix them up to be simpler, more mapping-oriented, right now they're sorta clunky.

of course that was about a year ago.

i'll dig it up.

as for your question, the BT script is probably much improved, since TKO ended up doing BT. although i don't have BT installed atm so i can't check. if i were you i'd work with that at least until something better works out.

Posted: Tue Apr 18, 2006 2:56 pm
by Broadus
Oh. Well, I'll try out the BT friendly.scr, since it's much more "global" than AA's.
As for the medic... Well, anyone know about the medic's scripts that I could change?
I looked at the friendly.scr and it apparently uses some sort of "percentage" system, but this can be pretty bad because the medic will allow a guy with, say, 300 health walk around, but he'll fully heal a guy with 200 health. This means that the guy with 300 health may not be healed in time if he gets into a fight and loses all 300 of his health because the medic wouldn't heal him beforehand.

Posted: Tue Apr 18, 2006 10:56 pm
by Broadus
Turns out using the Breakthrough friendly.scr didn't work on Allied Assault. It just broke all of the originally placed allies, and the ones I placed didn't act right. I guess I'm stuck with what I've got.

I still can't figure out the interval movement and the medic specs. Interval movement isn't so terrible, but the medic is driving me insane!

Posted: Wed Apr 19, 2006 9:21 am
by bdbodger
I think you would be better off designing your own medic logic script so to speak . It might take a little while but the medic would do what you wanted him to do .

Posted: Wed Apr 19, 2006 4:19 pm
by Broadus
Well, my only problem with the medic is that he will never heal himself, or any allies that I place. He will heal allies that I didn't place, however, such as the allies on the first and second levels.
I found this thing in the friendly.scr that I think may be the problem.
level.friendly[local.i].waittime = 0.2
level.friendly[local.i].noticescale = 1
level.friendly[local.i].area = -1
level.friendly[local.i].mins = -5
level.friendly[local.i].maxs = 40
level.friendly[local.i].friendtype = 0
level.friendly[local.i].distance = 250
// level.friendly[local.i].destination = $player
level.friendly[local.i].destinationset = 10
level.friendly[local.i].destinationnum = 10


if (level.friendly[local.i].fnum == 1)
level.friendly1 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 2)
level.friendly2 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 3)
level.friendly3 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 4)
level.friendly4 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 5)
level.friendly5 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 6)
level.friendly6 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 7)
level.friendly7 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 8)
level.friendly8 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 9)
level.friendly9 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 10)
level.friendly10 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 11)
level.friendly11 = level.friendly[local.i]

if (level.friendly[local.i].fnum == 12)
level.friendly12 = level.friendly[local.i]

level.friendly[local.i] thread friendlydeath

if (getcvar(medic) == "1")
level.friendly[local.i] thread soondie
What's all this, then? Doesn't level.friendy[local.i] mean allies placed in Radiant or something like that?
Here's another occurence of the friendly[local.i] nonsense, but with obvious references to the medic and healing.
if (self.friendtype == 5)
{
if (level.time > self.lasthealed)
{
self.lasthealed = level.time + level.medictime


waitthread heal $player
for (local.i=1;local.i<level.friendlys+1;local.i++)
if (level.friendly[local.i] != self)
waitthread heal level.friendly[local.i]

if ((self.health * 100) / self.maxhealth < 40)
waitthread canteen
}
All of the allies I place are called "FFally#", # being the number of the custom-placed ally, going in order. The medic is then called "FFmedic". I'm going to see if I can't get my FFallies to be considered level.friendly[local.i]s, when I get on the right computer.

EDIT

Wow. That didn't work at all. Whatever level.friendly[local.i] is, it's not something you can just make an ally to have them get healed by a medic. Could someone help me with this? I think I'm getting near the solution, but I still can't get the medic to heal the allies I place.
Like I said, he'll still heal allies placed by the original creators (the friendly1 - friendly12 up there) and he'll heal the player, but he doesn't consider himself or any of the other allies I place to be applicable patients.

Posted: Thu Apr 20, 2006 1:22 am
by lizardkid
i think medics only heal allies whose targetnames at the beginning of the map are named "friendly##", they're placed in an array like that and he checks them routinely, but not himself.

Posted: Thu Apr 20, 2006 10:38 pm
by Broadus
Hold up, I fixed it!

On one part of the friendly.scr, it says "waitthread heal $player" so I just added "waitthread heal $FFmedic" and "waitthread heal $FFally#" so the medic finally healed everyone! Even himself!
That's it for the following allies department, too! To fix the allies aiming through solid objects, I set their hearing to zero (so they had to see an enemy before they decided to try and fight it). So, hooray! I couldn't have done it without all you guys helping me out! Thanks!

And look at this, Lizardkid! I got your squad script to work! It's incredible. And very well-made, too!

Here's some of my custom-placed allies getting ordered to move somewhere... Grillo and the Medic aren't a part of the squad because Grillo moves by himself and the Medic already follows teammates.
http://img489.imageshack.us/img489/2325 ... tion15.jpg
Here's the part where the player frees a POW that gets added into the squad once he picks up his sniper rifle. Man, that was easy.
http://img213.imageshack.us/img213/5287 ... tion26.jpg

I love it, I love it! It's nice to finally be able to charge behind the troops, rather than having them lag behind me. It's even better to be able to see their health. It's kind of weird how they keep looking at where there used to be a suppressing fire command, but I set their field of vision to 360 so that they could see in all directions.

Posted: Fri Apr 21, 2006 3:21 am
by lizardkid
thanks, you're the first person besides me to actually use it, glad it works like you wanted :)

i'm still not sure why they look at the same place after the supression fire command, i had the same problem, even though i specifically tell them to not look at anything in particular after that command is done. it's beyond me, but as long as it works for now, that's all the counts :)

looking at that second screenshot makes me realize i never got rid of those little debug lines that say "he is now ..." and all that

:o

oops.

Posted: Fri Apr 21, 2006 4:24 am
by Broadus
I actually got rid of the debug things myself. You know, I was able to download the first version of your squad script from your topic, but I couldn't get the second version (the one you released when you decided to stop working on the script). I actually had that last version, and I tried to use it, but it wouldn't work. Then I used the first one, and it worked. I don't know why.
It would be nice if the player could hit a wall with the red dot and allies would go to it (to make them go upstairs before the player) but, hey, you can't win 'em all.

I spoke too soon when I said all of my problems were over.
The medic! It still has problems! On the level with the screenshots, the medic worked great. FLAWLESS, I SAY! However, on m2l1, the medic is broken or something. He won't heal anyone. Not even the player!
It's the same medic, same name, same scripts and values and whatnot. Unlike the working medic, that will run all the way across the level just to heal a wounded ally, the non-working medic just follows people and he's sitting right there next to them as they have literally 50 (out of 1000) health left.
It's driving me insane! I can't figure out what I did wrong this time.