Members | Sign In
All Forums > Mission Scripting
avatar

Questions about enemy targeting and <direct>

posted Dec 15, 2011 20:10:01 by tallasse
A couple of issues I'm wondering about:

Once a player ship attacks an enemy, it seems impossible to get them to switch targets. Even getting out of weapons range, the enemy seems to follow the player and ignore other attackers, allowing players to 'kite' enemy ships. Is this the case?

Using <direct>, it seems like the first time you use it sets an absolute command that can't be overridden, even by other <direct> commands. If an enemy is directed at a point in space, it heads for that point, even if I later tell it to go to a different point, or to target a ship. If I direct an enemy to attack a ship, it ignores any further <direct>s, with the exception that as above, it will ALWAYS attack the player if the player fires on the enemy. This makes it very difficult to give enemies any sort of strategic planning.

Am I missing something, some other way to set a ship's targeting priorities?
[Last edited Dec 15, 2011 20:10:24]
page   1
3 replies
avatar
Mike_Substelny said Dec 15, 2011 20:27:20
You're not missing anything, tallasse. The enemy AI doesn't give scripters much control. The neutral AI offers you a little bit more control. Here are two suggestions:

Turn your enemies into neutrals when you want them to do something that enemies won't do. I used this in "Truce or Consequences." In that mission certain enemies only become enemies when the player ship is close. This was the only way that I could program a long chase.

When your enemies aren't shooting at the players turn them into generic meshes. I'm still pushing the boundaries of what generic meshes can do, but so far it seems like a lot. Then when the players get close (or whatever conditions you prefer) destroy the generic meshes and turn them into enemy ships.

"Damn the torpedoes! Four bells, Captain Drayton!"

(Likely actual words of Admiral David Farragut, USN, at the battle of Mobile Bay. Four bells was the signal for the engine room to make full steam ahead).
avatar
tallasse said Dec 15, 2011 21:38:59
I use neutral-to-genericMesh-to-enemy for one of my other missions, and it worked okay, but with this one, I'm just gonna have to wait until I have more control over the AI. It's not that it couldn't be done, just that the overhead would be pretty damn high with damage levels and 20 allied ships.

I've also found that when switching from enemy-to-genericMesh-to-neutral and so on, it sometimes has bizarre effects on the Observer station - it won't display the model properly; it shows up on the main screen, but to the Observer station the player ship fires beams in the direction of x=0, z=0 and explosions from torpedoes appear in empty space. Has this happened to you?
avatar
Mike_Substelny said Dec 17, 2011 06:17:47
I think that has to do with the way the consoles communicate with the server. As a "console" the observer station interpolates a lot based on what it expects a normal enemy to do. Only the server has the true location of everything in the sector at all times. This isn't a big deal in non-scripted missions because the consoles can correctly anticipate the enemies.

I'm fighting with this problem in my revision of "Havoc in the Hamak Sector." I'm determined to make it work, though.
"Damn the torpedoes! Four bells, Captain Drayton!"

(Likely actual words of Admiral David Farragut, USN, at the battle of Mobile Bay. Four bells was the signal for the engine room to make full steam ahead).
Login below to reply: