Skip to content

SCriPt v0.3.0

Pre-release
Pre-release

Choose a tag to compare

@tayjay tayjay released this 29 Aug 19:24
· 20 commits to master since this release

Major Changes

Scripts Directory

  • Script loading structure has changed.
  • All scripts in the Scripts directory, other than those in the "Globals" subdirectory are now loaded on startup recursively.
    • Any scripts in subdirectories like AutoLoad will work as expected.
  • Scripts now all load on plugin startup into their own containers
    • No more "AutoLoad" script
    • This is to increase security and allow for easier expansion of the plugin
  • Wiki has been updated to reflect the change

Config Changes

  • Make sure to regenerate the "s_cri_pt > script_path config option to allow the new script loader to function correctly.

Backend Changes

  • Changed how a script is loaded to more easily keep track of its lifecycle.
  • Coroutines, Command, and other objects a script creates are now tracked independently, and can be removed cleanly when a script is unloaded.

Enums

  • Enum types are now registered for scripts
  • This means that functions that used to values like player role will now use C# enum syntax rather than name
    • Player:SetRole("ClassD") is now Player:SetRole(RoleTypeId.ClassD)
  • Information on some of these Enums can be found in the EXILED documentation

EXILED Custom Items support

Starting to work on adding support for registering custom items within Lua. This implementation is still WIP.

Creating a script with the following content will create a custom gun:

custom_gun ={
  firearm_type='Com15',
  name='CustomCom15',
  description='It's a custom gun',
  weight='1',
  damage='100'
}

function custom_gun.OnShooting(args)
  print('Shooting')
  args.IsAllowed=false
end

New Pastebin Implementation

  • The Pastebin global has been removed.
  • There is now a new process to load scripts from Pastebin
    • Create a new file in the same directory as your other scripts.
    • Name the file with the name of the link you wish to reference and the file extension .pastebin
    • Example: KUJHSZM2.pastebin (This will load the SkeletonCommand.lua example file https://pastebin.com/KUJHSZM2)
  • When the server starts it will download the script, in this example to KUJHSZM2.lua, and execute it like any other
  • Changes can be made to this lua file as you wish
  • If you'd like to revert to the original script, or if a new version of that pastebin has been updated:
    • Delete the generated .lua file.
    • The existing .pastebin file will automatically redownload it.
  • Saving the script and not downloading on every load will accomplish the following
    • Reduce network usage
    • Reduce impact if the original pastebin is tampered with
    • Allow for customization of the downloaded scripts.

Minor Changes

  • Added Events.Warhead.* events handler
  • Added Facility.Seed variable
  • Added Lobby.TimeLeft
  • Added a New global to scripts
    • Allows creating some new structs
    • New.Vector3(x,y,z), New.Color(r,g,b,a)
  • Store will no longer automatically save, if you make a change you are responsible for saving it
    • Was taking a lot of resources when not in use.
  • For Player objects
    • Added methods to enable, disable, and check on player effects by EffectType enum
    • Can now set role based on RoleTypeId enum
    • Get and set a player's ScpTickets
    • Get a player's DoNotTrack status
    • UseHeldItem and UseItem(ItemType) methods for forcing interaction with items
    • MovementState variable of type PlayerMovementState to get and set how a player is moving
    • EnableFallDamage get and set
    • Added method CheckPermission(String) to see if the player has a specific EXILED permission
  • Server Events
    • Added SelectingRespawnTeam event