Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bots float when executing 'wait' order on elevators #2

Closed
4512369781 opened this issue Aug 19, 2023 · 4 comments
Closed

Bots float when executing 'wait' order on elevators #2

4512369781 opened this issue Aug 19, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@4512369781
Copy link

Set "movetype" makes bots do nothing,

NetProps.SetPropInt(self, "movetype", 0);

but set "m_fFlags" can solve the problem,

ATCONTROLS = 64; // Player can't move, but keeps key inputs for controlling another entity
NetProps.SetPropInt(self, "m_fFlags", NetProps.GetPropInt(self, "m_fFlags") | ATCONTROLS);

and also need this to prevent bot Teleport

Convars.SetValue("sb_unstick", 0);
@smilz0
Copy link
Owner

smilz0 commented Aug 20, 2023

Actually i spent some time trying to find the best way to do it. I also tried with different m_fFlags values. The movetype approach seemed the best one to me because the bots don't teleport and you don't have to bother changing sb_unstick. Also because sb_unstick affects all the bots but the new wait order can be given to a single bot. You would have the other bots not teleporting if they get stuck.
Btw they still shoot and shove, only their locomotion is stopped.

@4512369781
Copy link
Author

4512369781 commented Aug 20, 2023

Actually i spent some time trying to find the best way to do it. I also tried with different m_fFlags values. The movetype approach seemed the best one to me because the bots don't teleport and you don't have to bother changing sb_unstick. Also because sb_unstick affects all the bots but the new wait order can be given to a single bot. You would have the other bots not teleporting if they get stuck. Btw they still shoot and shove, only their locomotion is stopped.

Sorry, I misremembered, the bots does shoot and shove.
but there are two problems:

  1. bot float when they taking the elevator.
  2. bot will not being dragged by a tongue.

oh, there is another problem, the following code should be moved to the top, otherwise if you execute "return Left4Bots.Settings.bot_think_interval;" in advance, it will not modify "FuncI ", which could result in multiple bots having the same "FuncI".

if (++FuncI > 5)
	FuncI = 1;

@smilz0
Copy link
Owner

smilz0 commented Aug 20, 2023

Actually i spent some time trying to find the best way to do it. I also tried with different m_fFlags values. The movetype approach seemed the best one to me because the bots don't teleport and you don't have to bother changing sb_unstick. Also because sb_unstick affects all the bots but the new wait order can be given to a single bot. You would have the other bots not teleporting if they get stuck. Btw they still shoot and shove, only their locomotion is stopped.

Sorry, I misremembered, the bots does shoot and shove. but there are two problems:

1. bot float when they taking the elevator.

2. bot will not being dragged by a tongue.

oh, there is another problem, the following code should be moved to the top, otherwise if you execute "return Left4Bots.Settings.bot_think_interval;" in advance, it will not modify "FuncI ", which could result in multiple bots having the same "FuncI".

if (++FuncI > 5)
	FuncI = 1;

Lol you are right
20230820170310_1
These are definitely bugs. I will see what i can do to fix them.
Thanks.

@smilz0 smilz0 added the bug Something isn't working label Aug 20, 2023
@smilz0 smilz0 changed the title [suggest] improve 'wait' order Bots float when executing 'wait' order on elevators Aug 25, 2023
@smilz0
Copy link
Owner

smilz0 commented Sep 2, 2023

I think i fixed it. Now the current order is automatically paused as soon as the bot is pinned by a special infected and the wait order automatically terminates if the wait location is on a nav area with an elevator.

@smilz0 smilz0 closed this as completed in 2838eee Sep 2, 2023
LeGurdah added a commit to LeGurdah/Left4Bots that referenced this issue Sep 2, 2023
- Experimental change smilz0#1: see if I optimized the _OnInventoryManager_ adding points to needed items by way of removing the "if" and "else" conditions for checking held items' class names and instead incrementing them with integer-ized boolean versions of said checks.
- Experimental change smilz0#2: change the think interval for "L4BThinker" from 0.01 seconds (which gets minimally capped by the game to 0.0333 seconds, or a tick rate of 30) to 0.0666 (est. tick rate of 15??) to match the player entities' tick rate, which is half as slow as the game's. Source of tick rate tidbit: https://developer.valvesoftware.com/wiki/Entity_Scripts#Thinker_Functions
smilz0 added a commit that referenced this issue Sep 3, 2023
Closes #21
Plus better fix for #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants