No Crit Pumpkins

VScript No Crit Pumpkins !

LizardOfOz

Hale's Own Programmer
aa
Sep 7, 2022
268
87
LizardOfOz submitted a new resource:

No Crit Pumpkins - No Crumpkins

Tired of the crit-granting pumpkin bags which drop from dead players during Halloween?

This script deletes Crit Pumpkins (aka Crumkins) immediately as they spawn before anyone can pick them up!

To make it work on your Halloween map, put this script into scripts/vscripts/ folder and create a logic_script entity with the following parameters:
Entity Script...........................no_crumpkins.nut
Script think function..........Think
And don't...

Read more about this resource...
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,697
2,581
Does it work even if they spawn right where a player is already standing?
 

LizardOfOz

Hale's Own Programmer
aa
Sep 7, 2022
268
87
LizardOfOz updated No Crit Pumpkins with a new update entry:

Bugfix

Fixed a bug that let crumpkins spawn during the first round.

Explanation:
CRUMPKIN_INDEX <- GetModelIndex("models/props_halloween/pumpkin_loot.mdl");
Apparently, TF2 loads the crumpkin model only when the first crumpkin gets dropped, meaning when the script starts at the beginning of the first round the model isn't loaded yet, GetModelIndex returned -1, and the script effectively didn't work until the second round.

Replacing GetModelIndex with...

Read the rest of this update entry...
 
Sep 29, 2015
81
25
I've been playing around with this serverside (running a separate script to spawn an info_target entity with the parameters the script requires) and it seems like it's still possible for players to get crumpkins if they're standing close enough to a teammate as they're killed. I've been streaming with the script running on my server but I need to scrub through the footage to find an instance of it occurring still.

Overall, still a massive improvement - way better than crumpkins all over the place when we don't want them!

EDIT: In case anyone else wants to use this serverside like I do, use the following script in mapspawn.nut (or another script named "whatever.nut," then use "script_execute whatever.nut" in server.cfg):
Code:
SpawnEntityFromTable("info_target", {
    vscripts = "no_crumpkins.nut",
    thinkfunction = "Think"
});
 
Last edited:

LizardOfOz

Hale's Own Programmer
aa
Sep 7, 2022
268
87
I've been playing around with this serverside (running a separate script to spawn an info_target entity with the parameters the script requires) and it seems like it's still possible for players to get crumpkins if they're standing close enough to a teammate as they're killed. I've been streaming with the script running on my server but I need to scrub through the footage to find an instance of it occurring still.

Overall, still a massive improvement - way better than crumpkins all over the place when we don't want them!
Hm. Sounds like the entity order (logic_script vs crumpkins) has an impact on this. Will investigate.
 

LizardOfOz

Hale's Own Programmer
aa
Sep 7, 2022
268
87
LizardOfOz updated No Crit Pumpkins with a new update entry:

Bugfix

Apparently if a crumpkin spawns right next to a player, it can get picked up before the script has a chance to get executed within the same tick.
To address this, we not remove the TF_COND_CRITBOOSTED_PUMPKIN condition from players every tick in addition. Not the most elegant solution, but shouldn't have any measurable performance impact.

Read the rest of this update entry...