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

Disabling lucky balls, devil balls and decoys #38

Open
IlogicalKarma opened this issue Sep 3, 2024 · 17 comments
Open

Disabling lucky balls, devil balls and decoys #38

IlogicalKarma opened this issue Sep 3, 2024 · 17 comments
Labels
Complexity: Low Should be fixed shortly. enhancement New feature or request

Comments

@IlogicalKarma
Copy link

As far as I can tell there are options to disable lucky balls, devil balls and decoys, however they also seem to appear occasionally on some maps such as ph_restaurant_os. Is this intended? Even if it is, disabling them should be an option.

@NovaDiablox
Copy link
Contributor

I believe some props are breaking themselves, it might be rolling bottles or something else.

@IlogicalKarma
Copy link
Author

Then why are they spawning balls? The config has them disabled. And what about the decoys?

@NovaDiablox
Copy link
Contributor

Interesting @Vinzuerio take a look at this please when you have time.

@NovaDiablox
Copy link
Contributor

I found a code that checks for "https://github.com/Wolvin-NET/prophuntx/blob/eedee1dee43c450187f45c89b3e4a6b7c7995695/gamemodes/prop_hunt/entities/entities/ph_devilball/init.lua#L59C2-L59C129" isplayer and inround. It may be only disabling them for player actions if the map itself breaks it, it may not count.

@NovaDiablox
Copy link
Contributor

Do they respawn randomly or in place of props?

@NovaDiablox
Copy link
Contributor

Also map description mentions "Prop Hunt: X2Z Settings: Item Spawner: Yes, Decoys on Spawn: Yes"

@IlogicalKarma
Copy link
Author

They spawn randomly from what I've seen. In other words, the map forces these settings?

@NovaDiablox
Copy link
Contributor

NovaDiablox commented Sep 3, 2024

They spawn randomly from what I've seen. In other words, the map forces these settings?

Probably, the description is a little vague about that. Item may be weapons ammo or "balls". I'm not sure.

@IlogicalKarma
Copy link
Author

It seems like a plausible explanation. The other map that had this issue was ph_underwataaa.
Convenient link: https://steamcommunity.com/sharedfiles/filedetails/?id=224680268&searchtext=underwataaa

@IlogicalKarma
Copy link
Author

If that is the case, then perhaps another 2 settings that disable spawning right in ph_decoy_spawner.lua and ph_teamitem_spawner.lua might do the trick?

@IlogicalKarma
Copy link
Author

For now I just hardcoded makeEntity and CreateBall and it seems to work. Please look into this matter if you have time. I do not have the time to learn the repository, nor to get the hang of LUA. I might try to make a better fix for this in the future if nobody else does. Either way, thanks for the quick responses. I will be here to answer any other questions that might come up.

@IlogicalKarma
Copy link
Author

For some reason the decoys still spawned on underwataaa. I hardcoded some stuff in ph_fake_prop.lua and it's fine now.

@NovaDiablox
Copy link
Contributor

Nice, I hope it fixed things.

@Vinzuerio Vinzuerio added enhancement New feature or request Complexity: Low Should be fixed shortly. labels Sep 26, 2024
@Vinzuerio
Copy link
Collaborator

Sorry just checked the issue today (I have very terrible equipment problem on my end so i have to use my friends pc to check) and should this get fixed within 1 or 2 weeks ahead, including from my maps that has been in workshop too.

@Vinzuerio
Copy link
Collaborator

I have made a quick update using on my friend pc as a GitHub Release 18553e3 (workshop version will be catched up later) where lucky bals, devil crystal and decoys will respect their spawn with the following convars:
ph_enable_decoy_reward 0 and ph_enable_team_itemspawner 0. For ConVar ph_enable_team_itemspawner you must set this manually through a console so it's better to write this command in your server's config.cfg file.

Some PH:X Maps that use a forced decoy spawn will be updated late (because I haven't to get my maps on my pc) so as for your temporary workaround as follow:

  1. Create a lua file in lua/autorun/server/phx_decoy_removal.lua
  2. Paste these code
hook.Add("PostCleanupMap", "DecoyMapCleaner", function()
	timer.Simple(2, function()
		-- Clear all map-spawned decoys
		if not GetConVar("ph_enable_decoy_reward"):GetBool() then
			for _,decoy in ipairs( ents.FindByClass( "ph_fake_prop" ) ) do
				decoy:Remove()
			end
		end
	end)
end)
  1. Save and Restart your map.

A a reminder, Once the workshop has been updated, delete this file after updating.

Let me know if this solved the issue. (Please do not close the issue until workshop version is updated)

@IlogicalKarma
Copy link
Author

Thx for the response. I did manage to get it "fixed" by commenting out whatever functions I could see in the previously mentioned lua files. I kept the declarations to avoid errors. Please do not judge my less than ideal solution. Please let me know when the maps are updated so I can go back to the normal version.

@IlogicalKarma
Copy link
Author

The project should have specific functions for map makers to use that check the settings before spawning balls or decoys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complexity: Low Should be fixed shortly. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants