Skip to content

Commit

Permalink
added new compile script, added constant for canteen plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
higps committed Feb 18, 2024
1 parent fe88442 commit 157798e
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 2_deploy.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$sourcemodDir = "D:\sourcemod\addons\sourcemod"
$spcompPath = "$sourcemodDir\scripting\spcomp.exe"
$spcompPath = "$sourcemodDir\scripting\spcomp64.exe"
$pluginsPath = "$sourcemodDir\plugins"
$defaultArguments = "-i 'D:\Github\robogithub\include' -i 'D:\sourcemod-custom-includes' -O2 -v2"

Expand Down
62 changes: 62 additions & 0 deletions 3_deploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
$sourcemodDir = "D:\sourcemod\addons\sourcemod"
$spcompPath = "$sourcemodDir\scripting\spcomp64.exe"
$pluginsPath = "$sourcemodDir\plugins"
$defaultArguments = "-i 'D:\Github\robogithub\include' -i 'D:\sourcemod-custom-includes' -O2 -v2"

# Specify the root folder explicitly
$rootFolder = $PSScriptRoot
$spFiles = Get-ChildItem -Path $rootFolder -Filter "*.sp" -File

foreach ($spFile in $spFiles) {
# Your filtering conditions go here...
if ($spFile.Name -like "*joke*" -or
$spFile.Name -like "*test*" -or
$spFile.Name -like "*dont_compile*" -or
$spFile.Name -like "*don_compile*" -or
$spFile.Name -eq "changeteam.sp" -or
$spFile.Name -eq "enablemvm.sp") {
continue
}

$outputPath = ""

if ($spFile.Name -like "berobot_*.sp") {
$outputPath = Join-Path -Path $rootFolder -ChildPath "compiled\mm_handlers\$($spFile.BaseName).smx"
} elseif ($spFile.Name -like "ability_*.sp") {
$folderPath = Join-Path -Path $rootFolder -ChildPath "compiled\mm_robots\robot_abilities"
$outputPath = Join-Path -Path $folderPath -ChildPath $spFile.Name
} elseif ($spFile.Name -like "free_*.sp" -or $spFile.Name -like "paid_*.sp" -or $spFile.Name -like "boss_*.sp") {
$folderPath = Join-Path -Path $rootFolder -ChildPath "compiled\mm_robots"
$outputPath = Join-Path -Path $folderPath -ChildPath $spFile.Name
} elseif ($spFile.Name -like "mm_*.sp") {
$folderPath = Join-Path -Path $rootFolder -ChildPath "compiled\mm_attributes"
$outputPath = Join-Path -Path $folderPath -ChildPath $spFile.Name
} else {
# If the file does not match any specific condition, skip it
continue
}

# Create the necessary folders if they don't exist
if (-not (Test-Path -Path $folderPath)) {
New-Item -ItemType Directory -Path $folderPath -Force
}

$arguments = "$($spFile.FullName) -o=$outputPath $defaultArguments"
$command = "$spcompPath $arguments"

Write-Host $command
Invoke-Expression $command
if ($LASTEXITCODE -ne 0) {
Write-Host "Compilation failed for $($spFile.FullName)"
exit
}
Write-Host ""

# Check if the output file exists before attempting to copy
if (Test-Path -Path $outputPath) {
# Copy the compiled file to the plugins directory
Copy-Item -Path $outputPath -Destination $pluginsPath
} else {
Write-Host "Output file $($outputPath) does not exist. Skipping copying to plugins directory."
}
}
2 changes: 1 addition & 1 deletion boss_saxtron_h4l3.sp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public OnPluginStart()
restrictions.TeamCoins = new RobotCoinRestrictionDefinition();
restrictions.TeamCoins.Overall = 1;
restrictions.RobotCoins = new RobotCoinRestrictionDefinition();
restrictions.RobotCoins.PerRobot = 3.0;
restrictions.RobotCoins.PerRobot = 30.0;

AddRobot(robot, MakeGiantSoldier, PLUGIN_VERSION, restrictions, 2);

Expand Down
1 change: 1 addition & 0 deletions cfg/robots/paid_spy_warper.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"death" "mvm/sentrybuster/mvm_sentrybuster_explode.wav"
"loop" "mvm/giant_heavy/giant_heavy_loop.wav"
"spawn" "#mvm/giant_heavy/giant_heavy_entrance.wav"
"footstep" "1"
}
"scale" "1.65"
"player_conditions"//You can use https://sm.alliedmods.net/new-api/tf2/TFCond to see what cond is which
Expand Down
1 change: 1 addition & 0 deletions mm_attributes_canteen.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <tf2attributes>
#include <tf_custom_attributes>
#include <stocksoup/var_strings>
#include <berobot_constants>
#include <berobot>
#pragma semicolon 1
#pragma newdecls required
Expand Down
2 changes: 1 addition & 1 deletion paid_sentry_buster_mvm.sp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define ROBOT_SUBCLASS "Sentry Buster"
#define ROBOT_DESCRIPTION "Touch sentries to blow up"
#define ROBOT_TIPS "Hit enemies, touch sentries, or taunt to activate the explosion"
#define ROBOT_COST 1.0
#define ROBOT_COST 10.0
#define ROBOT_ON_DEATH "You can hide behind buildings to not get blown up by the explotion\nThe explosion is faster than regular mvm\nTouching the buster with a sentry will cause it to blow up"
#define GBUSTER "models/bots/demo/bot_sentry_buster.mdl"
#define SPAWN "#mvm/sentrybuster/mvm_sentrybuster_intro.wav"
Expand Down

0 comments on commit 157798e

Please sign in to comment.