#base robot_giant.pop #base robot_standard.pop WaveSchedule { StartingCurrency 1500 RespawnWaveTime 2 CanBotsAttackWhileInSpawnRoom not // Example lua script. This script is parsed once when the game switches to this mission, or map reset vote is called (But not when the wave switches) // scripts/globals.lua is always parsed before other scripts // You can also look at scripts/library.lua for available API functions // The mod uses lua version 5.4 . Lua Programming guide: https://www.lua.org/pil/1.html . Quick Reference available at https://www.lua.org/manual/5.4/ // A single LuaScript block can contain up to 4095 characters, otherwise the scripts must be split into separate blocks LuaScript { Script " -- Called every time wave is reset to starting point (When losing, or winning too when the reverse winning mode is active). Also called after mission is loaded function OnWaveReset(wave) print('wave reset', wave) end -- Called when the between waves stage begins. This is called after wave success/fail, and after the mission load function OnWaveInit(wave) print('wave init', wave) end -- Called after wave success. Wave parameter is the next wave number function OnWaveSuccess(wave) print('wave success', wave) end -- Called after wave fail, after reset function OnWaveFail(wave) print('wave fail', wave) end -- Called when wave starts function OnWaveStart(wave) print('wave start', wave) end -- Called when the wave spawns a bot, after the bot is initialized with key values function OnWaveSpawnBot(bot, wave, tags) print('wave spawn bot' .. tostring(bot:IsValid()) .. wave .. #tags) PrintTable(tags) end -- Called when the wave spawns a tank, after the tank is initialized with key values function OnWaveSpawnTank(tank, wave) print('wave spawn tank', tank, wave) end -- Called when the wave spawns bot at location, can be used to override spawn position function GetWaveSpawnLocation(name) print('GetWaveSpawnLocation', name) if name == 'spawnbot_tp' then return SPAWN_LOCATION_TELEPORTER, Vector(0,0,1200) end end " Script " -- Called when a player or bot joins the game. Also called once for every player that joined before the mission began function OnPlayerConnected(player) print('player join', tostring(player)) player:AddCallback(ON_REMOVE, function(ent) print('Player remove '..tostring(ent)) end) player:AddCallback(ON_SPAWN, function(ent) print('Player spawn '..tostring(ent)) ent.m_iRevengeCrits = 5 ent.m_iAmmo[1] = 4 --Do note that arrays in Lua are indexed starting from 1 end) player:AddCallback(ON_ACTIVATE, function(ent) print('Player activate '..tostring(ent)) end) player:AddCallback(ON_DAMAGE_RECEIVED_PRE, function(ent, damage) print('Player damaged pre '..tostring(ent)); PrintTable(damage); damage.Damage=0; return true; end) player:AddCallback(ON_DAMAGE_RECEIVED_POST, function(ent, damage, previousHealth) print('Player damaged post '..tostring(ent)); PrintTable(damage) end) player:AddCallback(ON_INPUT, function(ent, name, activator, caller, value) print('Player input '..tostring(ent)..' '..name..' '..tostring(activator)..' '..tostring(caller)..' '..tostring(value)) end) player:AddCallback(ON_OUTPUT, function(ent, name, activator, value) print('Player output '..tostring(ent)..' '..name..' '..tostring(activator)..' '..tostring(value)); end) player:AddCallback(ON_KEY_PRESSED, function(ent, key) print('Player key press '..tostring(ent)..' '..key) end) player:AddCallback(ON_KEY_RELEASED, function(ent, key) print('Player key release '..tostring(ent)..' '..key); end) player:AddCallback(ON_DEATH, function(ent, damage) print('Player death '..tostring(ent)); end) player:AddCallback(ON_TOUCH, function(ent, other, pos, normal) print('Player touch '..tostring(ent)..' '..tostring(other)..' '..tostring(pos)..' '..tostring(normal)) end) player:AddCallback(ON_START_TOUCH, function(ent, other, pos, normal) print('Player start touch '..tostring(ent)..' '..tostring(other)..' '..tostring(pos)..' '..tostring(normal)) end) player:AddCallback(ON_END_TOUCH, function(ent, other, pos, normal) print('Player end touch '..tostring(ent)..' '..tostring(other)..' '..tostring(pos)..' '..tostring(normal)) end) player:AddCallback(ON_SHOULD_COLLIDE, function(ent, other, cause) print('Player collide '..tostring(ent)..' '..tostring(other)..' '..tostring(cause == ON_SHOULD_COLLIDE_CAUSE_FIRE_WEAPON)) end) player:AddCallback(ON_EQUIP_ITEM, function(ent, weapon) weapon:AddCallback(ON_FIRE_WEAPON_PRE, function(weapon) print('fire weapon pre '..tostring(weapon)) end) end) AddEventCallback('player_death', function(event) PrintTable(event); event.crit_type=2; event.weapon = 'fdfs'; event.assister = event.attacker; return ACTION_MODIFY end) end -- Called when a player or bot leaves the game function OnPlayerDisconnected(player) print('player disconnect', player) end -- Called on every game tick (every 0.015 ms) function OnGameTick() print('time '..CurTime()) end -- Adds entity creation callbacks ents.AddCreateCallback('obj_sentry*', function(ent) print('CREATED2: '..tostring(ent)) end); ents.AddCreateCallback('player', function(ent) print('CREATED: '..tostring(ent)) end); -- Adds a timer that fires every 0.5 seconds timer.Create(0.5, function() ents.FindByName('intel').a = {4,3} end, 0) " File "script/somefile.lua" //Example name for lua script file } [$SIGSEGV] WaveStartCountdown 1 [$SIGSEGV] //WAVE 1 //Currency 1300 /////////////////////////////////////////////////////////////////////////////////////////////////////// Wave { StartWaveOutput { Target wave_start_relay Action Trigger } DoneOutput { Target wave_finished_relay Action trigger } WaitWhenDone 65 Checkpoint Yes // Spy mission - 4 active // Sniper mission - 2 active WaveSpawn //WAVE 01a: 36 total, 18 active, Scout (bonk) + crit soldier { Name "wave01a" Where spawnbot TotalCount 36 MaxActive 18 SpawnCount 6 WaitBeforeStarting 4 WaitBetweenSpawns 5 TotalCurrency 300 Squad { TFBot { Class Scout Skill Easy } TFBot { Class Scout Skill Easy } TFBot { Template T_TFBot_Scout_Bonk } TFBot { Tag lol Template T_TFBot_Scout_Bonk } TFBot { Tag lol Template T_TFBot_Scout_Bonk } TFBot { Tag lol Class Soldier Skill Expert Attributes AlwaysCrit ItemAttributes { ItemName "TF_WEAPON_ROCKETLAUNCHER" "faster reload rate" -0.8 "fire rate bonus" 0.6 } } } } WaveSpawn //WAVE 01b: [GIANT] 4 total, 3 active, Soldier (rapid fire) { Name "wave01b" Where spawnbot TotalCount 4 MaxActive 4 SpawnCount 1 WaitBeforeStarting 45 WaitBetweenSpawns 60 TotalCurrency 300 TFBot { Template T_TFBot_Giant_Soldier_Spammer Tag lol } } WaveSpawn //WAVE 01c: 40 total, 20 active, Heavy (crit) + uber medic + 3 Pyros (WAITFORALLDEAD "WAVE01A") { Name "wave01c" Where spawnbot TotalCount 40 MaxActive 20 SpawnCount 5 WaitForAllDead "wave01a" WaitBeforeStarting 30 WaitBetweenSpawns 15 TotalCurrency 350 Squad { TFBot { Class Heavyweapons Skill Easy Attributes AlwaysCrit } TFBot { Template T_TFBot_Medic_QuickUber } TFBot { Class Pyro Skill Easy } TFBot { Class Pyro Skill Easy } TFBot { Class Pyro Skill Easy } } } WaveSpawn //WAVE 01d: 40 total, 22 active, Scout (crit bats) (WAITTFORALLSPAWNED "WAVE01C") { Name "wave01d" Where spawnbot TotalCount 40 MaxActive 22 SpawnCount 8 WaitForAllSpawned "wave01c" WaitBeforeStarting 0 WaitBetweenSpawns 0 TotalCurrency 350 TFBot { Class Scout Skill Easy WeaponRestrictions MeleeOnly Attributes AlwaysCrit } } } }