Wow, okay. Where to begin.
So while I’ve been using Hammer for several years, I’m still very much inexperienced in it. I think a big part of that is because almost all of my mapping experience is with Left 4 Dead, which means a lot of things that go for singleplayer mapping go out the window. A good majority of that is NPC-related stuff.
In order to educate myself more on how things work, I got the idea in my head to try my hand at my own extension of On A Rail. To be clear, I don’t have any intention of one-upping Text’s OaRU or .RK’s Loop Mod, they’re both much better at this than I am. I just figured OaR would be a good place to experiment - it’s mostly indoors, and despite how a lot of people feel about it, I have a bit of a soft spot for the original.
I’m currently on the first “original” map, which includes the Vort/HECU showdown over the two parallel tracks. However, I’m running into problems with the NPCs pretty much all over the place. Here goes:
-
There’s a grunt manning the turret on the HECU side of the tracks. The problem is, I can’t get him to shoot at anything - I think it might be that the Vorts are too far away, but I’m not really sure how to rebuild the area to put them closer. I tried giving him an npc_bullseye to shoot at, but he’s not shooting at that either. For that matter, even if I force him off the turret, he doesn’t get out a weapon or try shooting anything, he just stands there.
-
There are AI Nodes across the track so the NPCs can run up to each other instead of staying static on one side (also to avoid that issue where Vorts wouldn’t attack, since I’ve heard that’s still present). This includes over the track that the player drives the tram over - I’ve had a soldier run out in front of the tram and get stuck between it and the security gate twice now. I’d like to keep them from running out into the track if possible - and if not, I can just stick a trigger_hurt filtered to NPCs on the front of the tram or something - but I’d rather not delete the nodes so as to avoid any funny NPC behaviour as a result. I’ve tried using an info_radial_link_controller, but the NPCs still run out into the track. The only thing I can think of using to stop them is an ai_battle_line, which brings me to…
3) In the upstairs office area, I’ve got a scripted assault between the HECU and some Vorts that I want to play out. Problem is, it just won’t work properly. The HECU have two ai_battle_lines to prevent them from straying too far from the “showdown” area, but they… just ignore the lines entirely. As far as I can tell, the entities are set up correctly - pretty much the same as they are in BM’s c2a2b - but the HECU will just run past them like it’s no big deal. I don’t know if that’s because they don’t have sufficient cover, but I can’t figure out what’s wrong here.
Both the battle_line entities are set up like this:
Name: hecu_office_no_retreat
Actor(s) or squad to affect: c2a2a1_office_showdown_hecu
Active: Yes
Strict: Yes
Use parent’s orientation flag unset
To prevent the player from getting absolutely smothered upon entering, they have an ai_relationship set to ignore the player until all the Vorts are dead. It’s kinda strange to see them run to the end of the hallway where the player is and not do anything, to say the least, which is part of why I have the battle_lines set up.
- As part of said showdown, I’ve got an AI Assault - admittedly a half-finished one - that’s supposed to trigger once the first wave of Vorts is dead - the HECU are supposed to run down the hallway and around the corner to confront the next wave. It… seems to be halfway working. The HECU will run up to the hallway corner as intended, but inconsistently, and they don’t go any further than that. Based on what the VDC says, I can’t see anything wrong with my setup.
ai_goal_assault:
Name: hecu_office_assault
Actor(s) to affect: c2a2a1_office_showdown_hecu
Rally Point Set: office_hecu_assault_point_*
Search Type: Entity Name
Start Active: No
Assault Cue: Don’t wait for a cue
Rally Point Selection Method: Random
assault_rallypoint:
Name: office_hecu_assault_point_* (5 total, one for each soldier)
Assault Point: office_hecu_assault_goal
Assault Delay: 0
Priority: 1
Force Crouch: No
Urgent: No
assault_assaultpoint:
Name: office_hecu_assault_goal (there are three total, the other two have numbers appended)
Next assault point: office_hecu_assault_goal_2/3 (respectively)
Assault time out: 3.0
Clear on contact with enemies: No
Allow diversion: No
Never Timeout: No
Strict?: No
Force Crouch: No
Urgent: No
Attack Tolerance: Large (10ft)
Clear this point upon arrival flag is unset
(all of these have the same settings, minus goal_3 not having a next assault point target)
A math_counter keeps track of how many Vorts are alive, and when the first wave is dead, it fires an Activate output to the ai_goal_assault entity. When a BeginAssault input is fired (which it turns out I’d accidentally deleted, oops) the soldiers will run to the corner of the hallway, but still make no real effort to actually stay around the first assault point. After that, they crowd around the next assault points without spreading out at all. Is this behaviour something that happens when they don’t have any targets to attack?
- Last thing, pretty minor compared to everything else - in the office area, there’s a small storage closet in the hallway that has a bullsquid hiding in it. The bullsquid is only woken when the door’s open, to surprise the player - the thing is, upon opening the door, it promptly turns around and starts eating next to one of the walls. There aren’t any ragdolls or NPCs… or pretty much anything in that corner yet, but it just ignores the player. I imagine it won’t be too hard to work around this, but I’m still wondering, what in the world is this all about?
Whew, lots of questions, I apologize. Still, if anyone could point me in the right direction for any of these, it’d be very much appreciated! Thanks.
EDIT: So I just realized that I don’t know how to read, and missed the part where ai_goal_standoff’s are necessary to make ai_battle_line’s work.
Oops.
EDIT 2: I have dreadfully screwed something up in modifying the office showdown. I’ve tried turning it into a standoff instead, but the game has a tendency to crash when the second ai_battle_line is enabled. Is there a specific way to go about this?