add script to publish

This commit is contained in:
Sir Papate 2023-08-13 13:12:49 -04:00
parent 5495641788
commit 6a493cc087
7 changed files with 84 additions and 64 deletions

17
.gitattributes vendored
View File

@ -1,17 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

1
.gitignore vendored
View File

@ -1,2 +1 @@
*.txt
*.cmd

View File

@ -1,3 +1,6 @@
[comment]: <> (## For more information, go to the [GitHub Page][GitHub Page])
[comment]: <> (To convert this file in Steam format, use this website: https://steamdown.vercel.app/)
# DamageCore
DamageCore is an extension module for the Wire Expression 2 Chip. It enables players to detect and/or deal damage to other entities.
@ -19,61 +22,62 @@ Clone this repository into your `steamapps\common\GarrysMod\garrysmod\addons` fo
| Declaration | Replacing | Description |
|-----------------------------------------------------|------------------------------------------------|-------------------------------------------------------------------------------------------------|
| `event damage(Victim:entity, Damage:damage)` | runOnDmg, dmgClk, lastDamage, lastDamageVictim | Triggered when an entity takes damage. |
| `event trackedDamage(Victim:entity, Damage:damage)` | | Triggered when an entity in the list of tracked (with `E:trackDamage()`) entities takes damage. |
| `event playerDamage(Victim:entity, Damage:damage)` | | Triggered when a player takes damage. |
| event damage(Victim:entity, Damage:damage) | runOnDmg, dmgClk, lastDamage, lastDamageVictim | Triggered when an entity takes damage. |
| event trackedDamage(Victim:entity, Damage:damage) | | Triggered when an entity in the list of tracked (with "E:trackDamage()") entities takes damage. |
| event playerDamage(Victim:entity, Damage:damage) | | Triggered when a player takes damage. |
### Tick Functions
| Function | Return | Description |
|------------------------------|:------:|-----------------------------------------------------------------------------------------|
| `runOnDmg(N)` | | If set to 1, E2 will run when an entity takes damage. |
| `runOnDmg(N,E)` | | If set to 1, E2 will run when specified entity takes damage. |
| `runOnDmg(N,R)` | | If set to 1, E2 will run when specified entities take damage. |
| `E:trackDamage()` | | E2 will run when the specified entity takes damage. |
| `T:trackDamage()` | | E2 will run when the specified entities take damage. |
| `E:stopTrackDamage()` | | E2 will no longer run when the specified entity takes damage. |
| `R:stopTrackDamage()` | | E2 will no longer run when the specified entities take damage. |
| `getDamageTrackedEntities()` | R | Returns a array of all tracked entities. |
| `E:isDamageTracked()` | N | Returns 1 if the entity is tracked. Returns 0 otherwise. |
| `dmgClk()` | N | Returns 1 if the chip is being executed because of a damage event. Returns 0 otherwise. |
| `lastDamage()` | XDM | Returns the last damage. |
| `lastDamageVictim()` | E | Returns the victim of the last damage. |
| runOnDmg(N) | | If set to 1, E2 will run when an entity takes damage. |
| runOnDmg(N,E) | | If set to 1, E2 will run when specified entity takes damage. |
| runOnDmg(N,R) | | If set to 1, E2 will run when specified entities take damage. |
| E:trackDamage() | | E2 will run when the specified entity takes damage. |
| T:trackDamage() | | E2 will run when the specified entities take damage. |
| E:stopTrackDamage() | | E2 will no longer run when the specified entity takes damage. |
| R:stopTrackDamage() | | E2 will no longer run when the specified entities take damage. |
| getDamageTrackedEntities() | R | Returns a array of all tracked entities. |
| E:isDamageTracked() | N | Returns 1 if the entity is tracked. Returns 0 otherwise. |
| dmgClk() | N | Returns 1 if the chip is being executed because of a damage event. Returns 0 otherwise. |
| lastDamage() | XDM | Returns the last damage. |
| lastDamageVictim() | E | Returns the victim of the last damage. |
### Damage Type
| Function | Return | Description |
|---------------------------|:------:|-------------------------------------------------------------------------|
| `damage()` | XDM | Makes an empty damage. |
| `XDM:clone()` | XDM | Returns a copy of the damage. |
| `XDM:toTable()` | T | Converts the damage into a table. |
| `XDM:getDamage()` | N | Returns the damage amount. |
| `XDM:getAttacker()` | E | Returns the attacker of damage. |
| `XDM:getForce()` | V | Returns a vector representing the damage force. |
| `XDM:getPosition()` | V | Returns the position where the damage was or is going to be applied to. |
| `XDM:getType()` | N | Returns a bitflag which indicates the damage type of the damage. |
| `XDM:getInflictor()` | E | Returns the inflictor of the damage. This is not necessarily a weapon. |
| `XDM:isBulletDamage()` | N | Returns 1 if the damage was caused by a bullet. |
| `XDM:isExplosionDamage()` | N | Returns 1 if the damage contains explosion damage. |
| `XDM:isFallDamage()` | N | Returns 1 if the damage contains fall damage. |
| `XDM:setDamage(N`) | XDM | Sets the amount of damage. Returns itself. |
| `XDM:setAttacker(E`) | XDM | Sets the attacker of the damage. Returns itself. |
| `XDM:setForce(V`) | XDM | Sets the directional force of the damage. Returns itself. |
| `XDM:setPosition(V`) | XDM | Sets the position of where the damage gets applied to. Returns itself. |
| `XDM:setType(N`) | XDM | Sets the damage type. Returns itself. |
| `XDM:setInflictor(E`) | XDM | Sets the inflictor of the damage for example a weapon. Returns itself. |
| damage() | XDM | Makes an empty damage. |
| XDM:clone() | XDM | Returns a copy of the damage. |
| XDM:toTable() | T | Converts the damage into a table. |
| XDM:getDamage() | N | Returns the damage amount. |
| XDM:getAttacker() | E | Returns the attacker of damage. |
| XDM:getForce() | V | Returns a vector representing the damage force. |
| XDM:getPosition() | V | Returns the position where the damage was or is going to be applied to. |
| XDM:getType() | N | Returns a bitflag which indicates the damage type of the damage. |
| XDM:getInflictor() | E | Returns the inflictor of the damage. This is not necessarily a weapon. |
| XDM:isBulletDamage() | N | Returns 1 if the damage was caused by a bullet. |
| XDM:isExplosionDamage() | N | Returns 1 if the damage contains explosion damage. |
| XDM:isFallDamage() | N | Returns 1 if the damage contains fall damage. |
| XDM:setDamage(N) | XDM | Sets the amount of damage. Returns itself. |
| XDM:setAttacker(E) | XDM | Sets the attacker of the damage. Returns itself. |
| XDM:setForce(V) | XDM | Sets the directional force of the damage. Returns itself. |
| XDM:setPosition(V) | XDM | Sets the position of where the damage gets applied to. Returns itself. |
| XDM:setType(N) | XDM | Sets the damage type. Returns itself. |
| XDM:setInflictor(E) | XDM | Sets the inflictor of the damage for example a weapon. Returns itself. |
### Applying Damage Functions
| Function | Return | Description |
|--------------------------|:------:|--------------------------------------------------------------------------------------------------------------------------|
| `canDamage(E)` | N | Returns 1 if the entity can be damaged by the player. |
| `E:takeDamage(XDM)` | | Applies the damage specified by the damage info to the entity. |
| `E:takeDamage(N,E)` | | Applies the specified amount of damage to the entity. (Damage Amount) |
| `E:takeDamage(N,E)` | | Applies the specified amount of damage to the entity. (Damage Amount, Attacker) |
| `E:takeDamage(N,E,E)` | | Applies the specified amount of damage to the entity. (Damage Amount, Attacker, Inflictor) |
| `blastDamage(XDM,V,N)` | | Applies spherical damage based on damage info to all entities in the specified radius. (Damage, Position, Radius) |
| `blastDamage(E,E,V,N,N)` | | Applies explosion damage to all entities in the specified radius. (Attacker, Inflictor, Position, Radius, Damage Amount) |
| canDamage(E) | N | Returns 1 if the entity can be damaged by the player. |
| E:takeDamage(XDM) | | Applies the damage specified by the damage info to the entity. |
| E:takeDamage(N,E) | | Applies the specified amount of damage to the entity. (Damage Amount) |
| E:takeDamage(N,E) | | Applies the specified amount of damage to the entity. (Damage Amount, Attacker) |
| E:takeDamage(N,E,E) | | Applies the specified amount of damage to the entity. (Damage Amount, Attacker, Inflictor) |
| blastDamage(XDM,V,N) | | Applies spherical damage based on damage info to all entities in the specified radius. (Damage, Position, Radius) |
| blastDamage(E,E,V,N,N) | | Applies explosion damage to all entities in the specified radius. (Attacker, Inflictor, Position, Radius, Damage Amount) |
[DamageCore Workshop Page]: <https://steamcommunity.com/sharedfiles/filedetails/?id=217370580>
[Expression 2 Core Collection]: <https://steamcommunity.com/workshop/filedetails/?id=726399057>
[GitHub Page]: <https://github.com/sirpapate/damagecore>

View File

@ -1,4 +1,5 @@
{
"id" : 217370580,
"title" : "[E2] DamageCore",
"type" : "tool",
"tags" : [ "build" ],
@ -6,6 +7,10 @@
"*.cmd",
"*.gma",
"addonid.txt",
".git*"
".git*",
"*.md",
".*",
"LICENSE",
"images/*"
]
}

BIN
images/background.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
images/icon.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

29
publish.cmd Normal file
View File

@ -0,0 +1,29 @@
@echo off
REM This script will create a GMA file and publish it to the workshop.
FOR /F "tokens=*" %%g IN ('jq ".id" .\addon.json') do (SET ID=%%g)
if "%ID%" == "" goto no-id
gmad create -folder .\ -out .\addon.gma
if "%1" == "-m" goto with-message
if "%1" == "-message" goto with-message
if "%1" == "-msg" goto with-message
if "%1" == "" goto without-message
:with-message
gmpublish.exe update -id %ID% -addon .\addon.gma [-changes %2]
goto after
:without-message
gmpublish.exe update -id %ID% -addon .\addon.gma
goto after
:no-id
echo "No ID found in addon.json"
goto after
:after
del .\addon.gma