Standard Weapon Interface

Rating
10
Reviews:
1
Downloads:
206
Date uploaded:
1 Jul 2017 at 13:12 (Minor update on 20 Nov 2017)

Download details

Re-upload/Edit Download
Author
Seren (More uploads by Seren)
Type
Other
Credits
Code, art, and example level by Sir Ementaler of LH; sounds by columbia23, Kinoton, nfrae, and martian; tileset by PurpleJazz; music by Iloona.
Satisfaction
N/A
Screenshots
SEweapon.zip (3.27 MB)

File contents

SEwd.j2l Weapon Demonstration 11.37 kB 01 Jul 2017
xlmdamn8.j2t Damn + Forest 225.33 kB 09 Apr 2012
SEwd.j2as 1.16 kB 01 Jul 2017
contrast.xm Contrast 1427.83 kB 02 Oct 2003
SEenergyblast.asc 12.62 kB 01 Jul 2017
SEfirework.asc 8.25 kB 01 Jul 2017
SEroller.asc 9.71 kB 24 Jun 2017
SEweapon.asc 14.07 kB 03 Sep 2017
SEenergyblast.j2a 169.04 kB 30 Jun 2017
SEfirework.j2a 5.19 kB 01 Jul 2017
SEroller.j2a 7.81 kB 30 Jun 2017
SEweapon.html Standard Weapon Interface API 41.90 kB 19 Nov 2017
SEenergyblast.wav 1726.55 kB 01 Jul 2017
SEfirework1.wav 175.22 kB 29 Apr 2017
SEfirework2.wav 140.57 kB 29 Apr 2017
SEroller.wav 98.96 kB 16 Jan 2017

Description

This download contains a small script library that provides a standard interface for custom weapons and simplifies some aspects of creating a new custom weapon while also making them easier to use by an end user. Provided are three example weapons, two of which are entries to the Top Gun Contest (roller is not eligible as an entry because it was created before the start of the contest). Additionally a scripted level is provided to demonstrate how to use the weapons in a script.

The primary goal of the library is to standardize custom weapon implementations. Rationale:
  • It seems most reasonable that level designers should make decisions when it comes to weapons by default available in their level. However, currently most custom weapons are implemented in separate script modules as mutators. This is fine for players, who may decide which weapons to use, but it takes power away from level designers, who cannot enable the weapon by default. In particular, it makes it impossible to use the weapons in single player mode. Usually modifying the mutator to be used in a script takes a significant amount of work because the scripts are not written with such usage in mind and may contain conflicting features.
  • Most currently existing weapons are also meant to replace a specific default weapon. The disadvantage of this fact is that weapons occupying the same weapon slot cannot be enabled in the same level simultaneously.
  • If a hypothetical level or mutator were meant to randomize available weapons on startup or periodically, one would have to put an immense amount of work to do it when they are all enabled in different ways and require different setups.

This library contains mechanisms specifically designed to avoid conflicts between weapons (where reasonably possible). Weapons that implement the standard interface do not need to register their own hooks such as onPlayer or onReceive, meaning that the script writer may easily use them for their own purposes. Such weapons may also be assigned by a script to any weapon slot, removing further conflicts. Mutators that enable a specific weapon with a specific weapon slot are thus still trivial to write, but with this library it is equally trivial to write a single player level script that does the same.

Edit: now with documentation.

Tags

You must log in to tag this file!

Quick Reviews Average: 10

RecommendedStijn rated 10.0

This is an invaluable library for scripters and the demo weapons are well-made too; they are easy and fun to play with, and now also easy to add to your own levels.


Post a review

You need to log in to post comments on this download.