Difference between revisions of "Category:LSL Combat2"

From Second Life Wiki
Jump to navigation Jump to search
(Mention the beta grid regions available for testing)
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Help}}{{LSL Header|ml=*}}
{{Help}}{{LSL Header|ml=*}} __NOTOC__


Linden Combat 2
The Combat2 Project is an enhancement to the Linden Combat system.


Description
This is not meant to be a complete combat system on its own but to provide the tools that allow you to do that.


High Level Feature
In Second Life there are a host of combat communities scattered across the grid. These communities use a wide variety of combat systems, HUDs and weapon systems. Some are completely custom, relying on scripts to arbitrate health and damage, while others are based on the Linden Lab Combat System (LLCS). See [[Combat]] for more.


Putting It All Together
The goal of the Combat2 project is to provide a coherent set of tools and systems that allow the residents to create complex and compelling combat systems using a common and easy to use framework.


----
 
==Introduced are new concepts==
 
* Damage events
** If a script (object, vehicle or attachment) has a damage event this will be called first before damage is applied and scripts may modify the actual amount of damage
* Objects can have health and be scanned by sensors
* Combat Log has been added which allows for auditing
** Records all damage events, damage adjustments and kills
** System generated messages by a specific ID that scripts may filter to
** Scripts may write to this channel if not restricted by the region
* Region-wide settings, region owners may:
** Throttle damage to limit how much damage a single source may inflict on a target per second
** Select a number of options as to what happens when agent health drops to 0 such as:
**# Teleport home (same as old LLCS)
**# Teleport to region's telehub
**# Teleport to parcel's landing point
**# No action
** Set a brief period of invulnerability, during which agents may neither deal nor receive damage
** Whether health is reset to 100% on death
** Tweak the speed of health regeneration per second
** Whether scripts are allowed to adjust damage or write to the combat log
 
 
==Testing==
 
Start playing with it and build interesting things.


