AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Solved [L4D2] Tank Spawn Announcement with sound (versus) (https://forums.alliedmods.net/showthread.php?t=330277)

Tank Rush 01-27-2021 14:52

[L4D2] Tank Spawn Announcement with sound (versus)
 
I am looking for a plugin that works as follows:
When the tank spawns, it announces itself in chat by making a sound
Here the sound:
sound/ui/pickup_secret01.wav
Here is the announcement of the chat:
[!]The Tank has been spawned!

Marttt 01-27-2021 17:39

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
1 Attachment(s)
Try this

Spoiler

Tank Rush 01-27-2021 22:11

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734544)
Try this

Spoiler

No errors, this works :D
thanks Marttt!

video demonstration

King_OXO 01-28-2021 12:47

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734544)
Try this

Spoiler

could create a plugin, in which when a SuperTank appears, a green ad will appear in the chat saying what type of SuperTank will appear and Tank’s life

for example:

[SUPER TANKS] Fire Tank (40000HP)

Marttt 01-28-2021 15:33

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
I really don't recommend using Super Tanks, the plugin is old, the author is inactive and has a lot of versions in the thread.

Try Mutant Tanks plugin.

At least the author is active, always nice and helping. Also seem to have the feature you are asking for.

Btw, if you share your SUPER TANKS plugin .sp file I can try to implement it since I don't know which file you are using. (The main post doesn't compile and Ernecio version gives me invalid gamedata)

King_OXO 01-28-2021 20:43

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
1 Attachment(s)
here's the supertanks plugin for versus and coop, now you can modify or place what I asked for the tank spawn announcement

sourcemod 1.10 or high

Marttt 01-28-2021 22:15

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
1 Attachment(s)
Ok try this version.

It will output the HP 1 second after spawn (this may fix some other plugins messing with tank HP)

Btw if is not enough you can increase or decrease the timer

Check for "TankSpawnHPTimer"

King_OXO 01-29-2021 09:59

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
thank you very much, helped a lot

I saw your "Random tank rock" plugin
do you have a version in which the tank launches cars, large logs, giant stones and that giant ball and they are not destroyed?

Marttt 01-29-2021 10:26

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Yes I have a private version, based on some users modifications
But is not finished yet. I will try to publish it on this or next week.

My version doesn't throw those entities and let then on the map (it can crash the server it spawns a lot)
But I can check this request either.

I think mutant tanks plugin (as always) has this option already.

King_OXO 01-29-2021 12:14

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
the server does not crash, I played on a server called Legacy and the tank launched entities that I said and did not crash

Marttt 01-29-2021 13:02

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Yeah what I mean is that if no proper checks are made, is possible to crash the server. (like deleting the entity after X seconds to prevent No Free Edicts)

King_OXO 01-29-2021 15:38

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734815)
Yeah what I mean is that if no proper checks are made, is possible to crash the server. (like deleting the entity after X seconds to prevent No Free Edicts)

OK, got it

sorry for making you waste your time

Tank Rush 01-29-2021 18:17

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Hi Marttt, I have noticed that when the Tank bot spawns the tank ad appears in the chat, a few seconds pass, the player takes control of the tank and the chat ad appears again, it should appear once.

Marttt 01-29-2021 19:14

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
1 Attachment(s)
@TankRush, well try this one attached.

If it doesn't work you can try the one that Zonemod uses here.

Also in finales, it may work only for the first tank I think.

I didn't find a way to know when a tank passes the control from the last time I tried.

Tank Rush 01-29-2021 20:49

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734852)
@TankRush, well try this one attached.

If it doesn't work you can try the one that Zonemod uses here.

Also in finales, it may work only for the first tank I think.

I didn't find a way to know when a tank passes the control from the last time I tried.

Your plugin works, the problem is in the final maps, it is only announced for the first tank of the first wave, but in the other waves it is no longer announced.

The Zonemod version does not emit sound, neither does the {red} color work

Tank Rush 01-30-2021 09:49

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734868)
Try this.

Sorry to bother you Marttt, but this keeps failing. The ad appears in the first, second and third waves for survivors, I have tested it playing only with bots; but when there is a player on the infected team the ad only appears for the first tank on both teams.

HarryPotter 01-30-2021 11:39

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2734868)
Try this.

Try HookEvent "entity_killed"

PHP Code:

HookEvent("entity_killed",        PD_ev_EntityKilled);

