Gun pack changes for release 1.15
This is preliminary documentation for gun pack 1.15. We are releasing it in advance to allow users of the gun pack to comment on changes before they are implemented. On release these paragraphs will be added to the main page.
At the moment nearly half the gun script consists of tests to ensure that inventory items set as sounds, anims etc exist. This code is only used when the gun is reset, and as most guns are shipped no mod (meaning the user cannot reset) it's presence in the shipped wespon may be unnecessary. All the testing code will be moved to a separate script. The script will also handle rezzer configuration issues such as 'holes' in rezzer matrices (e.g. x:0:1 and x:1:0 exist but x:1:1 doesn't). Users shipping guns no mod will be able to delete the test script (and it's use will anyway be optional).
We have discussed various ways of making multiple ammo available without scripting and not foind a single one that would suit all users. Inevitably some users will want to restrict access to some ammo types in ways that we cannot anticipate, and this will therefore involve scripting.
What we propose therefore is to add a new full perms script implementing a notecard driven ammo type select, but to make its use completely optional. It will use the same setting link messages that have always been available, but will package them in a simple way that should accommodate most users. It will also add some notifications to allow extra control; but it is expected that some users will need to add script of their own. As the ammo script will be full perms this will be possible either by adding an extra script to handle the new notifications or by modding the ammo change script.
The notecard system will allow the specification of several ammo types, with the following parameters for each:
- Name (command name to be used to load the ammo)
- Type: bullet or raycast
- Object name (inventory object to be rezzed)
- Silenced sound
- Allowed modes
- Reload time
- Fire time
- Rez parameter
- Notify code, from the following table:
Symbolic name Value Use AMMO_NOTIFY_NONE 1 No notification on ammo change AMMO_NOTIFY_INFORM 2 Just send a notification that ammo has changed AMMO_NOTIFY_REQUEST 3 Send a notification that an ammo change request has been made and wait for confirmation
To simplify configuration, the notecard system allows you to define named parameters and to use these instead of actual values in ammo specs. The actual value of the parameter is then set by the link message AMMO_SETPARAM. The script will settings that use the value and ensure that the gun script is updated correctly. See below for an example.
As designed this mechanism only allows the passing of integer valued parameters. If developers can see a use for string valued parameters a more general form will have to be developed.
Version 1.15 will support raycasting. You should be aware though that raycasting by itself does no damage to a target, and so you will have to provide some script to implement raycasting for some combat system. All raycasting will do is pass a linked message giving the key of the person hit, if any.
Version 1.15 will have two features to support dual fire. One is a new parameter rez_left that allows you to make the bullet rezz a little off-centre. This makes it possible to fire two guns at once without the bullets colliding. You can do this already with rez_down but that works less well with low buoyancy ammo.
The other feature will support alt fire. This means arranging for the gun to ignore every odd (or even) click. A new link message SETALT will set the gun into odd only or even only mode. It's up to the gun builder to coordinate the guns so they both enter alt mode one as odd and one as even at the same time: we'll supply a demo script.
This replaces the section on CCS support
A new parameter r_initparam in the main script allows you to specify the value to be passed to a bullet as its rezz parameter. This allows support of combat systems such as CCS that require data to be passed from the gun to the bullet.
Developers who want to develop guns that support multiple combat systems will need to arrange the rez parameter according to the combat system for which particular ammo is intended. If the ammo changer script is used, this can be done with named parameters. In the notecard, you first declare a variable with a suitable name, here ccs_dynchan.
[Parameters] ccs_dynchanNow the specification for a CCS bullet may be written as follows.
[ccs] object=ccsb clip=15 modes=sb rezp=$ccs_dynchanThe dollar symbol tells the parser that a parameter follows. Now in your CCS script you need to acquire the dynchan and then use the line
llMessageLinked(LINK_THIS,dynchan,"AMMO_SETPARAM",(key) "ccs_dynchan");This will ensure that the value is passed to the bullet when ccs ammo is selected. You can thus maintain separate rezz parameter settings for several combat systems.
As before, we aren't allowed to supply a script to get the CCS dynchan, but provided you are an approved CCS API developer this can be adapted very simply from the example in the API guide. The same remark applies to other combat systems.
Odds and ends
By popular demand a full perms sample HUD will be added to the demo pistol.
The Delta channel monitor will be added to the toolkit
The guide will be divided up to make it easier to use.
In 1.14 we reduced the number of restrictions on how the script may be used. We need some protection against the script being resold copy/transfer but we want to reduce the difficulty caused to developers.
Currently the script checks that the creator of the object that it is in is the licensee - the licensee's key is embedded in the script.
A better system would be to have the script check when it is reset and look for the object creator on a list on our website. This would save us the hassle of having to issue named scripts, with the attendant danger that they will incoporate personal fixes and turn into a morass of slightly different scripts.
Even simpler would be to check the owner rather than the creator of the object. This would give you the freedom to use anyone's models, but would have the disadvantage that you could not ship models mod. Delta never ships stuff mod (other than some items of this package) but it's possible that some of you do.