Giter Club home page Giter Club logo

Comments (12)

Shadowysn avatar Shadowysn commented on August 27, 2024 1

Hey Shadowysn! Sorry for not telling you about this but at the end i thought that it wasn't your job to fix a game's issue that was only affecting L4B, so after making the workaround work on L4B2 and being no longer interested in L4B1, i thought that no extra work was needed. Anyway, if you managed to fix it properly then it's good news, thank you. And thank you for your VSSM which is one of my favourite L4D2 addons. You did a great job with it.

It's fine given how much effort it could be to maintain and focus on L4B throughout 3 years, and I admire the work that was put in on both versions.
I'm a bit surprised but glad VSSM turned out to be a favourite of yours given the dull reception it had from multiplayer issues I ended up unable to fix and my failure in clarifying conflicts with Sourcemod 8 survivor plugins.

from left4bots.

smilz0 avatar smilz0 commented on August 27, 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 27, 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 27, 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 27, 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 27, 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 27, 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 27, 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 27, 2024

oops i forgot to change it to self. Thanks!

from left4bots.

smilz0 avatar smilz0 commented on August 27, 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.

Shadowysn avatar Shadowysn commented on August 27, 2024

It's not until after I saw this issue that I was aware of rr_GetResponseTargets being broken, though regardless it would've been broken anyway from any method of getting extra survivors (without the tall order of changing the mission file via text editing or plugins) thanks to issues like the L4D2 survivors being completely replaced by L4D1 duplicates in hard-code + duplicate survivor problems and there wasn't much I feel I could've done to lessen them.

Though L4B2 has already fixed this with a workaround and what I discuss is irrelevant now, I decided to fix rr_GetResponseTargets in VSSM for L4D1 mission set maps by replacing it with my own function that returns the proper table of characters including VSSM's fake L4D2 survivors, so other mods using the function can work properly. Or, well, as properly as 8 non-duplicate survivors can.
Still doesn't work with duplicate survivors, but I don't know where to start on adding support for duplicates in a function that is pretty rarely used.

if (!("VSSM_rr_GetResponseTargets" in this) && survManager.GetSurvSet() == 1)
{
	this.VSSM_rr_GetResponseTargets <- this.rr_GetResponseTargets;
	this.rr_GetResponseTargets <- function()
	{
		local responseTbl = {};
		local survList = survManager.RetrieveSurvList(false);
		foreach (key, client in survList)
		{
			local survChar = NetProps.GetPropInt(client, "m_survivorCharacter");
			switch (survChar)
			{
			case 4:
				responseTbl["Gambler"] <- client;
				break;
			case 5:
				responseTbl["Producer"] <- client;
				break;
			case 7:
				responseTbl["Coach"] <- client;
				break;
			case 6:
				responseTbl["Mechanic"] <- client;
				break;
			case 0:
				responseTbl["NamVet"] <- client;
				break;
			case 1:
				responseTbl["TeenGirl"] <- client;
				break;
			case 3:
				responseTbl["Biker"] <- client;
				break;
			case 2:
				responseTbl["Manager"] <- client;
				break;
			default:
				responseTbl["Unknown"] <- client;
				break;
			}
		}
		return responseTbl;
	}
}

from left4bots.

smilz0 avatar smilz0 commented on August 27, 2024

It's not until after I saw this issue that I was aware of rr_GetResponseTargets being broken, though regardless it would've been broken anyway from any method of getting extra survivors (without the tall order of changing the mission file via text editing or plugins) thanks to issues like the L4D2 survivors being completely replaced by L4D1 duplicates in hard-code + duplicate survivor problems and there wasn't much I feel I could've done to lessen them.

Though L4B2 has already fixed this with a workaround and what I discuss is irrelevant now, I decided to fix rr_GetResponseTargets in VSSM for L4D1 mission set maps by replacing it with my own function that returns the proper table of characters including VSSM's fake L4D2 survivors, so other mods using the function can work properly. Or, well, as properly as 8 non-duplicate survivors can. Still doesn't work with duplicate survivors, but I don't know where to start on adding support for duplicates in a function that is pretty rarely used.

if (!("VSSM_rr_GetResponseTargets" in this) && survManager.GetSurvSet() == 1)
{
	this.VSSM_rr_GetResponseTargets <- this.rr_GetResponseTargets;
	this.rr_GetResponseTargets <- function()
	{
		local responseTbl = {};
		local survList = survManager.RetrieveSurvList(false);
		foreach (key, client in survList)
		{
			local survChar = NetProps.GetPropInt(client, "m_survivorCharacter");
			switch (survChar)
			{
			case 4:
				responseTbl["Gambler"] <- client;
				break;
			case 5:
				responseTbl["Producer"] <- client;
				break;
			case 7:
				responseTbl["Coach"] <- client;
				break;
			case 6:
				responseTbl["Mechanic"] <- client;
				break;
			case 0:
				responseTbl["NamVet"] <- client;
				break;
			case 1:
				responseTbl["TeenGirl"] <- client;
				break;
			case 3:
				responseTbl["Biker"] <- client;
				break;
			case 2:
				responseTbl["Manager"] <- client;
				break;
			default:
				responseTbl["Unknown"] <- client;
				break;
			}
		}
		return responseTbl;
	}
}

Hey Shadowysn! Sorry for not telling you about this but at the end i thought that it wasn't your job to fix a game's issue that was only affecting L4B, so after making the workaround work on L4B2 and being no longer interested in L4B1, i thought that no extra work was needed.
Anyway, if you managed to fix it properly then it's good news, thank you.
And thank you for your VSSM which is one of my favourite L4D2 addons. You did a great job with it.

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.