Contagion
 This topic has been pinned, so it's probably important
STKOVF Nov 26, 2020 @ 11:52am
Contagion AngelScript Plugin Installation and Usage
The AngelScript scripting language is a extremely flexible scripting language which will be used to execute (listen-)serverside Scripts.

Its implementation for Contagion uses the Contagion Admin System, so it's usable to manage plugins, give rights for self-created commands, make the plugins safe and give normal players the right to use dedicated commands of your plugin.

In this short tutorial, I will help you to install an AngelScript plugin on Contagion,
and give you a rough introduction how to activate and configure a plugin.

Let us assume you have created a plugin called YourCoolPlugin.as.

Install the plugin

Put the file YourCoolPlugin.as in the \contagion\data\scripts\plugins folder in your contagion directory.


Enable the plugin

There are two ways to enable an AngelScript plugin:

  1. Use the \contagion\default_plugins.json, all servers you create on this root will boot up with this plugins activated:
    { "plugins": [ { "script": "YourCoolPlugin.as" } ] }
  2. Use the \contagion\cfg\server.cfg or, for a specific gamemode, \contagion\cfg\gamemodes\GamemodeName.cfg and add a new line with
    as_loadplugin "YourCoolPlugin.as"
    for activation and
    as_unloadplugin "YourCoolPlugin.as"
    for deactivation.

I prefer point 2, because you could play around like you want with the gamemodes and plugins, use one plugin for this gamemode, another for the next gamemode and also unload the current plugin which is not needed now, like the way you want.


Configfiles

Many plugins are configurable, some only at start, others also at runtime.

At the first server start after the plugin installation, the plugin can create a configuration file, if this is provided by the plugin creator.

This configfile will be located under \contagion\data\custom\

You can edit this file with a texteditor, restart the server and the new settings will be used.


Configuration at runtime

All Contagion AngelScript ConVars, created by plugins, should begin with "as_" and end with some useful ConVar name like "as_ycp_coolness_factor".
If the plugin uses such ConVars (console commands), you should be able to change them at server runtime.

With the command "as_showcommands" in the console, you will get a list of all available ASConVars form all plugins.

On my plugins it will follow the structure "as_ + abbreviation of the pluginname + _ + setting name".


Usage for the dedicated server console:

ascmd "as_ycp_coolness_factor" "3"

Usage for the listen server or client console:

"as_ycp_coolness_factor" "3"

Note: There is no need for a plugin creator to give you a config file, use ConVars or let the plugin react on a change of a ConVar at server runtime.
This is not a standard and is up to the plugin creator whether he offers this or not.


If you want to go deeper: http://contagion-game.com/api/#home. If this link is not working correctly, use https://api.wuffesan.com/contagion instead.


Greetings,

ÜberDaniel, https://github.com/UeberDaniel/ContagionAngelScript.
Last edited by STKOVF; Mar 17 @ 10:06am
< >
Showing 1-4 of 4 comments
{OCS}xPaPaDx Nov 10, 2022 @ 3:52pm 
My only question is, Have you fixed this game's incompatibility with the industry standard for ALL source games "SOURCE MOD" (SM was working since the release of this game and in its first many years) since the implementation of a script language that almost nobody in the administration community wants? Asking a legit question, not trolling.
Last edited by {OCS}xPaPaDx; Nov 10, 2022 @ 3:54pm
STKOVF Dec 7, 2022 @ 3:48pm 
Originally posted by {OCS}xPaPaDx:
My only question is, Have you fixed this game's incompatibility with the industry standard for ALL source games "SOURCE MOD" (SM was working since the release of this game and in its first many years) since the implementation of a script language that almost nobody in the administration community wants? Asking a legit question, not trolling.
Hello, that is a very good question. In the past there were some compatible sourcemod versions for this game. Since sourcemod is of course based on reverse engineering the games, and the community for Contagion is quite small... and, since there is angelscript as an alternative implementation in Contagion, there is no reason to use sourcemod anymore. Important to understand: every time an update is released, no matter which SM compatible game, someone has to reverse engineer the gamedata files to match the update. And here it is the best alternative, especially because there is no one in the SM community who wants to do the work for Contagion, to use AngelScript. Wuffesan does his job really well.

Greetings,

Daniel
Last edited by STKOVF; Dec 7, 2022 @ 4:03pm
{OCS}xPaPaDx Dec 7, 2022 @ 6:33pm 
The community got a LOT smalleer

Originally posted by ÜberDaniel:
Originally posted by {OCS}xPaPaDx:
My only question is, Have you fixed this game's incompatibility with the industry standard for ALL source games "SOURCE MOD" (SM was working since the release of this game and in its first many years) since the implementation of a script language that almost nobody in the administration community wants? Asking a legit question, not trolling.
Hello, that is a very good question. In the past there were some compatible sourcemod versions for this game. Since sourcemod is of course based on reverse engineering the games, and the community for Contagion is quite small... and, since there is angelscript as an alternative implementation in Contagion, there is no reason to use sourcemod anymore. Important to understand: every time an update is released, no matter which SM compatible game, someone has to reverse engineer the gamedata files to match the update. And here it is the best alternative, especially because there is no one in the SM community who wants to do the work for Contagion, to use AngelScript. Wuffesan does his job really well.

Greetings,

Daniel
I've been around since day 1 of Contagion(and watching/waiting for it before). Literally upon initial release. I've run multiple servers over the years. SM was ALWAYS compatible with contagion, 'till this recent "small community" as you put it that wants to work on Contagion took over, and ever since, SM has been broken. The truth? the Contagion "community" got a LOT smaller when this happened. It is what it is. Cheers.
STKOVF Dec 15, 2022 @ 11:47am 
Hello {OCS}xPaPaDx,

The switch to angelscript has nothing to do with the collapse of the player's count.
Most of the players always played on official servers.

As i said:
Originally posted by ÜberDaniel:
Important to understand: every time an update is released, no matter which SM compatible game, someone has to reverse engineer the gamedata files to match the update.

It is up to the sourcemod community to customize the sourcemod for the game. Your accusation is wrong here - you are welcome to point it out on Sourcemod.net in the forum (I did back then), so we should be glad that the developers of the game have given us a game-own possibility to create mods.

Greetings,

Daniel
Last edited by STKOVF; Dec 15, 2022 @ 11:47am
< >
Showing 1-4 of 4 comments
Per page: 1530 50