There are two regions on the beta grid open and available for testing:
There are two regions on the beta grid open and available for testing:
Line 16: Line 41:
* [secondlife://Aditi/secondlife/Gallipoli/18/142/27 Gallipoli]
* [secondlife://Aditi/secondlife/Gallipoli/18/142/27 Gallipoli]


----


Additional changes:
==Scripting==
 
{|
{{LSL DefineRow|key|[[llRezObjectWithParams]](string inventory, list params)|New function for rezzing objects with a variety of parameters, particularly useful for avoiding the overhead of starting a script for each bullet}}
{{LSL DefineRow|void|[[llAdjustDamage]](integer number, float new_damage)|Modifies the amount of damage that will be applied by the current [[on_damage]] event after it has completed processing}}
{{LSL DefineRow|void|[[llDamage]](key target, float damage, integer damage_type)|Delivers damage to tasks and agent in the same region of {{LSLGC|Constants/Damage Types|DAMAGE_TYPE_*}}. Negative damage can be used to heal instead}}
{{LSL DefineRow|list|[[llDetectedDamage]](integer number)|Returns a list describing a single damage event within an [[on_damage]] event}}
{{LSL DefineRow|key|[[llDetectedRezzer]](integer number)|Returns a key that is the UUID of the object or avatar that rezzed the detected object}}
{{LSL DefineRow|float|[[llGetHealth]](key id)|Returns the current health of an avatar or object in the region}}
{{LSL DefineRow|event|[[on_damage]](integer num_detected)|Triggered when damage has been inflicted on an avatar or task in the world but before damage has been applied or distributed}}
{{LSL DefineRow|event|[[final_damage]](integer num_detected)|Triggered after after all [[on_damage]] events in all scripts and attachments have processed and damage has been applied to the avatar or distributed to all seated avatars}}
{{LSL DefineRow|event|[[on_death]]()|Triggered on all attachments worn by an avatar when that avatar's health reaches 0 (-- Does this trigger on objects too Rider?)}}
|}
 
 
==Additional==
 
* [[llListen]]
** Channel reserved at [[COMBAT_CHANNEL]]
** System generated combat log messages sent by [[COMBAT_LOG_ID]]
** Scripts may also write to this channel if the region allows it (see "restrict_combat_log" below)
* [[llSensor]] — Scripts may filter by [[DAMAGEABLE]] for objects in world that process damage
* [[llGetObjectDetails]] — Additional values around health, damage and type
** [[OBJECT_HEALTH]] — Retrieves the health of an avatar or prim
** [[OBJECT_DAMAGE]] — Retrieves the amount of damage a prim inflicts on collision
** [[OBJECT_DAMAGE_TYPE]] — Retrieves the type of damage a prim inflicts on collision
* [[llRezObjectWithParams]] — Apply damage to rezzed objects
** [[REZ_DAMAGE]] — The amount of damage applied to an agent upon collision with this object
** [[REZ_DAMAGE_TYPE]] — The damage type to apply when this prim collides with another object
* [[llGetEnv]] — Several new values are added
** "allow_damage_adjust" — Are scripts allowed to adjust damage
** "restrict_combat_log" — Are scripts allowed to write to the combat log
** "restore_health" — Is health reset to 100% on death
** "invulnerability_time" — Invulnerablitiy time applied after avatar death
** "damage_throttle" — The maximum number of points of damage a single source may inflict on a target per second
** "health_regen_rate" — The speed of health regeneration in hitpoints per second
** "death_action" — Set the action to take when an avatar dies in the region


[[llGetEnv]]: "allow_damage_adjust", "restrict_combat_log", "restore_health", "invulnerability_time", "damage_throttle", "health_regen_rate", "death_action"


[[llGetObjectDetails]]: [[OBJECT_HEALTH]], [[OBJECT_DAMAGE]], [[OBJECT_DAMAGE_TYPE]]
==Related==


[[llRezObjectWithParams]]: REZ_DAMAGE, REZ_DAMAGE_TYPE
* Thread on the Second Life community forums by Rider Linden announcing the project: [https://community.secondlife.com/forums/topic/506317-pew-pew-pew-linden-damage-combat-20/ Pew! Pew! Pew! Linden Damage & Combat 2.0]
* [https://feedback.secondlife.com/combat-20 Feedback for suggesting, voting and commenting on ideas]

Latest revision as of 11:20, 22 May 2024

The Combat2 Project is an enhancement to the Linden Combat system.

This is not meant to be a complete combat system on its own but to provide the tools that allow you to do that.

In Second Life there are a host of combat communities scattered across the grid. These communities use a wide variety of combat systems, HUDs and weapon systems. Some are completely custom, relying on scripts to arbitrate health and damage, while others are based on the Linden Lab Combat System (LLCS). See Combat for more.

The goal of the Combat2 project is to provide a coherent set of tools and systems that allow the residents to create complex and compelling combat systems using a common and easy to use framework.


Introduced are new concepts

  • Damage events
    • If a script (object, vehicle or attachment) has a damage event this will be called first before damage is applied and scripts may modify the actual amount of damage
  • Objects can have health and be scanned by sensors
  • Combat Log has been added which allows for auditing
    • Records all damage events, damage adjustments and kills
    • System generated messages by a specific ID that scripts may filter to
    • Scripts may write to this channel if not restricted by the region
  • Region-wide settings, region owners may:
    • Throttle damage to limit how much damage a single source may inflict on a target per second
    • Select a number of options as to what happens when agent health drops to 0 such as:
      1. Teleport home (same as old LLCS)
      2. Teleport to region's telehub
      3. Teleport to parcel's landing point
      4. No action
    • Set a brief period of invulnerability, during which agents may neither deal nor receive damage
    • Whether health is reset to 100% on death
    • Tweak the speed of health regeneration per second
    • Whether scripts are allowed to adjust damage or write to the combat log


Testing

Start playing with it and build interesting things.

There are two regions on the beta grid open and available for testing:


Scripting

• key llRezObjectWithParams(string inventory, list params) New function for rezzing objects with a variety of parameters, particularly useful for avoiding the overhead of starting a script for each bullet
• void llAdjustDamage(integer number, float new_damage) Modifies the amount of damage that will be applied by the current on_damage event after it has completed processing
• void llDamage(key target, float damage, integer damage_type) Delivers damage to tasks and agent in the same region of DAMAGE_TYPE_*. Negative damage can be used to heal instead
• list llDetectedDamage(integer number) Returns a list describing a single damage event within an on_damage event
• key llDetectedRezzer(integer number) Returns a key that is the UUID of the object or avatar that rezzed the detected object
• float llGetHealth(key id) Returns the current health of an avatar or object in the region
• event on_damage(integer num_detected) Triggered when damage has been inflicted on an avatar or task in the world but before damage has been applied or distributed
• event final_damage(integer num_detected) Triggered after after all on_damage events in all scripts and attachments have processed and damage has been applied to the avatar or distributed to all seated avatars
• event on_death() Triggered on all attachments worn by an avatar when that avatar's health reaches 0 (-- Does this trigger on objects too Rider?)


Additional

  • llListen
    • Channel reserved at COMBAT_CHANNEL
    • System generated combat log messages sent by COMBAT_LOG_ID
    • Scripts may also write to this channel if the region allows it (see "restrict_combat_log" below)
  • llSensor — Scripts may filter by DAMAGEABLE for objects in world that process damage
  • llGetObjectDetails — Additional values around health, damage and type
  • llRezObjectWithParams — Apply damage to rezzed objects
    • REZ_DAMAGE — The amount of damage applied to an agent upon collision with this object
    • REZ_DAMAGE_TYPE — The damage type to apply when this prim collides with another object
  • llGetEnv — Several new values are added
    • "allow_damage_adjust" — Are scripts allowed to adjust damage
    • "restrict_combat_log" — Are scripts allowed to write to the combat log
    • "restore_health" — Is health reset to 100% on death
    • "invulnerability_time" — Invulnerablitiy time applied after avatar death
    • "damage_throttle" — The maximum number of points of damage a single source may inflict on a target per second
    • "health_regen_rate" — The speed of health regeneration in hitpoints per second
    • "death_action" — Set the action to take when an avatar dies in the region


Related

Pages in category "LSL Combat2"

The following 11 pages are in this category, out of 11 total.