AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved [HELP] Destroying 2 Bomb Sites (https://forums.alliedmods.net/showthread.php?t=326018)

hellmonja 07-15-2020 11:16

[HELP] Destroying 2 Bomb Sites
 
I'm trying to make a new game mode where you have to destroy both bomb sites. Currently I'm doing preliminary testing, using Infinite Round to prevent the round ending, and a small plugin using fun to give myself a second C4 after the 1st one blows up.

The trouble is when the 1st one explodes and I spawn the 2nd C4 but I can't plant it on the other site, giving me the message that the C4 has to be planted on site. The game seems to disable the site when a C4 has exploded. Is there a way to prevent this or reactivate the site for a second bombing?...

DJEarthQuake 07-15-2020 11:47

Re: [HELP] Destroying 2 Bomb Sites
 
Best bet look at existing plugins like 'Plant Anywhere 2' to see how to do it.

hellmonja 07-15-2020 11:49

Re: [HELP] Destroying 2 Bomb Sites
 
Quote:

Originally Posted by DJEarthQuake (Post 2710201)
Best bet look at existing plugins like 'Plant Anywhere 2' to see how to do it.

Great thanks! I did remember such a plugin but I forgot what's it called. Thanks for reminding me...

HamletEagle 07-15-2020 11:49

Re: [HELP] Destroying 2 Bomb Sites
 
For these kinds of things, ReGameDLL is your friend. See what happens when the bomb explodes and undo it.

hellmonja 07-15-2020 12:01

Re: [HELP] Destroying 2 Bomb Sites
 
Quote:

Originally Posted by HamletEagle (Post 2710203)
For these kinds of things, ReGameDLL is your friend. See what happens when the bomb explodes and undo it.

Hmm, not familiar with ReGameDLL but I will find it anyway. It sounds like a very useful thing. Thank you for the info, sensei...

HamletEagle 07-15-2020 15:08

Re: [HELP] Destroying 2 Bomb Sites
 
https://github.com/s1lentq/ReGameDLL...regamedll/dlls
I'm not saying to run regamedll, probably my previous post wasn't clear. You should look at the source code and figure out what happens that blocks the other bombsite, then undo that.

I may give it a try, but I can't promise it will be soon. You can start from ShootSatchelCharge function which creates the C4 and C4Think function that's the function for c4 entity thinking. It should have a check for when the bomb should explode and you can go from there, checking what other functions are called and trying to make sense of the code, see what happens when. It may look hard at first, but if you get used to it, it will help you a ton in the future.

hellmonja 07-15-2020 22:26

Re: [HELP] Destroying 2 Bomb Sites
 
I pray you would be patient because, frankly, this is delving into unknown territory for me. So I assume this is C++ and I need an IDE to open it?...

ZaX 07-16-2020 00:22

Re: [HELP] Destroying 2 Bomb Sites
 
You can open the file in github and check it, or download it and use any editor.

hellmonja 07-17-2020 12:51

Re: [HELP] Destroying 2 Bomb Sites
 
PHP Code:

register_logevent("Event_C4_Planted"3"2=Planted_The_Bomb")
...
public 
Event_C4_Planted()
{
    return 
PLUGIN_HANDLED


Alright, solved it with this. It even works on rare maps with 3 bombsites like de_drastic. I admit I haven't gotten far studying ReGamedll; it's kinda overwhelming for me, might take me days or weeks to get accustomed to it. But since I'm working on a big CS project I see the value of learning its code so I will try to keep on it when I have time. Thank you, everyone! I really appreciate being introduced to ReGamedll. This might be my chance to delve deeper into programming...

HamletEagle 07-19-2020 14:22

Re: [HELP] Destroying 2 Bomb Sites
 
Quote:

Originally Posted by hellmonja (Post 2710499)
PHP Code:

register_logevent("Event_C4_Planted"3"2=Planted_The_Bomb")
...
public 
Event_C4_Planted()
{
    return 
PLUGIN_HANDLED


Alright, solved it with this.

Are you sure this is what actually solved it? With register_logevent you just catch a log message, it's not the actual bomb planted function. Also superceding Event_C4_Planted shouldn't do anything.
I didn't dig into this, there may be some weird things like some part of the game/client code relying on that log, but that would be kinda silly tbh.


All times are GMT -4. The time now is 13:52.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.