-- Floating Item Spawner v4 by Ashnal -- This script is designed to be repacked with map pk3s/wads, but otherwise not modified. If you need it modified (for example if the map thing number conflicts with something else), please let me know. -- Literally just spits out floating papersprite items (the ones that you drop when exploded) at the location of its spawnpoint, similar to an item box -- Thing number is 1777. Parameter in ZoneBuilder +1 is the item type, corresponding to the kartdebugitem list, or a list below for reference -- Angle is the amount to give, anything over 255 will cap the amount to 255, 0 will result in 1. Otherwise, angle shown in ZB = amount. -- Setting the AMBUSH flag will cause the spawned floating item to have no gravity and stay in place -- Setting the SPECIAL flag will cause the spawner to only ever spawn one item, creating a one time pickup -- Setting the EXTRA flag will ensure that a player can never pick up more than the amount designated from the pickup. -- For example, if you put 3 spawners near each other that give a player 2 sneakers and set EXTRA on them, they will gain 2 sneaker on the first one they drive over, but then if they drive over another, they will be unable to collect them -- If a player has some of the given item, but not as many as you've set on the spawner, they will be given up to the amount specified -- Floating items behave as the normal in game one, including sliding down physics slopes and gravity (if you dont set Ambush flag) /* Sneaker 0 Rocket Sneaker 1 Invincibility 2 Banana 3 Eggman 4 Orbinaut 5 Jawz 6 Mine 7 Ballhog 8 Self-Propelled Bomb 9 Grow 10 Shrink 11 Lightning Shield 12 Hyudoro 13 Pogo Spring 14 Kitchen Sink 15 */ if not floatingitemspawner then rawset(_G, "floatingitemspawner", true) else return end local FRACUNIT = FRACUNIT local MT_FLOATINGITEM = MT_FLOATINGITEM local MF_NOGRAVITY = MF_NOGRAVITY local MTF_AMBUSH = MTF_AMBUSH local MTF_OBJECTSPECIAL = MTF_OBJECTSPECIAL local MF_NOCLIPTHING = MF_NOCLIPTHING local MF2_NIGHTSPULL = MF2_NIGHTSPULL local INT32_MAX = INT32_MAX local ANG1 = ANG1 local ANGLE_90 = ANGLE_90 local MTF_EXTRA = 1 -- Doesnt exist as a real flag in source code, but exists in ZB freeslot("MT_FLOATINGITEMSPAWNER") mobjinfo[MT_FLOATINGITEMSPAWNER] = { --$Name Floating Item Spawner --$Sprite ITMOALAR --$Category Ashnal Mapping Tools doomednum = 1777, spawnstate = S_INVISIBLE, flags = MF_NOCLIP|MF_NOGRAVITY|MF_DONTENCOREMAP|MF_NOBLOCKMAP|MF_NOCLIPTHING } addHook("MobjSpawn", function(mo) mo.cooldown = 0 end, MT_FLOATINGITEMSPAWNER) local function touched(special, toucher) end addHook("TouchSpecial", touched, MT_FLOATINGITEM) local xitemhooked = false local basecooldown = 5*TICRATE/2 local threshold addHook("MobjThinker", function(mo) end, MT_FLOATINGITEMSPAWNER)