Jump to content

Path through switch - Delay between map trigger and OB script trigger

Recommended Posts

Good afternoon,

I'm going through Chateau Voilegarde waypoints again, and I'm going through the button-commanded doors for Axis, so they get as quick as possible where they're needed

I've noticed there's a delay between the console prints you have with `bot debugtriggers on` and the call of the OB trigger bound to it, where I change the door status, which is used in the ExitConditions (the table where you tell the bot to stop trying to click the button)

The issue here is that these buttons can be spammed, which resets the door animation... The spamming stopping after the switch script table timeout

Tried to play with timeout to see if it could help (initially 3000, tried 1000/750/150, kept 1000), but it quickly gets messy when it's crowded

I'm using the door goto event to tell if it's opening or closing, the button has its own events since it moves, but since the events of both the button and the door are fired at once through the console command, I guess it's fine?

I've attached my current waypoints, with the door near Axis Laboratory spawn scripted; Axis will spawn there and go through the path through switch when the Courtyard flag is owned by Allies, since it is the shortest path to get back to the flag

Map download: https://www.wolffiles.de/index.php?filebase&fid=224

Thank you in advance

Chateau Voilegarde Waypoints.zip

Link to comment
Share on other sites

Posted (edited)

I think, using your solution with 2 triggers, only moving Map.Switches.right_lab_door.Enabled = false; before the sleep( 1.25 ); is enough, and that makes the ExitCondition table useless, and seems to work yeah

Was hoping for a working single-trigger solution, but heh

Here's the merged work: voilegarde_b3.gm

Edited by Mateos
Attached merged script
Link to comment
Share on other sites

  • Moderators
8 hours ago, Mateos said:

I've noticed there's a delay between the console prints you have with `bot debugtriggers on` and the call of the OB trigger bound to it.

There is not delay between map trigger and OB script trigger. There's delay between map triggers "rightlabdoor_button_Moving" and "rightlabdoor_goto".

Link to comment
Share on other sites

Posted (edited)

What I did is watching the console and set a debug print at the top of the trigger OB script side

I had the debugtriggers prints (all at once, thus making me think just use the one having a velocity, to know if the door is either opening or closing, since the button event is twice 'opening' on both events), then a delay before the debug print, that's what made me think there were a delay

I've followed the wiki page about path through switch, but it seems, as did Tomek, that moving the Enabled false from 'after the Opening/Opened' to 'before' helps forcing bots stop using the button, even though the condition in ExitConditions looks right (first instruction of trigger is to change door status from Closed (0) to Opening (1), and ExitConditions tests status > Closed, just like in the wiki)

IIRC most of OB is single-threaded, perhaps it stays somehow stuck in ExitConditions, and thus the status switch happens later; and as the map author did not protect the button from spamming, it gets the whole thing stuck; but why would setting Enabled to false would then make it react so quickly?

I'm not sure to understand the flow; perhaps the issue here is only that the button is unprotected by map author, contrary to some other maps?

Or am I totally misunderstanding things?

Edited by Mateos
Precision on debugtriggers output on my end
Link to comment
Share on other sites

Oh god the == instead of = on the var init >.> So it was initialized with a boolean and not a string as thought/expected... Hope to have a copy of your eyes someday

I prefer your solution as the sleep is now in the door moving table rather than the button pressing one, looks more logic!

Thank you very much for the investigation and related commits to the repo!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...