.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > FritzBot > Waypoint Forum
Waypoint Forum A place to request waypoints for a specific map, or to check on the progress of waypoints for your favorite maps.

Reply
 
Thread Tools
Scripting problem
Old
  (#1)
the bindlestiff
Member
 
the bindlestiff's Avatar
 
Status: Offline
Posts: 280
Join Date: Nov 2005
Location: Washington state
Default 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. . .
  
Reply With Quote
Re: Scripting problem
Old
  (#2)
Denny
FritzRTCW Team Member
 
Denny's Avatar
 
Status: Offline
Posts: 370
Join Date: Oct 2004
Location: Minnesota, USA
Default Re: Scripting problem - 09-01-2006

From the sounds of it, all the actions other than the steal actions aren't active forever (i'm sure the steal actions aren't active forever, but you catch my drift i hope and in order for the following method to work you may have to make those active forever too). You should set those up if you want them to be active even if the docs are taken and just toggle them on/off in the script. It's not a problem with you're script per say, but if you want actions to be active across group numbers even under goal tracker altering conditions you have to make them active forever and then just disable/enable them in the script as you wish.

You can also deactivate active forever actions completely, say a dynamite objective is destroyed and you don't want the bots around there anymore. Again that can be done from within the script.

Hope that fixes the problem.


FritzbotRTCW Official Waypointer & Beta Tester
Updated: 1/12/06

Click Here to view my current waypointing progress.
  
Reply With Quote
Re: Scripting problem
Old
  (#3)
CrapShoot
A Monkey
 
CrapShoot's Avatar
 
Status: Offline
Posts: 386
Join Date: Jan 2005
Default Re: Scripting problem - 09-01-2006

Maybe try this for the dynamite action:

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 (Group 1), these are toggled on / off in action 2's tests
activateAction 17
activateAction 18
activateAction 28
}

I have a suspicion that the if_action_XXX test is only working for dynamite actions (possibly causing other problems if used for anything but) and that the if_obj_home test in action 2 is only working after the first doc grab.

Last edited by CrapShoot; 09-01-2006 at 05:03..
  
Reply With Quote
Re: Scripting problem
Old
  (#4)
the bindlestiff
Member
 
the bindlestiff's Avatar
 
Status: Offline
Posts: 280
Join Date: Nov 2005
Location: Washington state
Default Re: Scripting problem - 09-01-2006

Thanks for the tips, guys, but I'm afraid that they didn't work.

Crapshoot, I tried your suggestion about the dynamite actions, but the Close-in Defense actions still do not get reactivated when the docs are returned, leaving my axis bots to go insane without any valid goals.

Denny, I made the Close-in Defense actions "active forever" and changed their Group numbers from "-1" to "1." I also made the Steal action "active forever". But the Close-in actions still do not get reactivated when the docs are returned.

In all cases, the Escape actions in the script activate/deactivate properly with changes in the status of the Steal action. These actions are in the same script, use the same conditionals, and have the same properties as the Close-in Defense actions. But they work and the others do not. Doesn't make sense!

I've dissected the scripts of several other maps where the same possibility of grabbing the documents ahead of the dynamite action exists. The script conditionals therein do not look any different from mine. If ALL the actions in the script didn't work, that would make some kind of sense. But if eleven of them work and three don't???
  
Reply With Quote
Re: Scripting problem
Old
  (#5)
Denny
FritzRTCW Team Member
 
Denny's Avatar
 
Status: Offline
Posts: 370
Join Date: Oct 2004
Location: Minnesota, USA
Default Re: Scripting problem - 09-01-2006

Quote:
Originally Posted by the bindlestiff
Denny, I made the Close-in Defense actions "active forever" and changed their Group numbers from "-1" to "1." I also made the Steal action "active forever". But the Close-in actions still do not get reactivated when the docs are returned.
Shit, i didn't even think of that. Never make the actual objective actions (the one's linked to the actual objective say the docs or a door that needs to be blown up) active forever or you're gonna have problems (i.e. bots trying to take docs already transmitted, bots trying to plant dyno even after the objective is destroyed, etc.) it just doesn't work and besides the actual objectives carry over into the next group number until they are destroyed/completed.

So say you got 2 doors, and they are both group 0 if you destroy door A before door B then door B will carry over to group 1 and still be an active objective. If an objective is carried over into a group like this, it cannot increase the goal tracker after being destroyed. So say after the above happened with door B, if you destroyed it shortly after it moved to group 1 it won't increase the goal tracker to group 2.

In any case, you would make Camp, Alt Roam, Roam/Patrol and other actions active forever in this scenario and deactivate/activate those in the script. Aim actions i'd leave active forever regardless because a bot won't use an Aim action if it isn't linked for a camp action so those usually don't need to be activated/deactivated in the script unless you want to have the bot look in a different area after a certain objective is completed.

For you're situation i'd just keep all the actual objective actions at group 0 and just have the rest active forever. It should work because i've done similar stuff before, if you need help hands on, feel free to send me you're nav and aiscript to my e-mail and i'll set it up for you.


FritzbotRTCW Official Waypointer & Beta Tester
Updated: 1/12/06

Click Here to view my current waypointing progress.
  
Reply With Quote
Re: Scripting problem
Old
  (#6)
Maleficus
Member
 
Maleficus's Avatar
 
Status: Offline
Posts: 1,054
Join Date: May 2004
Location: Planet Earth
Default Re: Scripting problem - 09-01-2006

Quote:
Originally Posted by Denny
For you're situation i'd just keep all the actual objective actions at group 0 and just have the rest active forever.
Hit the nail on the head - all of what you described is exactly what it would take to make zion work.


Dum Spiro Spero


  
Reply With Quote
Re: Scripting problem
Old
  (#7)
the bindlestiff
Member
 
the bindlestiff's Avatar
 
Status: Offline
Posts: 280
Join Date: Nov 2005
Location: Washington state
Default Re: Scripting problem - 10-01-2006

I've always had my Alt Roam and Aim actions "active forever." I had all my objective actions at Group 0 until I "thought" your tip indicated that I might have to make the steal action active forever (actually, I tried it both ways).

I have left the "Allied Escape / Axis Attack" actions at "-1" because they seem to work perfectly well that way. No problems with the script turning them on and off.

The "Close-in Axis Defense" actions are the trouble-makers. I have set them to "active forever," two in Group 0 and three in Group 1. They turn on initially via the Goal Tracker. The script turns them off when the docs are taken. BUT THE SCRIPT WON'T TURN THEM BACK ON AGAIN when the docs are recovered. Active forever or not, they just do not re-activate.

My original configuration used the Goal Tracker to control both the Forward Axis Defense (Group 0) and the Close-in Axis Defense (Group 1) actions. The script controlled the Allied Escape actions. The problem with this simpler approach is that if the docs are taken before the door is dynamited, the Forward Defense actions get turned on the same time as the Escape actions, leading to a fragmented Axis effort in recovering the documents.

That's why I'm endeavoring to use the script for the Close-in actions -- so they can be turned off when the Escape is in progress. Trouble is, they won't turn back on when required! Method looks good on paper, though. . .

Denny, I'll send you my stuff if I can figure out how to get the forum e-mail to accept atachments.


A few minutes later:

Ah -- you've got your email set up to "no emails" so I'll just post the waypoint files here. Anyone's welcome to solve my problem!

Last edited by the bindlestiff; 19-02-2006 at 05:53..
  
Reply With Quote
Re: Scripting problem
Old
  (#8)
CrapShoot
A Monkey
 
CrapShoot's Avatar
 
Status: Offline
Posts: 386
Join Date: Jan 2005
Default Re: Scripting problem - 10-01-2006

I think those actions that are causing problems need to be set at group -1 initially. I thought you had mentioned that they were?

If i'm not mistaken, actions that need to be toggled on and off should be set in group -1, although you can turn off any action with the script.

In any case, it will probably help to have someone like Denny to take a look.
  
Reply With Quote
Re: Scripting problem
Old
  (#9)
the bindlestiff
Member
 
the bindlestiff's Avatar
 
Status: Offline
Posts: 280
Join Date: Nov 2005
Location: Washington state
Default Re: Scripting problem - 10-01-2006

Yeah, they were set to "-1" initially and were activated by the dynamite action, then turned off by the script when the docs were stolen and supposedly turned on again by the script when the docs were recovered. But they wouldn't turn on again! So now I'm trying the "active forever" thing.

My interpretation of "active forever" is an action that, once turned on, is forevermore immune to the state of the Goal Tracker. Once active, however, the action can be turned on/off by the script.

Is this correct?
  
Reply With Quote
Re: Scripting problem
Old
  (#10)
CrapShoot
A Monkey
 
CrapShoot's Avatar
 
Status: Offline
Posts: 386
Join Date: Jan 2005
Default Re: Scripting problem - 10-01-2006

I looked at it. Seems like a bug to me related to if_obj_home true and activateAction.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com