Code Monkey home page Code Monkey logo

Comments (9)

smilz0 avatar smilz0 commented on August 26, 2024

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.

4512369781 avatar 4512369781 commented on August 26, 2024

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.

smilz0 avatar smilz0 commented on August 26, 2024

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.

4512369781 avatar 4512369781 commented on August 26, 2024

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.

smilz0 avatar smilz0 commented on August 26, 2024

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.

smilz0 avatar smilz0 commented on August 26, 2024

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.

4512369781 avatar 4512369781 commented on August 26, 2024

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.

smilz0 avatar smilz0 commented on August 26, 2024

oops i forgot to change it to self. Thanks!

from left4bots.

smilz0 avatar smilz0 commented on August 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.