Members | Sign In
All Forums > Mission Scripting
avatar

How do I make a neutral's brain stack do the same thing as COMM's "defend" command?

posted May 23, 2012 23:46:55 by madings
Comm's can tell a neutral to "defend" a ship and it will MOVE TOWARD that ship to defend it.

But the brain stack command "defend" doesn't do that - it won't move toward the target ship. That's annoying. Is that a bug? how do I make the brain stack do what I want?
page   1
7 replies
avatar
Mike_Substelny said May 25, 2012 00:06:05
The "Defend" command just sets the parameters for a defense order from Comms. That is, when Comms gives a "defend" order the mission script command tells the neutral to get within (value1) of the object it is defending. Once it is within (value1) any enemy that comes within (value2) is subject to attack.

As far as I know you are correct; there is no way for the script to tell a neutral what it should be defending. That would be a useful thing to have.

For now I suggest that you use TARGET_THROTTLE to get the neutral close to the thing you want it to defend, followed by a bunch of ATTACK blocks to make it attack enemies that come close. If the thing being defended is destroyed you should clear and rebuild the brain stack, possibly assigning a new TARGET_THROTTLE.
"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
madings said May 25, 2012 00:47:40
The point I am trying to go to is a moving ship not a fixed point. but there is no brain stack command for follow a ship without trying to kill it.
avatar
Mike_Substelny said May 27, 2012 00:37:11
A neutral won't attack another neutral. I think TARGET_THROTTLE is the block that was created for the purpose of chasing a moving object.
"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
madings said May 27, 2012 07:09:39
From the docs:
{L"TARGET_THROTTLE"},
The script can add this block to force an AI brain to move towards a specific unit (targetName) and throttle(value1).

What does it mean to move towards a specific throttle? I get the first bit, "move toward a specific unit", but not the second bit, "and throttle". Was it supposed to read "at a particular throttle setting"? Is that a throttle scaled according to the ship's own max speed (i.e. throttle of 0.5 means half its max speed) or is it relative to a global scale (like the speed values in vesselData.xml)?

If I can get this to work it's a great improvement over what it does now where the smaller but faster ships are set by the comms officer to "defend" the lead slower ship, which ends up meaning they keep circling around it as it lumbers along. Since the smaller ships are towing wormholes behind them, this often results in making the lead slower ship accidentally fall through the wormholes as that happens (which is funny but tactically disastrous to the people playing the mission.)
avatar
madings said May 27, 2012 07:16:16
Also, if the option to TARGET_THROTTLE works like you say, then the game engine really should add that option for the COMMS officer to trigger as well. If it's a thing the AI is capable of understanding then the COMM officer should be able to say "follow that ship" instead of just "defend that ship". (Then again it would be nice if the comm officer could also tell the other ships to slow down or speed up just like they can be given a heading.) If the Comm officer had control over several helper combat ships following the Artemis around as part of its flotilla, it would give the officer more useful things to do with them and more fun play that could give them autonomous decisions to make instead of "its my job to repeat what the computer says."
avatar
Mike_Substelny said May 30, 2012 12:58:14
Defend is just the verb that Comms gets to select. If Comms sends an unarmed friendly transport to "defend Artemis" the transport will simply follow Artemis around (this is a handy tactic in "Party Crashers." The response that Comms receives says the transport will ". . . rendezvous with Artemis."

I think "defend" is almost exactly the same as TARGET_THROTTLE except that armed an friendly will attack enemies that come close to the ship or base being defended.

I never checked to see if transports on a "defend Artemis" mission will turn to attack enemies that get too close to Artemis. Maybe they do.
"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
MatthewWhiteacre said Jun 09, 2012 13:23:39
Last week I was playing COMMS and the captain told me to tell a destroyer and a transport to defend DS2. The destroyer said "Proceeding to defend DS2" or something like that. The transport said 'Are you kidding... We are unarmed!" but they did rendezvous with DS2.
Login below to reply: