Raised This Month: $51 Target: $400
 12% 

[TF2] Monoculus Spawner


Post New Thread Reply   
 
Thread Tools Display Modes
bluedemon
Junior Member
Join Date: Jan 2012
Old 03-20-2012 , 09:39   Re: [TF2] Monoculus Spawner
Reply With Quote #121

Quote:
Originally Posted by 11530 View Post
Just write a global counter into it, then check the counter is < 1 before executing.

Edit: A cvar for max spawns might be rather useful for this actually.
EDIT: I tried to put the entity in and change the 32 to 1 like in the horsemann plugin with no success.

Last edited by bluedemon; 03-20-2012 at 18:03.
bluedemon is offline
DarthNinja
SourceMod Plugin Approver
Join Date: Mar 2009
Location: PreThinkHook()
Old 03-20-2012 , 14:28   Re: [TF2] Monoculus Spawner
Reply With Quote #122

Don't edit code if you don't know what it does.
What 11530 said to do is not what you tried to do.
__________________

Last edited by DarthNinja; 03-20-2012 at 14:29.
DarthNinja is offline
bluedemon
Junior Member
Join Date: Jan 2012
Old 03-22-2012 , 20:42   Re: [TF2] Monoculus Spawner
Reply With Quote #123

Quote:
Originally Posted by DarthNinja View Post
Don't edit code if you don't know what it does.
What 11530 said to do is not what you tried to do.
Ok, as I said I tried and failed. Is there anyone who can help with this problem?
bluedemon is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 03-22-2012 , 22:10   Re: [TF2] Monoculus Spawner
Reply With Quote #124

Simple version - add a global variable:
Code:
new g_iCount = 0;
In GreatBallRockets add (first thing):
Code:
    if (g_iCount > 0)
    {
        PrintToChat(client, "[SM] Only one Monoculus allowed.");
        return Plugin_Handled;
    }
In the same function (GreatBallRockets) add after DispatchSpawn(entity); :
Code:
g_iCount++;
In OnPluginStart:
Code:
HookEvent("eyeball_boss_killed", BossKilled, EventHookMode_PostNoCopy);
HookEvent("eyeball_boss_escaped", BossEscaped, EventHookMode_PostNoCopy);
HookEvent("teamplay_round_start", OnRoundStart, EventHookMode_PostNoCopy);
Then make BossKilled, BossEscaped, and OnRoundStart:
Code:
public BossKilled(Handle:event, const String:name[], bool:dontBroadcast)
{
	g_iCount--;
}

public BossEscaped(Handle:event, const String:name[], bool:dontBroadcast)
{
	g_iCount--;
}

public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast) {
	g_iCount = 0;
}
Hopefully that works, since I'm pretty sleepy at the mo.

Edit: Compiled and works.
Edit2: If you want, you can combine the g_iCount functions into a single hook to save space.

Last edited by 11530; 04-05-2012 at 14:04.
11530 is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 04-05-2012 , 00:12   Re: [TF2] Monoculus Spawner
Reply With Quote #125

I've updated https://forums.alliedmods.net/showpo...&postcount=116 with what I hope fixes the issue it had. I can't test it right now.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.

Last edited by FlaminSarge; 04-05-2012 at 00:12.
FlaminSarge is offline
tatercrisp
SourceMod Donor
Join Date: Mar 2008
Location: Chicken Coop
Old 04-14-2012 , 14:39   Re: [TF2] Monoculus Spawner
Reply With Quote #126

wait what model y'all using
tatercrisp is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 04-14-2012 , 15:15   Re: [TF2] Monoculus Spawner
Reply With Quote #127

Monoculus: models/props_halloween/halloween_demoeye.mdl
Projectiles: models/props_halloween/eyeball_projectile.mdl
11530 is offline
danmon
Member
Join Date: Oct 2010
Old 04-20-2012 , 23:41   Re: [TF2] Monoculus Spawner
Reply With Quote #128

Quote:
L 04/20/2012 - 14:51:55: [SM] Native "HookEvent" reported: Game event "eyeball_boss_summoned" does not exist
L 04/20/2012 - 14:51:55: [SM] Displaying call stack trace for plugin "GreatBallofEyes.smx":
L 04/20/2012 - 14:51:55: [SM] [0] Line 31, GreatBallofEyes.sp::OnPluginStart()
This has been spamming my logs lately, is this an issue that is suppost to be fixed or something?
danmon is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 04-21-2012 , 15:20   Re: [TF2] Monoculus Spawner
Reply With Quote #129

Looks like outdated gamedata somewhere.
__________________
Bread EOTL GunMettle Invasion Jungle Inferno 64-bit will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, etc.
Post in plugin threads with questions.
Steam is for playing games.
You will be fed to javalia otherwise.
Psyduck likes replays.
FlaminSarge is offline
CuriousG
Senior Member
Join Date: Feb 2012
Old 04-22-2012 , 10:41   Re: [TF2] Monoculus Spawner
Reply With Quote #130

Is there a reason why monoculus doesn't shoot when he spawns in certain maps? I've used other custom maps and he shoots but when I tried it on cp_orange_x4 he spawns and is low enough where he should be seeing targets but never shoots. I can even walk right up to it and melee it to death.
CuriousG is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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