public 
Action PD_ev_EntityKilled(Event event, const char[] namebool dontBroadcast)
{
    if (
g_bIsTankAlive && IsPlayerTank(event.GetInt("entindex_killed")))
    {
        
CreateTimer(1.5FindAnyTank_TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action FindAnyTank(Handle timerany client)
{
    if(!
IsTankInGame()){
        
g_bIsTankAlive false;
    }
}

void IsTankInGame(exclude 0)
{
    for (
int i 1<= MaxClientsi++)
        if (
exclude != && IsClientInGame(i) && GetClientTeam(i) == && IsPlayerTank(i) && IsPlayerAlive(i) && !IsIncapacitated(i))
            return 
i;

    return 
0;



Tank Rush 01-30-2021 13:18

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by HarryPotter (Post 2734956)
Try HookEvent "entity_killed"

PHP Code:

HookEvent("entity_killed",        PD_ev_EntityKilled);

public 
Action PD_ev_EntityKilled(Event event, const char[] namebool dontBroadcast)
{
    if (
g_bIsTankAlive && IsPlayerTank(event.GetInt("entindex_killed")))
    {
        
CreateTimer(1.5FindAnyTank_TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action FindAnyTank(Handle timerany client)
{
    if(!
IsTankInGame()){
        
g_bIsTankAlive false;
    }
}

void IsTankInGame(exclude 0)
{
    for (
int i 1<= MaxClientsi++)
        if (
exclude != && IsClientInGame(i) && GetClientTeam(i) == && IsPlayerTank(i) && IsPlayerAlive(i) && !IsIncapacitated(i))
            return 
i;

    return 
0;



I'm sorry, I don't know how to do it
you can help?

Marttt 01-30-2021 18:48

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
1 Attachment(s)
Testing in my local server, the previous script work in coop and in versus (with 1 player). When there is more than 1 player (and in different teams) the plugin stops to work in versus after first spawn (weird).

I rewrote the plugin, try this:

Spoiler

Tank Rush 01-30-2021 21:05

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2735022)
Try this:

Spoiler

This works, when compiling it gives 3 warnings, anyway I will be checking in logs if it presents any errors.

Marttt 01-31-2021 08:40

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
The warnings is because I left some code in the previous version to debug in case it didn't work (again).

Added a new version without warnings. You can download it above again.

Psyk0tik 01-31-2021 09:35

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Tank Rush (Post 2734529)
I am looking for a plugin that works as follows:
When the tank spawns, it announces itself in chat by making a sound
Here the sound:
sound/ui/pickup_secret01.wav
Here is the announcement of the chat:
[!]The Tank has been spawned!

I can't believe I haven't added this to Mutant Tanks yet. Thanks for the idea! :D

Quote:

Originally Posted by Marttt (Post 2734684)
I really don't recommend using Super Tanks, the plugin is old, the author is inactive and has a lot of versions in the thread.

Try Mutant Tanks plugin.

At least the author is active, always nice and helping. Also seem to have the feature you are asking for.

Btw, if you share your SUPER TANKS plugin .sp file I can try to implement it since I don't know which file you are using. (The main post doesn't compile and Ernecio version gives me invalid gamedata)

Thank you for the kind words. I wish there was a way to advertise Mutant Tanks to everyone who still relies on Super Tanks. Even with all the more recent versions of that plugin, most of the code is still outdated. I had to rewrite 90% of the logic in MT because the old code from ST was just causing way too many bugs and random crashes. Unfortunately, that's hard to explain to users who have no knowledge/experience in programming.

yabi 09-10-2021 13:56

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2735022)
Testing in my local server, the previous script work in coop and in versus (with 1 player). When there is more than 1 player (and in different teams) the plugin stops to work in versus after first spawn (weird).

I rewrote the plugin, try this:

Spoiler

I really need traditional characters><"
I don't know how to make

Marttt 09-10-2021 15:30

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
There is no translation in this plugin you just need overwrite the "text" part.
I may release it as a plugin. I had hope that in the recent L4D2 updates this issue would have already been solved.

BlackSabbarh 03-17-2022 16:47

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2757425)
There is no translation in this plugin you just need overwrite the "text" part.
I may release it as a plugin. I had hope that in the recent L4D2 updates this issue would have already been solved.

Hi, when I use multitank and spawn 3 or 4 tanks at the same time, the sound only plays 1 time, how could I fix it so that it sounds 1 time for each Tank?

Marttt 03-17-2022 17:21

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Just remove the check below

PHP Code:

    if (g_bAliveTank)
        return; 


BlackSabbarh 03-27-2022 19:51

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2774522)
Just remove the check below

PHP Code:

    if (g_bAliveTank)
        return; 



Thanks

cirno 04-21-2024 13:32

Re: [L4D2] Tank Spawn Announcement with sound (versus)
 
Quote:

Originally Posted by Marttt (Post 2735022)
Testing in my local server, the previous script work in coop and in versus (with 1 player). When there is more than 1 player (and in different teams) the plugin stops to work in versus after first spawn (weird).

I rewrote the plugin, try this:

Spoiler

Thank you very much for your plug-in


All times are GMT -4. The time now is 05:32.

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