Scripting problem -
08-01-2006
I've encountered a scripting problem where the script WILL NOT activate a set of actions. It's been very frustrating trying to make it work -- I've tried may different variations, checked and rechecked the action parameters and the script formatting, but nothing works.
The situation is this: in my map (mp_zion) it is possible to grab the "secret" documents BEFORE the dynamite action has been completed. If that happens, the Goal Tracker ends up at 1 when it should be 2, and the Group 2 escape actions don't get activated. To fix this, the escape actions must be controlled via scripting. If I allow the Goal Tracker to handle the Group 0 and Group 1 actions and I use the script for the Group 2 actions, the situation arises where the Group 1 and Group 2 actions are both active at the same time after the docs are taken. This spreads out and weakens the defense at a critical time.
To fix this, I want to use scripting for BOTH Group 1 and Group 2 actions, switching off Group 1 and switching on Group 2 when the docs are taken (and vice versa when they're recaptured). When the docs are retaken, this approach leaves me with Group 0 and Group 1 actions running at the same time (because the Goal Tracker reverts to 0 when the docs are recovered). This is not optimum but is better than diluting the defense when the docs are stolen.
The problem is that the three Group 1 actions DO NOT activate when the docs are recovered (whether the docs are taken first or the dynamiting occurs first). I am well within the 64-keyword limit per action and the 128-keyword limit per script. Strangely, the Group 2 actions activate and deactivate as they should! Here is a copy of the script (edited to remove most of the Group 2 actions for brevity):
MAPTYPE 0 //Single-objective map
action 0 // If the door has been DYNAMITED, then
{
// Connect the nodes through the door
node_connect 72 42 true
// Activate the Close-in Defense if docs haven't been stolen (Group 1)
if_action_false 2
activateAction 17
if_action_false 2
activateAction 18
if_action_false 2
activateAction 28
}
action 2 // Documents
{
// Toggle off/on the Close-in Defense (Group 1)
If_obj_home_false 2
deactivateAction 17
if_obj_home_true 2
activateAction 17
if_obj_home_false 2
deactivateAction 18
if_obj_home_true 2
activateAction 18
if_obj_home_false 2
deactivateAction 28
if_obj_home_true 2
activateAction 28
// Toggle on/off the Escape actions (Group 2)
if_obj_home_false 2
activateAction 4
if_obj_home_true 2
deactivateAction 4
if_obj_home_false 2
activateAction 26
if_obj_home_true 2
deactivateAction 26
if_obj_home_false 2
activateAction 34
if_obj_home_true 2
deactivateAction 34
// remainder of Group 2 actions omitted (8 more)
}
#EOF
I've carefully checked the action parameters and can find nothing wrong. The Group 1 and Group 2 actions look the same: action_group = -1, action_active = 0, action_allies/axis as required (most are roam or camp actions). When the docs are recovered, the Group 1 actions just do not activate (and I've confirmed this with may different tests). The Group 1 roams do not get visited after doc recovery or, in the case when the door is dynamited first, the defender bots wind up with "no valid goals."
Am I overlooking some limitation that I'm not aware of? Suggestions gladly welcomed. . .
|