Comments (9)
I know the way the survivor manager addon spawns the L4D2 survivors on the L4D1 maps confuses the response system vscript function "rr_GetResponseTargets" (which was used to get the bot's entity by the actor name). This is still a problem in L4B1 but i made a workaround in L4B2 to get the bot's entity by its character id instead. Last time i played with the survivor manager addon it was working. Idk if there is some other problem that i didn't notice. Anyway i don't think i can add the userid to the vocalizer commands that you send via vocalizer menu.
from left4bots.
I know the way the survivor manager addon spawns the L4D2 survivors on the L4D1 maps confuses the response system vscript function "rr_GetResponseTargets" (which was used to get the bot's entity by the actor name). This is still a problem in L4B1 but i made a workaround in L4B2 to get the bot's entity by its character id instead. Last time i played with the survivor manager addon it was working. Idk if there is some other problem that i didn't notice. Anyway i don't think i can add the userid to the vocalizer commands that you send via vocalizer menu.
Problems only happen when the number of survivors exceeds 8, because the same survivors have the same character id.
only need to execute DoEntFire("!self", "AddContext", "whoid:"+player.GetPlayerUserId(), 0, null, player);
once in the "player_spawn" event, and you can read the userid in "concepts", but I don't know how to add the userid to "subject".
from left4bots.
Wait, you can spawn more than 8 survivors? I didn't know that lol.
Now i see, you do that when they spawn. I'll try it this, thanks.
For the subject probably it's not even needed. If you select the bot via 'botselect' bind (scripted_user_func l4b,botselect) without the bot name then the bot who is closest to your crosshair is selected, regardless his name or actor name.
from left4bots.
Wait, you can spawn more than 8 survivors? I didn't know that lol. Now i see, you do that when they spawn. I'll try it this, thanks. For the subject probably it's not even needed. If you select the bot via 'botselect' bind (scripted_user_func l4b,botselect) without the bot name then the bot who is closest to your crosshair is selected, regardless his name or actor name.
oh, i have never used 'botselect' before.
After read the code, I guess this doesn't solve the problem.
Although the correct bot is selected at the first, but then manually fire the "PlayerLook" concept and finally getting the bot by 'Actor'. This goes back to the original problem: If there are two bots with the same character id, then can not get the correct one.
Maybe here in 'botselect', just add bot into "Left4Bots.VocalizerBotSelection" instead of use concept?
from left4bots.
Oh you are right i should select the bot directly. I will see what i can do. Hopefully the survivor manager author or the TLS team come with a better solution tho.
from left4bots.
So i removed all the "ClearContext" and replaced the "AddContext" with "SetContext(string name, string value, float duration)" and 0.1 duration.
And i added "player.SetContext("userid", player.GetPlayerUserId().tostring(), -1);" in the player spawn event.
In OnConcept i get the "who" entity by userid (if "userid" key is present).
For the subject i can't do it but i added "subjectid" to the "PlayerLook" vocalization that is forced when you use the "botselect" command so now if you select the bot with "botselect" the correct bot is selected.
Would be cool if the TLS could add "userid" and "subjectid" by default.
from left4bots.
So i removed all the "ClearContext" and replaced the "AddContext" with "SetContext(string name, string value, float duration)" and 0.1 duration. And i added "player.SetContext("userid", player.GetPlayerUserId().tostring(), -1);" in the player spawn event. In OnConcept i get the "who" entity by userid (if "userid" key is present). For the subject i can't do it but i added "subjectid" to the "PlayerLook" vocalization that is forced when you use the "botselect" command so now if you select the bot with "botselect" the correct bot is selected. Would be cool if the TLS could add "userid" and "subjectid" by default.
The new method works great, thanks!
And when testing the new function, I found an error in left4bots_ai.nut, about “Left4Bots.Settings.carry_debug”, at lines [223], [258], [286], [308], which would print "AN ERROR HAS OCCURED [the index 'player' does not exist]" in the console.
from left4bots.
oops i forgot to change it to self. Thanks!
from left4bots.
I'm closing this. If you find any issue or you find a way to implement the subjectid thing feel free to open another issue.
from left4bots.
Related Issues (20)
- The full version of left 4 bots 2 works on second restart by either vote to restart or failing the chapter while the alpha version works fine with this mod HOT 1
- hey can u add a feature where when playing with friends they can also control the bots? it sucks when only 2 person can control them HOT 2
- Automation scripts for Swamp Fever official campaign
- "Dodge" pipe_bomb_projectile
- Automation scripts for Death Toll official campaign HOT 1
- Bots close saferoom door HOT 1
- Player survivors getting force-swapped away from pills/adrenaline after pickup HOT 3
- Fix bot shooting nervously sitting witch HOT 1
- Fix pick up melee loop HOT 5
- When swapping your weapon with the bot, you'll find that it has no ammo. HOT 5
- When one bot is incapacitated, the others always try to heal it and die HOT 4
- Fix bots stuck in pickup loop HOT 5
- "fall_velocity_warp" not work since last release HOT 3
- Bots run back to human after unpause lead order HOT 1
- About "lead_pause_behind_dist" setting HOT 1
- Dedicated Server Crash on Shutdown HOT 4
- [IMPROVEMENT] Manual Attack Optimization HOT 3
- Warp doesn't work after level change on latest github version HOT 1
- [fix] Hooks not work sometimes after last update HOT 29
- [Suggestion] Bots use medkit immediately in "black and white" condition.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from left4bots.