From 2795e8ca868a1959120b61893efc4f46b363e857 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 15 May 2020 12:32:52 -0400 Subject: [PATCH 01/78] Optimization Pass Removed code that was used in the Directional version which now serves no function in slim --- LBH Slim v1.2.2.lsl => LBH Slim v1.2.3.lsl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) rename LBH Slim v1.2.2.lsl => LBH Slim v1.2.3.lsl (88%) diff --git a/LBH Slim v1.2.2.lsl b/LBH Slim v1.2.3.lsl similarity index 88% rename from LBH Slim v1.2.2.lsl rename to LBH Slim v1.2.3.lsl index 3887489..e79a3c2 100644 --- a/LBH Slim v1.2.2.lsl +++ b/LBH Slim v1.2.3.lsl @@ -5,7 +5,7 @@ integer hp=mhp;//Current HP //Negative Numbers Restore Health integer atcap=50; //Damage Processor -damage(integer amt, key id,vector pos, vector targetPos) +damage(integer amt, key id) { if(amt>atcap)amt=atcap; if(amt<0)//Allows the object to be healed/repaired @@ -83,11 +83,9 @@ default list parse=llParseString2List(message,[","],[" "]); if(llList2Key(parse,0)==me)//targetcheck { - vector pos=llGetPos(); - vector targetPos=tar(id); float amt=llList2Float(parse,-1); - if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos);//Use this code to allow object healing, Blocks overflow attempts - //if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing + if(llFabs(amt)<666.0)damage((integer)amt,id);//Use this code to allow object healing, Blocks overflow attempts + //if(amt>0)damage((integer)amt,id);//Use this code if you do not wish to support healing } } collision_start(integer c)//Enable this block if you want to support legacy collisions. From 55e9a7341ddc4849cfb77ce61bfdfb581e1b9c1e Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 15 May 2020 12:38:02 -0400 Subject: [PATCH 02/78] Create LBH-AG v1.2.3.lsl The anti-grief shown works against both large AND recursive damage sources without filling up the list with each individual hit. This is, obviously, slower and will more likely drops hits during high latency BUT it should be very rare if not virtually impossible for it to stack-heap under stressful conditions. However since damage is still updated at the time of impact and instead of waiting on the timer event, it should overall perform better in a majority of situations. --- LBH-AG v1.2.3.lsl | 170 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 LBH-AG v1.2.3.lsl diff --git a/LBH-AG v1.2.3.lsl b/LBH-AG v1.2.3.lsl new file mode 100644 index 0000000..6d94ad2 --- /dev/null +++ b/LBH-AG v1.2.3.lsl @@ -0,0 +1,170 @@ +//AG Variant includes a built-in anti-grief and blacklisting system. See line 49+ for details. +integer mhp=100;//Maximum HP +integer hp=mhp;//Current HP +//Positive Numbers Deal Damage +//Negative Numbers Restore Health +integer atcap=50; +//Damage Processor +damage(integer amt, key id) +{ + if(amt>atcap)amt=atcap; + if(amt<0)//Allows the object to be healed/repaired + { + if(llGetTime()>1.0)//Optional healing cooldown + { + if(amt>(float)hp*0.1)amt=llRound((float)hp*0.1);//Optional healing cap + hp-=amt; + if(hp>mhp)hp=mhp;//Used to prevent overhealing + llResetTime(); + } + //Be sure to update the listen event code block to allow negative damage values through. + } + /*else if(amt<6)return; //Blocks micro-LBA*/ + else if(amt) + { + if(amt>atcap)amt=atcap; + hp-=amt; + } + else return; + if(hp<1)die(); + else update(); +} + +update()//SetText +{ + llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBH-AG]\n "+(string)hp+" / "+(string)mhp+" HP",<1.0,1.0,1.0>,1.0, + PRIM_DESC,"LBA.v.LBHAG,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]); + //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) +} +die() +{ + //Add extra shit here + //llResetScript();//Debug + llDie();//Otherwise, use this +} +vector tar(key id) +{ + vector av=(vector)((string)llGetObjectDetails(id,[OBJECT_POS])); + return av; +} +//Anti-Grief +float interval=2.0;//How many seconds before the threshold is cleared. Recommended 2 seconds. +integer banthresh=80;//How much HP within the interval is considered ban worth, this affects single-hits as well as ATCAP is used only during damage calculations. Note that exceeding the ATCAP will still count against the user as the difference is not factored with the tracker. +//With a 2s interval at 80 damage, it will require a single owner to deal more than 40 DPS in order to get blacklisted. +list banlist; +//Tracker stores information like so: OWNER_UUID,DMG_TRACKED +list tracker; +integer checkdmg(string source, key owner, integer amt)//0 = Do not take damage, 1 = Take damage +{ + if(llListFindList(banlist,[owner])>-1)return 0;//Checks for previously banned source + else + { + integer param=llListFindList(banlist,[owner]); + if(param>-1)//Owner damage is already in tracker. + { + integer totalamt=llList2Integer(tracker,param+1); + if(totalamtmhp)hp=mhp; + return 0; + } + } + else + { + if(amt>banthresh) + { + banlist+=owner; + llOwnerSay("Banned "+llKey2Name(owner)+" for dealing "+(string)amt+" damage + Last source: ["+source+"] for "+(string)amt+" damage"); + llRegionSayTo(owner,0,"Blacklisted for dealing too much damage too quickly"); + return 0; + //No need to refund damage since they were not already in tracker + } + else + { + tracker+=[owner,amt]; + return 1; + } + } + } +} +// +key user; +key gen;//Object rezzer +key me; +integer hear; +boot() +{ + user=llGetOwner(); + me=llGetKey(); + gen=(string)llGetObjectDetails(me,[OBJECT_REZZER_KEY]); + if(hear)llListenRemove(hear); + integer hex=(integer)("0x" + llGetSubString(llMD5String((string)me,0), 0, 3)); + hear=llListen(hex,"","",""); + llSetTimerEvent(interval); + update(); +} +default +{ + state_entry() + { + boot(); + } + on_rez(integer p) + { + if(p>1)//Allows HUD/Objects to set HP value when rezzed with a param, otherwise uses default + { + mhp=p; + hp=p; + } + boot(); + } + listen(integer chan, string name, key id, string message) + { + //[ALWAYS] USE llRegionSayTo(). Do not flood the channel with useless garbage that'll poll every object in listening range. + list parse=llParseString2List(message,[","],[" "]); + if(llList2Key(parse,0)==me)//targetcheck + { + integer amt=llList2Integer(parse,-1); + if(llFabs(amt)<666.0)//Overflow check + { + if(amt>0.0) + { + if(checkdmg(name,llGetOwnerKey(id),amt)) + { + llSetTimerEvent(interval);//Reset interval on new damage update + damage(amt,id); + } + } + else damage(amt,id); + } + } + } + collision_start(integer c)//Enable this block if you want to support legacy collisions. + { + if(llVecMag(llDetectedVel(0))>40.0) + { + hp-=c; + if(hp<1)die();//llDie(); + else update(); + } + } + timer() + { + tracker=[];//Clear tracker + //Auto-Deleter + if(tar(gen))return; + llDie(); + } +} From 965973ef57a719c52a00c90794a6178514935dad Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sat, 16 May 2020 17:03:07 -0400 Subject: [PATCH 03/78] Fixed missing " and deprecate variables --- ...v1.2.3.lsl => LBHD, Directional Armor v1.2.4.lsl | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) rename LBHD, Directional Armor v1.2.3.lsl => LBHD, Directional Armor v1.2.4.lsl (92%) diff --git a/LBHD, Directional Armor v1.2.3.lsl b/LBHD, Directional Armor v1.2.4.lsl similarity index 92% rename from LBHD, Directional Armor v1.2.3.lsl rename to LBHD, Directional Armor v1.2.4.lsl index 97d0574..d27e18f 100644 --- a/LBHD, Directional Armor v1.2.3.lsl +++ b/LBHD, Directional Armor v1.2.4.lsl @@ -93,8 +93,8 @@ damage(integer amt, key id,vector pos, vector targetPos) //llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki return; } - llOwnerSay("/me took +(string)directional_amt+" ("+(string)amt+") damage");//Used to debug output. - //llRegionSayTo(llGetOwnerKey(id),0,"/me took +(string)directional_amt+" ("+(string)amt+") damage"); + llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage");//Used to debug output. + llRegionSayTo(llGetOwnerKey(id),0,"/me took "+(string)directional_amt+" ("+(string)amt+") damage"); } if(hp<1)die(); else update(); @@ -163,11 +163,6 @@ default } on_rez(integer p) { - if(p>1)//Allows HUD/Objects to set HP value when rezzed with a param, otherwise uses default - { - mhp=p; - hp=p; - } boot(); } listen(integer chan, string name, key id, string message) @@ -181,8 +176,8 @@ default //if(los(pos,tpos))//Enforces LBA line-of-sight { float amt=llList2Float(parse,-1); - //if(llFabs(amt)<666.0)damage((integer)amt,id,pos,tpos);//Use this code to allow object healing, Blocks overflow attempts - if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing + if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos);//Use this code to allow object healing, Blocks overflow attempts + //if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing } //else llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki } From 664968b30e3cfd5e81d3199d6027b91d5bec166d Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sat, 16 May 2020 17:26:46 -0400 Subject: [PATCH 04/78] Reverted unintended edit --- LBHD, Directional Armor v1.2.4.lsl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/LBHD, Directional Armor v1.2.4.lsl b/LBHD, Directional Armor v1.2.4.lsl index d27e18f..edde05f 100644 --- a/LBHD, Directional Armor v1.2.4.lsl +++ b/LBHD, Directional Armor v1.2.4.lsl @@ -163,6 +163,11 @@ default } on_rez(integer p) { + if(p>1)//Allows HUD/Objects to set HP value when rezzed with a param, otherwise uses default + { + mhp=p; + hp=p; + } boot(); } listen(integer chan, string name, key id, string message) From fcf509c7c9684b4fe04b93f6ca47692abd2b9408 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 17 May 2020 10:16:37 -0400 Subject: [PATCH 05/78] Reeeee healing --- LBHD, Directional Armor v1.2.4.lsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LBHD, Directional Armor v1.2.4.lsl b/LBHD, Directional Armor v1.2.4.lsl index edde05f..7a62134 100644 --- a/LBHD, Directional Armor v1.2.4.lsl +++ b/LBHD, Directional Armor v1.2.4.lsl @@ -181,8 +181,8 @@ default //if(los(pos,tpos))//Enforces LBA line-of-sight { float amt=llList2Float(parse,-1); - if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos);//Use this code to allow object healing, Blocks overflow attempts - //if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing + //if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos);//Use this code to allow object healing, Blocks overflow attempts + if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing } //else llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki } From 59ad9d2880e52f07f80a427faffc5061b3df67a1 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 17 May 2020 19:31:45 -0400 Subject: [PATCH 06/78] Fixed conflict with scripts that look for LBA.V.L --- LBHD, Directional Armor v1.2.4.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBHD, Directional Armor v1.2.4.lsl b/LBHD, Directional Armor v1.2.4.lsl index 7a62134..80d4030 100644 --- a/LBHD, Directional Armor v1.2.4.lsl +++ b/LBHD, Directional Armor v1.2.4.lsl @@ -120,7 +120,7 @@ string modifierstring;//This is visible so moderators can confirm vehicle attrib update()//SetText { llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHD]\n "+(string)hp+" / "+(string)mhp+" HP",<0.0,0.75,1.0>,1.0, - PRIM_DESC,"LBA.v.LBHD,"+(string)hp+","+(string)mhp+","+(string)atcap+",999"+modifierstring]); + PRIM_DESC,"LBA.v.HD,"+(string)hp+","+(string)mhp+","+(string)atcap+",999"+modifierstring]); //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) } die() From 2204568682d06d08532861223f476b9cec49d049 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 17 May 2020 19:33:51 -0400 Subject: [PATCH 07/78] Update and rename LBHD, Directional Armor v1.2.4.lsl to LBHD, Directional Armor v1.2.5.lsl --- ...ional Armor v1.2.4.lsl => LBHD, Directional Armor v1.2.5.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename LBHD, Directional Armor v1.2.4.lsl => LBHD, Directional Armor v1.2.5.lsl (99%) diff --git a/LBHD, Directional Armor v1.2.4.lsl b/LBHD, Directional Armor v1.2.5.lsl similarity index 99% rename from LBHD, Directional Armor v1.2.4.lsl rename to LBHD, Directional Armor v1.2.5.lsl index 80d4030..1f68def 100644 --- a/LBHD, Directional Armor v1.2.4.lsl +++ b/LBHD, Directional Armor v1.2.5.lsl @@ -120,7 +120,7 @@ string modifierstring;//This is visible so moderators can confirm vehicle attrib update()//SetText { llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHD]\n "+(string)hp+" / "+(string)mhp+" HP",<0.0,0.75,1.0>,1.0, - PRIM_DESC,"LBA.v.HD,"+(string)hp+","+(string)mhp+","+(string)atcap+",999"+modifierstring]); + PRIM_DESC,"LBA.v.DH,"+(string)hp+","+(string)mhp+","+(string)atcap+",999"+modifierstring]); //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) } die() From c65fd68a3adae9423385b97f931898996577f69d Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 19 May 2020 12:11:58 -0400 Subject: [PATCH 08/78] v1.3 'Fixed-Location' Update The intent is to grab the source's location with llDetectedPos during the collision event and using that as a reference. If no such reference exists, the system will just default to the current method. The goal is to clamp how the list is generated so it doesn't cause the system to stack-heap when exposed to many damage sources at a time. The eldest entries in the list will be dropped once it fills. --- ....lsl => LBHD, Directional Armor v1.3.0.lsl | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) rename LBHD, Directional Armor v1.2.5.lsl => LBHD, Directional Armor v1.3.0.lsl (86%) diff --git a/LBHD, Directional Armor v1.2.5.lsl b/LBHD, Directional Armor v1.3.0.lsl similarity index 86% rename from LBHD, Directional Armor v1.2.5.lsl rename to LBHD, Directional Armor v1.3.0.lsl index 1f68def..e09fd49 100644 --- a/LBHD, Directional Armor v1.2.5.lsl +++ b/LBHD, Directional Armor v1.3.0.lsl @@ -17,12 +17,12 @@ Secondary Lionheart - Method and integration Note: This should be considered an extention of LBA Slim and possesses limited to no anti-grief. */ -integer mhp=100;//Maximum HP +integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage //Negative Numbers Restore Health //Damage Multipliers: 0 = Invulnerable, 1.0 = 100% Damage, High numbers = Higher Damage -integer atcap=50; +integer atcap=200; float front=0.5; float side=1.0; float back=1.5; @@ -72,7 +72,7 @@ integer lbapos(float dmg,vector pos, vector targetPos) damage(integer amt, key id,vector pos, vector targetPos) { if(amt>atcap)amt=atcap; - /*if(amt<0)//Allows the object to be healed/repaired + if(amt<0)//Allows the object to be healed/repaired { if(llGetTime()>1.0)//Optional healing cooldown { @@ -82,9 +82,9 @@ damage(integer amt, key id,vector pos, vector targetPos) llResetTime(); } //Be sure to update the listen event code block to allow negative damage values through. - }*/ - /*else if(amt<6)return; //Blocks micro-LBA - else*/ + } + /*else if(amt<6)return; //Blocks micro-LBA*/ + else { integer directional_amt=lbapos(amt,pos,targetPos); if(directional_amt)hp-=directional_amt; @@ -138,6 +138,7 @@ key user; key gen;//Object rezzer key me; integer hear; +list tracker; boot() { modifierstring=",F-"+llGetSubString((string)front,0,2)+//Frontal modifier @@ -152,7 +153,7 @@ boot() if(hear)llListenRemove(hear); integer hex=(integer)("0x" + llGetSubString(llMD5String((string)me,0), 0, 3)); hear=llListen(hex,"","",""); - llSetTimerEvent(5.0);//Used for auto-delete. + llSetTimerEvent(1.0);//Used for auto-delete. update(); } default @@ -178,26 +179,37 @@ default { vector pos=llGetPos(); vector targetPos=tar(id); + integer f=llListFindList(tracker,[name]); + if(f>-1)targetPos=llList2Vector(tracker,f+1); //if(los(pos,tpos))//Enforces LBA line-of-sight { float amt=llList2Float(parse,-1); - //if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos);//Use this code to allow object healing, Blocks overflow attempts - if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing + if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos);//Use this code to allow object healing, Blocks overflow attempts + //if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing } //else llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki } } - /*collision_start(integer c)//Enable this block if you want to support legacy collisions. + collision_start(integer c)//Enable this block if you want to support legacy collisions. { if(llVecMag(llDetectedVel(0))>40.0) { - hp-=c; - if(hp<1)die();//llDie(); - else update(); + if(tracker==[])llSetTimerEvent(1.0); + string name=llDetectedName(0); + integer f=llListFindList(tracker,[name]); + if(f>-1)tracker=llListReplaceList(tracker,[llDetectedPos(0)],f+1,f+1); + else + { + if(llGetListLength(tracker)>10)tracker=llDeleteSubList(tracker,0,1);//Delete eldest entry to prevent stack-heap + tracker+=[name,llDetectedPos(0)]; + } + //Stores data as follows: OBJECT_NAME,OBJECT_POS + //Updates objects of the same name to the most recent. } - }*/ + } timer()//Auto-deleter. Will kill object if avatar leaves the region or spawning object is removed. { + tracker=[];//Reset tracker if(tar(gen))return; llDie(); } From e0e05150bd8638ecb29dfc23bddab576719a74c7 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 19 May 2020 12:20:32 -0400 Subject: [PATCH 09/78] Create LBHD+HD, v1.3.0.lsl --- LBHD+HD, v1.3.0.lsl | 267 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 267 insertions(+) create mode 100644 LBHD+HD, v1.3.0.lsl diff --git a/LBHD+HD, v1.3.0.lsl b/LBHD+HD, v1.3.0.lsl new file mode 100644 index 0000000..6aa2615 --- /dev/null +++ b/LBHD+HD, v1.3.0.lsl @@ -0,0 +1,267 @@ +/*[IMPORTANT] This requires vehicles/deployables to be aligned properly down the X-axis in order to function properly. Objects which require a rotational offset to function will need to be adjusted. +The publically issued copy of this code has the following settings disabled: +- Object healing +- Collision Damage +- Line-of-Sight Requirement +- Blocking of micro-LBA. + + +These settings may make the system incompatible with certain rulesets and equipment. However, notes and code for switching these features on and off is present for those who wish to use them. + +Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use a standard LBA core or a different LBA parser instead. + +[CREDITS] +datbot Resident/Criss Ixtar - For the initial proof of concept and idea. +Dread Hudson - Establishing the standard LBA format. +Secondary Lionheart - Method and integration + +Note: This should be considered an extention of LBA Slim and possesses limited to no anti-grief. +*/ +integer mhp=200;//Maximum HP +integer hp=mhp;//Current HP +//Anti-Grief +float interval=1.0;//How many seconds before the threshold is cleared. +integer banthresh=250;//How much HP within the interval is considered ban worth, this affects single-hits as well as ATCAP is used only during damage calculations. Note that exceeding the ATCAP will still count against the user as the difference is not factored with the tracker. +//With a 2s interval at 80 damage, it will require a single owner to deal more than 40 DPS in order to get blacklisted. +list banlist; +//Tracker stores information like so: OWNER_UUID,DMG_TRACKED +list bantracker; +integer checkdmg(string source, key owner, integer amt)//0 = Do not take damage, 1 = Take damage +{ + if(llListFindList(banlist,[owner])>-1)return 0;//Checks for previously banned source + else + { + integer param=llListFindList(banlist,[owner]); + if(param>-1)//Owner damage is already in tracker. + { + integer totalamt=llList2Integer(tracker,param+1); + if(totalamtmhp)hp=mhp; + return 0; + } + } + else + { + bantracker+=[owner,amt]; + return 1; + } + } +} +//Positive Numbers Deal Damage +//Negative Numbers Restore Health +//Damage Multipliers: 0 = Invulnerable, 1.0 = 100% Damage, High numbers = Higher Damage +integer atcap=200; +float front=0.5; +float side=1.0; +float back=1.5; +float middle=0.1; +//Note that following modifiers multiply the final damage. So it stacks multiplicatively with the previous modifiers +float top=1.2; +float bottom=1.2; +//Directional Processor +float front_threshold=20.0;//Use positive floats, determines forward range +float back_threshold=160.0;//Use positive floats, determines backward range +float height_threshold=1.5;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height. +integer lbapos(float dmg,vector pos, vector targetPos) +{ + //We'll use numbers greater than -20.0 but less than 20.0 as our forward direction. This means that numbers less -160.0 and greater than 160.0 are our rear. This will need to be changed based on vehicle size and shape. This will not work on Rho because she's too fat. + if(targetPos) + { + float dist=llVecDist(pos,targetPos); + if(dist<1.0)return llFloor(dmg*middle);//This catches explosions which rezzes AT in the object's root position. + else + { + float mod=targetPos.z-pos.z; + if(llFabs(mod)>=height_threshold)//Determines top/bottom hits + { + if(mod>0.0)mod=top;//Top check + else mod=bottom;//Bottom check + } + else mod=1.0;//Else reset it to 1.0 + rotation targetRot=llRotBetween(<1.0,0.0,0.0>*llGetRot(),llVecNorm(-pos)); + vector targetRotVec=llRot2Euler(targetRot)*RAD_TO_DEG; + //You can optimize this further by doing angles in radians as opposed to degrees. This is written in degrees so its easier to read/follow + //For those who care to do so, here's the formulas: [Degrees = (Radians*180.0)/PI] or [Radians = (Degrees*PI)/180.0] + //Degrees should be returned in values between -180.0 and 180.0 + //llSay(0,"Angle: "+(string)trotvec.z+"| Pos offset: "+(string)(tpos-pos)+" | RotBetween: "+(string)trot);//Debug output + //Now we use the Z-Axis to calculate the horizonal directions. + //Note that vertical direction isn't factored, only the horizonal angle. This the vehicle is sliced up like a pie and damage will be based on how far and which direction from the center the projectile strikes when it hits the top or bottom. + if(targetRotVec.z>-front_threshold&&targetRotVec.zback_threshold)//Back + return llFloor((dmg*back)*mod); + else //If it didn't hit any previous angles, the only thing left to hit is the sides. + return llFloor((dmg*side)*mod); + } + } + else return 0;//If a no vector is returned, do not process damage. +} +//Damage Processor +damage(integer amt, key id,vector pos, vector targetPos) +{ + if(amt>atcap)amt=atcap; + if(amt<0)//Allows the object to be healed/repaired + { + if(llGetTime()>1.0)//Optional healing cooldown + { + if(amt>(float)hp*0.1)amt=llRound(hp*0.1);//Optional healing cap + hp-=amt; + if(hp>mhp)hp=mhp;//Used to prevent overhealing + llResetTime(); + } + //Be sure to update the listen event code block to allow negative damage values through. + } + /*else if(amt<6)return; //Blocks micro-LBA*/ + else + { + integer directional_amt=lbapos(amt,pos,targetPos); + if(directional_amt)hp-=directional_amt; + else + { + //llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki + return; + } + llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage");//Used to debug output. + llRegionSayTo(llGetOwnerKey(id),0,"/me took "+(string)directional_amt+" ("+(string)amt+") damage"); + } + if(hp<1)die(); + else update(); +} +//Line-of-Sight Check +integer los(vector start, vector target) +{ + list ray=llCastRay(target,start,[RC_REJECT_TYPES,RC_REJECT_AGENTS,RC_DATA_FLAGS,RC_GET_ROOT_KEY,RC_MAX_HITS,1]); + key hit=llList2Key(ray,0);//Debug + if(llKey2Name(hit)) + { + //llSay(0,llKey2Name(hit));//Debug + if(hit==me)return 1; + else return 0;//Object in way + } + else + { + if(llList2Vector(ray,1)==ZERO_VECTOR)return 1; + else return 0;//Land in way + } +} +string modifierstring;//This is visible so moderators can confirm vehicle attributes are within regulation. +update()//SetText +{ + llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHD+AG]\n "+(string)hp+" / "+(string)mhp+" HP",<0.0,0.75,1.0>,1.0, + PRIM_DESC,"LBA.v.DHAG,"+(string)hp+","+(string)mhp+","+(string)atcap+",999"+modifierstring]); + //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) +} +die() +{ + //Add extra shit here + //llResetScript();//Debug + llDie();//Otherwise, use this +} +vector tar(key id) +{ + vector av=(vector)((string)llGetObjectDetails(id,[OBJECT_POS])); + return av; +} +key user; +key gen;//Object rezzer +key me; +integer hear; +list tracker; +boot() +{ + modifierstring=",F-"+llGetSubString((string)front,0,2)+//Frontal modifier + ",S-"+llGetSubString((string)side,0,2)+//Side modifier + ",R-"+llGetSubString((string)back,0,2)+//Rear modifier + ",T-"+llGetSubString((string)top,0,2)+//Top modifier + ",B-"+llGetSubString((string)bottom,0,2)+//Bottom modifier + ",M-"+llGetSubString((string)middle,0,2);//Middle Modifier + user=llGetOwner(); + me=llGetKey(); + gen=(string)llGetObjectDetails(me,[OBJECT_REZZER_KEY]); + if(hear)llListenRemove(hear); + integer hex=(integer)("0x" + llGetSubString(llMD5String((string)me,0), 0, 3)); + hear=llListen(hex,"","",""); + llSetTimerEvent(1.0);//Used for auto-delete. + update(); +} +default +{ + state_entry() + { + boot(); + } + on_rez(integer p) + { + if(p>1)//Allows HUD/Objects to set HP value when rezzed with a param, otherwise uses default + { + mhp=p; + hp=p; + } + boot(); + } + listen(integer chan, string name, key id, string message) + { + //[ALWAYS] USE llRegionSayTo(). Do not flood the channel with useless garbage that'll poll every object in listening range. + list parse=llParseString2List(message,[","],[" "]); + if(llList2Key(parse,0)==me)//targetcheck + { + vector pos=llGetPos(); + vector targetPos=tar(id); + integer f=llListFindList(tracker,[name]); + if(f>-1)targetPos=llList2Vector(tracker,f+1); + //if(los(pos,tpos))//Enforces LBA line-of-sight + { + integer amt=llList2Integer(parse,-1); + if(llFabs(amt)<666.0)//Use this code to allow object healing, Blocks overflow attempts + { + if(amt>0) + { + if(checkdmg(name,llGetOwnerKey(id),amt)) + { + llSetTimerEvent(interval);//Reset interval on new damage update + damage(amt,id,pos,targetPos); + } + else damage(amt,id,pos,targetPos); + } + } + } + //else llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki + } + } + collision_start(integer c)//Enable this block if you want to support legacy collisions. + { + if(llVecMag(llDetectedVel(0))>40.0) + { + if(tracker==[])llSetTimerEvent(1.0); + string name=llDetectedName(0); + integer f=llListFindList(tracker,[name]); + if(f>-1)tracker=llListReplaceList(tracker,[llDetectedPos(0)],f+1,f+1); + else + { + if(llGetListLength(tracker)>10)tracker=llDeleteSubList(tracker,0,1);//Delete eldest entry to prevent stack-heap + tracker+=[name,llDetectedPos(0)]; + } + //Stores data as follows: OBJECT_NAME,OBJECT_POS + //Updates objects of the same name to the most recent. + } + } + timer()//Auto-deleter. Will kill object if avatar leaves the region or spawning object is removed. + { + bantracker=[]; + tracker=[];//Reset tracker + if(tar(gen))return; + llDie(); + } +} From 022eb3556ff145ff44185c6b082df80c6892c4df Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 19 May 2020 12:20:46 -0400 Subject: [PATCH 10/78] Rename LBHD+HD, v1.3.0.lsl to LBHD+AG, v1.3.0.lsl --- LBHD+HD, v1.3.0.lsl => LBHD+AG, v1.3.0.lsl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBHD+HD, v1.3.0.lsl => LBHD+AG, v1.3.0.lsl (100%) diff --git a/LBHD+HD, v1.3.0.lsl b/LBHD+AG, v1.3.0.lsl similarity index 100% rename from LBHD+HD, v1.3.0.lsl rename to LBHD+AG, v1.3.0.lsl From c4492bb3cbfc9634d53478c46072485dff2a113a Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 20 May 2020 21:20:06 -0400 Subject: [PATCH 11/78] Fixed desc conflict with certain weapons --- LBH-AG v1.2.3.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH-AG v1.2.3.lsl b/LBH-AG v1.2.3.lsl index 6d94ad2..dccda80 100644 --- a/LBH-AG v1.2.3.lsl +++ b/LBH-AG v1.2.3.lsl @@ -33,7 +33,7 @@ damage(integer amt, key id) update()//SetText { llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBH-AG]\n "+(string)hp+" / "+(string)mhp+" HP",<1.0,1.0,1.0>,1.0, - PRIM_DESC,"LBA.v.LBHAG,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]); + PRIM_DESC,"LBA.v.HAG,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]); //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) } die() From da4b61b0c9dfd2bf40f314ad9dd890bc9946e546 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 20 May 2020 21:20:49 -0400 Subject: [PATCH 12/78] Fixed desc conflict for certain weapons --- LBH Slim v1.2.3.lsl => LBH Slim v1.2.4.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename LBH Slim v1.2.3.lsl => LBH Slim v1.2.4.lsl (97%) diff --git a/LBH Slim v1.2.3.lsl b/LBH Slim v1.2.4.lsl similarity index 97% rename from LBH Slim v1.2.3.lsl rename to LBH Slim v1.2.4.lsl index e79a3c2..6b2e818 100644 --- a/LBH Slim v1.2.3.lsl +++ b/LBH Slim v1.2.4.lsl @@ -33,7 +33,7 @@ damage(integer amt, key id) update()//SetText { llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHS]\n "+(string)hp+" / "+(string)mhp+" HP",<1.0,1.0,1.0>,1.0, - PRIM_DESC,"LBA.v.LBHS,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]); + PRIM_DESC,"LBA.v.Slim,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]); //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) } die() From ef393d7f5d506a7d8b4049389dcba92d7d19560b Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 20 May 2020 21:21:44 -0400 Subject: [PATCH 13/78] Minor tweak to previous change to keep in theme --- LBH Slim v1.2.4.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH Slim v1.2.4.lsl b/LBH Slim v1.2.4.lsl index 6b2e818..e48b373 100644 --- a/LBH Slim v1.2.4.lsl +++ b/LBH Slim v1.2.4.lsl @@ -33,7 +33,7 @@ damage(integer amt, key id) update()//SetText { llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHS]\n "+(string)hp+" / "+(string)mhp+" HP",<1.0,1.0,1.0>,1.0, - PRIM_DESC,"LBA.v.Slim,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]); + PRIM_DESC,"LBA.v.HS,"+(string)hp+","+(string)mhp+","+(string)atcap+",666"]); //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) } die() From 579fedc623e811f3482299116e8538e53cfeb198 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 20 May 2020 21:22:39 -0400 Subject: [PATCH 14/78] Rename LBH-AG v1.2.3.lsl to LBH-AG v1.2.4.lsl --- LBH-AG v1.2.3.lsl => LBH-AG v1.2.4.lsl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBH-AG v1.2.3.lsl => LBH-AG v1.2.4.lsl (100%) diff --git a/LBH-AG v1.2.3.lsl b/LBH-AG v1.2.4.lsl similarity index 100% rename from LBH-AG v1.2.3.lsl rename to LBH-AG v1.2.4.lsl From b4f15c12fa1306ecc7d504f974fe581358bcbf79 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sat, 23 May 2020 17:35:32 -0400 Subject: [PATCH 15/78] Streamlined 'fixed-location' method Now calculates and stores the modifier instead of the position. Removed a bunch of commands and otherwise unused code. --- ....lsl => LBHD, Directional Armor v1.3.1.lsl | 97 ++++++++++--------- 1 file changed, 52 insertions(+), 45 deletions(-) rename LBHD, Directional Armor v1.3.0.lsl => LBHD, Directional Armor v1.3.1.lsl (69%) diff --git a/LBHD, Directional Armor v1.3.0.lsl b/LBHD, Directional Armor v1.3.1.lsl similarity index 69% rename from LBHD, Directional Armor v1.3.0.lsl rename to LBHD, Directional Armor v1.3.1.lsl index e09fd49..6bb79ac 100644 --- a/LBHD, Directional Armor v1.3.0.lsl +++ b/LBHD, Directional Armor v1.3.1.lsl @@ -1,27 +1,23 @@ /*[IMPORTANT] This requires vehicles/deployables to be aligned properly down the X-axis in order to function properly. Objects which require a rotational offset to function will need to be adjusted. -The publically issued copy of this code has the following settings disabled: -- Object healing -- Collision Damage -- Line-of-Sight Requirement -- Blocking of micro-LBA. +Default settings may make the system incompatible with certain rulesets and equipment. However, notes and code for changing these features is present for those who wish to use them. -These settings may make the system incompatible with certain rulesets and equipment. However, notes and code for switching these features on and off is present for those who wish to use them. - -Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use a standard LBA core or a different LBA parser instead. +Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use the standard LBA or LBH core instead. [CREDITS] datbot Resident/Criss Ixtar - For the initial proof of concept and idea. Dread Hudson - Establishing the standard LBA format. Secondary Lionheart - Method and integration +Criss Ixtar - For collision-location concept and idea. -Note: This should be considered an extention of LBA Slim and possesses limited to no anti-grief. */ +string ver="DHv1.3.1";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage //Negative Numbers Restore Health //Damage Multipliers: 0 = Invulnerable, 1.0 = 100% Damage, High numbers = Higher Damage +//The total between all values should be around 5.0 for balancing purposes. integer atcap=200; float front=0.5; float side=1.0; @@ -31,12 +27,12 @@ float middle=0.1; float top=1.2; float bottom=1.2; //Directional Processor -float front_threshold=20.0;//Use positive floats, determines forward range -float back_threshold=160.0;//Use positive floats, determines backward range -float height_threshold=1.5;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height. +float front_threshold=25.0;//Use positive floats, determines forward range +float back_threshold=155.0;//Use positive floats, determines backward range +float height_threshold=0.75;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height to ground from root position. integer lbapos(float dmg,vector pos, vector targetPos) { - //We'll use numbers greater than -20.0 but less than 20.0 as our forward direction. This means that numbers less -160.0 and greater than 160.0 are our rear. This will need to be changed based on vehicle size and shape. This will not work on Rho because she's too fat. + //We'll use numbers greater than -25.0 but less than 25.0 as our forward direction. This means that numbers less -155.0 and greater than 155.0 are our rear. This will need to be changed based on vehicle size and shape. This will not work on Rho because she's too fat. if(targetPos) { float dist=llVecDist(pos,targetPos); @@ -68,8 +64,35 @@ integer lbapos(float dmg,vector pos, vector targetPos) } else return 0;//If a no vector is returned, do not process damage. } +float collisionmod(vector pos, vector targetPos) +{ + if(targetPos) + { + float dist=llVecDist(pos,targetPos); + if(dist<1.0)return middle;//This catches explosions which rezzes AT in the object's root position. + else + { + float mod=targetPos.z-pos.z; + if(llFabs(mod)>=height_threshold)//Determines top/bottom hits + { + if(mod>0.0)mod=top;//Top check + else mod=bottom;//Bottom check + } + else mod=1.0;//Else reset it to 1.0 + rotation targetRot=llRotBetween(<1.0,0.0,0.0>*llGetRot(),llVecNorm(-pos)); + vector targetRotVec=llRot2Euler(targetRot)*RAD_TO_DEG; + if(targetRotVec.z>-front_threshold&&targetRotVec.zback_threshold)//Back + return back*mod; + else //If it didn't hit any previous angles, the only thing left to hit is the sides. + return side*mod; + } + } + else return 0.0; +} //Damage Processor -damage(integer amt, key id,vector pos, vector targetPos) +damage(integer amt, key id,vector pos, vector targetPos, float tmod) { if(amt>atcap)amt=atcap; if(amt<0)//Allows the object to be healed/repaired @@ -86,11 +109,14 @@ damage(integer amt, key id,vector pos, vector targetPos) /*else if(amt<6)return; //Blocks micro-LBA*/ else { - integer directional_amt=lbapos(amt,pos,targetPos); + integer directional_amt; + if(tmod)directional_amt=llFloor(amt*tmod); + else lbapos(amt,pos,targetPos); if(directional_amt)hp-=directional_amt; - else + else //Failed to do damage { - //llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki + llOwnerSay("Damage Blocked by Armor"); + llRegionSayTo(llGetOwnerKey(id),0,"Attack was stopped by armor."); return; } llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage");//Used to debug output. @@ -99,28 +125,11 @@ damage(integer amt, key id,vector pos, vector targetPos) if(hp<1)die(); else update(); } -//Line-of-Sight Check -integer los(vector start, vector target) -{ - list ray=llCastRay(target,start,[RC_REJECT_TYPES,RC_REJECT_AGENTS,RC_DATA_FLAGS,RC_GET_ROOT_KEY,RC_MAX_HITS,1]); - key hit=llList2Key(ray,0);//Debug - if(llKey2Name(hit)) - { - //llSay(0,llKey2Name(hit));//Debug - if(hit==me)return 1; - else return 0;//Object in way - } - else - { - if(llList2Vector(ray,1)==ZERO_VECTOR)return 1; - else return 0;//Land in way - } -} string modifierstring;//This is visible so moderators can confirm vehicle attributes are within regulation. update()//SetText { llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHD]\n "+(string)hp+" / "+(string)mhp+" HP",<0.0,0.75,1.0>,1.0, - PRIM_DESC,"LBA.v.DH,"+(string)hp+","+(string)mhp+","+(string)atcap+",999"+modifierstring]); + PRIM_DESC,"LBA.v."+ver+","+(string)hp+","+(string)mhp+","+(string)atcap+",999"+modifierstring]); //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) } die() @@ -179,29 +188,27 @@ default { vector pos=llGetPos(); vector targetPos=tar(id); + float tmod; integer f=llListFindList(tracker,[name]); - if(f>-1)targetPos=llList2Vector(tracker,f+1); - //if(los(pos,tpos))//Enforces LBA line-of-sight - { - float amt=llList2Float(parse,-1); - if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos);//Use this code to allow object healing, Blocks overflow attempts - //if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing - } - //else llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki + if(f>-1)tmod=llList2Float(tracker,f+1); + float amt=llList2Float(parse,-1); + if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos,tmod);//Use this code to allow object healing, Blocks overflow attempts + //if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing } } collision_start(integer c)//Enable this block if you want to support legacy collisions. { if(llVecMag(llDetectedVel(0))>40.0) { + vector gpos=llGetPos(); if(tracker==[])llSetTimerEvent(1.0); string name=llDetectedName(0); integer f=llListFindList(tracker,[name]); - if(f>-1)tracker=llListReplaceList(tracker,[llDetectedPos(0)],f+1,f+1); + if(f>-1)tracker=llListReplaceList(tracker,[collisionmod(gpos,llDetectedPos(0))],f+1,f+1); else { if(llGetListLength(tracker)>10)tracker=llDeleteSubList(tracker,0,1);//Delete eldest entry to prevent stack-heap - tracker+=[name,llDetectedPos(0)]; + tracker+=[name,collisionmod(gpos,llDetectedPos(0))]; } //Stores data as follows: OBJECT_NAME,OBJECT_POS //Updates objects of the same name to the most recent. From fcfaedfe8f2187eed31e10e1636212e52b629a0d Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sat, 23 May 2020 17:43:56 -0400 Subject: [PATCH 16/78] Updated 'fixed-location' method --- LBHD+AG, v1.3.0.lsl => LBHD+AG, v1.3.1.lsl | 115 +++++++++++---------- 1 file changed, 61 insertions(+), 54 deletions(-) rename LBHD+AG, v1.3.0.lsl => LBHD+AG, v1.3.1.lsl (71%) diff --git a/LBHD+AG, v1.3.0.lsl b/LBHD+AG, v1.3.1.lsl similarity index 71% rename from LBHD+AG, v1.3.0.lsl rename to LBHD+AG, v1.3.1.lsl index 6aa2615..edaab2d 100644 --- a/LBHD+AG, v1.3.0.lsl +++ b/LBHD+AG, v1.3.1.lsl @@ -1,22 +1,17 @@ /*[IMPORTANT] This requires vehicles/deployables to be aligned properly down the X-axis in order to function properly. Objects which require a rotational offset to function will need to be adjusted. -The publically issued copy of this code has the following settings disabled: -- Object healing -- Collision Damage -- Line-of-Sight Requirement -- Blocking of micro-LBA. +Default settings may make the system incompatible with certain rulesets and equipment. However, notes and code for changing these features is present for those who wish to use them. -These settings may make the system incompatible with certain rulesets and equipment. However, notes and code for switching these features on and off is present for those who wish to use them. - -Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use a standard LBA core or a different LBA parser instead. +Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use the standard LBA or LBH core instead. [CREDITS] datbot Resident/Criss Ixtar - For the initial proof of concept and idea. Dread Hudson - Establishing the standard LBA format. Secondary Lionheart - Method and integration +Criss Ixtar - For collision-location concept and idea. -Note: This should be considered an extention of LBA Slim and possesses limited to no anti-grief. */ +string ver="DHAGv1.3.1";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Anti-Grief @@ -62,6 +57,7 @@ integer checkdmg(string source, key owner, integer amt)//0 = Do not take damage, //Positive Numbers Deal Damage //Negative Numbers Restore Health //Damage Multipliers: 0 = Invulnerable, 1.0 = 100% Damage, High numbers = Higher Damage +//The total between all values should be around 5.0 for balancing purposes. integer atcap=200; float front=0.5; float side=1.0; @@ -71,12 +67,12 @@ float middle=0.1; float top=1.2; float bottom=1.2; //Directional Processor -float front_threshold=20.0;//Use positive floats, determines forward range -float back_threshold=160.0;//Use positive floats, determines backward range -float height_threshold=1.5;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height. +float front_threshold=25.0;//Use positive floats, determines forward range +float back_threshold=155.0;//Use positive floats, determines backward range +float height_threshold=0.75;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height to ground from root position. integer lbapos(float dmg,vector pos, vector targetPos) { - //We'll use numbers greater than -20.0 but less than 20.0 as our forward direction. This means that numbers less -160.0 and greater than 160.0 are our rear. This will need to be changed based on vehicle size and shape. This will not work on Rho because she's too fat. + //We'll use numbers greater than -25.0 but less than 25.0 as our forward direction. This means that numbers less -155.0 and greater than 155.0 are our rear. This will need to be changed based on vehicle size and shape. This will not work on Rho because she's too fat. if(targetPos) { float dist=llVecDist(pos,targetPos); @@ -108,8 +104,35 @@ integer lbapos(float dmg,vector pos, vector targetPos) } else return 0;//If a no vector is returned, do not process damage. } +float collisionmod(vector pos, vector targetPos) +{ + if(targetPos) + { + float dist=llVecDist(pos,targetPos); + if(dist<1.0)return middle;//This catches explosions which rezzes AT in the object's root position. + else + { + float mod=targetPos.z-pos.z; + if(llFabs(mod)>=height_threshold)//Determines top/bottom hits + { + if(mod>0.0)mod=top;//Top check + else mod=bottom;//Bottom check + } + else mod=1.0;//Else reset it to 1.0 + rotation targetRot=llRotBetween(<1.0,0.0,0.0>*llGetRot(),llVecNorm(-pos)); + vector targetRotVec=llRot2Euler(targetRot)*RAD_TO_DEG; + if(targetRotVec.z>-front_threshold&&targetRotVec.zback_threshold)//Back + return back*mod; + else //If it didn't hit any previous angles, the only thing left to hit is the sides. + return side*mod; + } + } + else return 0.0; +} //Damage Processor -damage(integer amt, key id,vector pos, vector targetPos) +damage(integer amt, key id,vector pos, vector targetPos, float tmod) { if(amt>atcap)amt=atcap; if(amt<0)//Allows the object to be healed/repaired @@ -126,11 +149,14 @@ damage(integer amt, key id,vector pos, vector targetPos) /*else if(amt<6)return; //Blocks micro-LBA*/ else { - integer directional_amt=lbapos(amt,pos,targetPos); + integer directional_amt; + if(tmod)directional_amt=llFloor(amt*tmod); + else lbapos(amt,pos,targetPos); if(directional_amt)hp-=directional_amt; - else + else //Failed to do damage { - //llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki + llOwnerSay("Damage Blocked by Armor"); + llRegionSayTo(llGetOwnerKey(id),0,"Attack was stopped by armor."); return; } llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage");//Used to debug output. @@ -139,28 +165,11 @@ damage(integer amt, key id,vector pos, vector targetPos) if(hp<1)die(); else update(); } -//Line-of-Sight Check -integer los(vector start, vector target) -{ - list ray=llCastRay(target,start,[RC_REJECT_TYPES,RC_REJECT_AGENTS,RC_DATA_FLAGS,RC_GET_ROOT_KEY,RC_MAX_HITS,1]); - key hit=llList2Key(ray,0);//Debug - if(llKey2Name(hit)) - { - //llSay(0,llKey2Name(hit));//Debug - if(hit==me)return 1; - else return 0;//Object in way - } - else - { - if(llList2Vector(ray,1)==ZERO_VECTOR)return 1; - else return 0;//Land in way - } -} string modifierstring;//This is visible so moderators can confirm vehicle attributes are within regulation. update()//SetText { - llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHD+AG]\n "+(string)hp+" / "+(string)mhp+" HP",<0.0,0.75,1.0>,1.0, - PRIM_DESC,"LBA.v.DHAG,"+(string)hp+","+(string)mhp+","+(string)atcap+",999"+modifierstring]); + llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHD]\n "+(string)hp+" / "+(string)mhp+" HP",<0.0,0.75,1.0>,1.0, + PRIM_DESC,"LBA.v."+ver+","+(string)hp+","+(string)mhp+","+(string)atcap+",999"+modifierstring]); //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) } die() @@ -193,7 +202,7 @@ boot() if(hear)llListenRemove(hear); integer hex=(integer)("0x" + llGetSubString(llMD5String((string)me,0), 0, 3)); hear=llListen(hex,"","",""); - llSetTimerEvent(1.0);//Used for auto-delete. + llSetTimerEvent(interval); update(); } default @@ -219,49 +228,47 @@ default { vector pos=llGetPos(); vector targetPos=tar(id); - integer f=llListFindList(tracker,[name]); - if(f>-1)targetPos=llList2Vector(tracker,f+1); - //if(los(pos,tpos))//Enforces LBA line-of-sight + integer amt=llList2Integer(parse,-1); + if(llFabs(amt)<666)//Use this code to allow object healing, Blocks overflow attempts { - integer amt=llList2Integer(parse,-1); - if(llFabs(amt)<666.0)//Use this code to allow object healing, Blocks overflow attempts + if(amt>0) { - if(amt>0) + if(checkdmg(name,llGetOwnerKey(id),(integer)amt)) { - if(checkdmg(name,llGetOwnerKey(id),amt)) - { - llSetTimerEvent(interval);//Reset interval on new damage update - damage(amt,id,pos,targetPos); - } - else damage(amt,id,pos,targetPos); + float tmod; + integer f=llListFindList(tracker,[name]); + if(f>-1)tmod=llList2Float(tracker,f+1); + llSetTimerEvent(interval);//Reset interval on new damage update + damage(amt,id,pos,targetPos,tmod); } } + else damage(amt,id,pos,targetPos,0.0); } - //else llRegionSayTo(llGetOwnerKey(id),0,"/me Armor deflected the damage!");//cheeki breeki } } collision_start(integer c)//Enable this block if you want to support legacy collisions. { if(llVecMag(llDetectedVel(0))>40.0) { + vector gpos=llGetPos(); if(tracker==[])llSetTimerEvent(1.0); string name=llDetectedName(0); integer f=llListFindList(tracker,[name]); - if(f>-1)tracker=llListReplaceList(tracker,[llDetectedPos(0)],f+1,f+1); + if(f>-1)tracker=llListReplaceList(tracker,[collisionmod(gpos,llDetectedPos(0))],f+1,f+1); else { if(llGetListLength(tracker)>10)tracker=llDeleteSubList(tracker,0,1);//Delete eldest entry to prevent stack-heap - tracker+=[name,llDetectedPos(0)]; + tracker+=[name,collisionmod(gpos,llDetectedPos(0))]; } //Stores data as follows: OBJECT_NAME,OBJECT_POS //Updates objects of the same name to the most recent. } } - timer()//Auto-deleter. Will kill object if avatar leaves the region or spawning object is removed. + timer() { bantracker=[]; tracker=[];//Reset tracker - if(tar(gen))return; + if(tar(gen))return;//Auto-deleter llDie(); } } From d6d4267327250f2abfa40137b8e4a6ab63efa965 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 29 May 2020 17:19:36 -0400 Subject: [PATCH 17/78] Oops --- LBHD+AG, v1.3.1.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBHD+AG, v1.3.1.lsl b/LBHD+AG, v1.3.1.lsl index edaab2d..e1271be 100644 --- a/LBHD+AG, v1.3.1.lsl +++ b/LBHD+AG, v1.3.1.lsl @@ -151,7 +151,7 @@ damage(integer amt, key id,vector pos, vector targetPos, float tmod) { integer directional_amt; if(tmod)directional_amt=llFloor(amt*tmod); - else lbapos(amt,pos,targetPos); + else directional_amt=lbapos(amt,pos,targetPos); if(directional_amt)hp-=directional_amt; else //Failed to do damage { From f4f038981f9ca0c1bf2b9485f7855ae31438c2bf Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 29 May 2020 17:20:06 -0400 Subject: [PATCH 18/78] Oops --- LBHD, Directional Armor v1.3.1.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBHD, Directional Armor v1.3.1.lsl b/LBHD, Directional Armor v1.3.1.lsl index 6bb79ac..1c2cdee 100644 --- a/LBHD, Directional Armor v1.3.1.lsl +++ b/LBHD, Directional Armor v1.3.1.lsl @@ -111,7 +111,7 @@ damage(integer amt, key id,vector pos, vector targetPos, float tmod) { integer directional_amt; if(tmod)directional_amt=llFloor(amt*tmod); - else lbapos(amt,pos,targetPos); + else directional_amt=lbapos(amt,pos,targetPos); if(directional_amt)hp-=directional_amt; else //Failed to do damage { From 22dc446d2cc59564d37ded40d8c15f9e2f96c979 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 29 May 2020 17:20:31 -0400 Subject: [PATCH 19/78] Rename LBHD+AG, v1.3.1.lsl to LBHD+AG, v1.3.2.lsl --- LBHD+AG, v1.3.1.lsl => LBHD+AG, v1.3.2.lsl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBHD+AG, v1.3.1.lsl => LBHD+AG, v1.3.2.lsl (100%) diff --git a/LBHD+AG, v1.3.1.lsl b/LBHD+AG, v1.3.2.lsl similarity index 100% rename from LBHD+AG, v1.3.1.lsl rename to LBHD+AG, v1.3.2.lsl From d5d2e362ff309e3752c8ae040200fcd72ad9826d Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 29 May 2020 17:20:53 -0400 Subject: [PATCH 20/78] Rename LBHD, Directional Armor v1.3.1.lsl to LBHD, Directional Armor v1.3.2.lsl --- ...ctional Armor v1.3.1.lsl => LBHD, Directional Armor v1.3.2.lsl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBHD, Directional Armor v1.3.1.lsl => LBHD, Directional Armor v1.3.2.lsl (100%) diff --git a/LBHD, Directional Armor v1.3.1.lsl b/LBHD, Directional Armor v1.3.2.lsl similarity index 100% rename from LBHD, Directional Armor v1.3.1.lsl rename to LBHD, Directional Armor v1.3.2.lsl From b1a70610780d52245f27da3aeaaaf8e24dfd4b21 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 2 Jun 2020 09:07:20 -0400 Subject: [PATCH 21/78] Version fix --- LBHD, Directional Armor v1.3.2.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBHD, Directional Armor v1.3.2.lsl b/LBHD, Directional Armor v1.3.2.lsl index 1c2cdee..76ada1c 100644 --- a/LBHD, Directional Armor v1.3.2.lsl +++ b/LBHD, Directional Armor v1.3.2.lsl @@ -11,7 +11,7 @@ Secondary Lionheart - Method and integration Criss Ixtar - For collision-location concept and idea. */ -string ver="DHv1.3.1";//LBA Version +string ver="DHv1.3.2";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage From 19f6d7778e46035b82d3ad30d92ef3e08872c95d Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 5 Jun 2020 08:56:10 -0400 Subject: [PATCH 22/78] Fix for raycast modifier triggers --- LBHD+AG, v1.3.2.lsl => LBHD+AG, v1.3.4.lsl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) rename LBHD+AG, v1.3.2.lsl => LBHD+AG, v1.3.4.lsl (95%) diff --git a/LBHD+AG, v1.3.2.lsl b/LBHD+AG, v1.3.4.lsl similarity index 95% rename from LBHD+AG, v1.3.2.lsl rename to LBHD+AG, v1.3.4.lsl index e1271be..8349dd5 100644 --- a/LBHD+AG, v1.3.2.lsl +++ b/LBHD+AG, v1.3.4.lsl @@ -11,7 +11,7 @@ Secondary Lionheart - Method and integration Criss Ixtar - For collision-location concept and idea. */ -string ver="DHAGv1.3.1";//LBA Version +string ver="DHAGv1.3.4";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Anti-Grief @@ -226,8 +226,9 @@ default list parse=llParseString2List(message,[","],[" "]); if(llList2Key(parse,0)==me)//targetcheck { + list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT]); vector pos=llGetPos(); - vector targetPos=tar(id); + vector targetPos=llList2Vector(data,0); integer amt=llList2Integer(parse,-1); if(llFabs(amt)<666)//Use this code to allow object healing, Blocks overflow attempts { @@ -239,14 +240,20 @@ default integer f=llListFindList(tracker,[name]); if(f>-1)tmod=llList2Float(tracker,f+1); llSetTimerEvent(interval);//Reset interval on new damage update - damage(amt,id,pos,targetPos,tmod); + if(llList2Integer(data,1)) + { + float dist=llVecDist(targetPos,pos)-2.0; + targetPos=targetPos+*llList2Rot(data,2); + damage((integer)amt,id,pos,targetPos,tmod); + } + else damage(amt,id,pos,targetPos,tmod); } } else damage(amt,id,pos,targetPos,0.0); } } } - collision_start(integer c)//Enable this block if you want to support legacy collisions. + collision_start(integer c) { if(llVecMag(llDetectedVel(0))>40.0) { From e64c8c65482b29c8181ed583950eb25b5bbb7fd4 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 5 Jun 2020 09:00:09 -0400 Subject: [PATCH 23/78] Raycast fix, more data for owner when damaged --- ....lsl => LBHD, Directional Armor v1.3.4.lsl | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) rename LBHD, Directional Armor v1.3.2.lsl => LBHD, Directional Armor v1.3.4.lsl (92%) diff --git a/LBHD, Directional Armor v1.3.2.lsl b/LBHD, Directional Armor v1.3.4.lsl similarity index 92% rename from LBHD, Directional Armor v1.3.2.lsl rename to LBHD, Directional Armor v1.3.4.lsl index 76ada1c..1203f11 100644 --- a/LBHD, Directional Armor v1.3.2.lsl +++ b/LBHD, Directional Armor v1.3.4.lsl @@ -11,7 +11,7 @@ Secondary Lionheart - Method and integration Criss Ixtar - For collision-location concept and idea. */ -string ver="DHv1.3.2";//LBA Version +string ver="DHv1.3.4";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage @@ -30,7 +30,7 @@ float bottom=1.2; float front_threshold=25.0;//Use positive floats, determines forward range float back_threshold=155.0;//Use positive floats, determines backward range float height_threshold=0.75;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height to ground from root position. -integer lbapos(float dmg,vector pos, vector targetPos) +integer lbapos(float dmg,vector pos, vector targetPos, string name) { //We'll use numbers greater than -25.0 but less than 25.0 as our forward direction. This means that numbers less -155.0 and greater than 155.0 are our rear. This will need to be changed based on vehicle size and shape. This will not work on Rho because she's too fat. if(targetPos) @@ -119,7 +119,7 @@ damage(integer amt, key id,vector pos, vector targetPos, float tmod) llRegionSayTo(llGetOwnerKey(id),0,"Attack was stopped by armor."); return; } - llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage");//Used to debug output. + llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage from "+name+" by "+llKey2Name(llGetOwnerKey(id)));//Used to debug output.//Used to debug output. llRegionSayTo(llGetOwnerKey(id),0,"/me took "+(string)directional_amt+" ("+(string)amt+") damage"); } if(hp<1)die(); @@ -186,14 +186,23 @@ default list parse=llParseString2List(message,[","],[" "]); if(llList2Key(parse,0)==me)//targetcheck { + list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT]); vector pos=llGetPos(); - vector targetPos=tar(id); + vector targetPos=llList2Vector(data,0); float tmod; integer f=llListFindList(tracker,[name]); if(f>-1)tmod=llList2Float(tracker,f+1); float amt=llList2Float(parse,-1); - if(llFabs(amt)<666.0)damage((integer)amt,id,pos,targetPos,tmod);//Use this code to allow object healing, Blocks overflow attempts - //if(amt>0)damage((integer)amt,id,pos,targetPos);//Use this code if you do not wish to support healing + if(llFabs(amt)<666.0) + { + if(llList2Integer(data,1)) + { + float dist=llVecDist(targetPos,pos)-2.0; + targetPos=targetPos+*llList2Rot(data,2); + damage((integer)amt,id,pos,targetPos,0.0,name); + } + else damage((integer)amt,id,pos,targetPos,tmod,name); + } } } collision_start(integer c)//Enable this block if you want to support legacy collisions. From f10b30cb7d81d1a7a96688643f2de35ec9612b6b Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 5 Jun 2020 09:31:42 -0400 Subject: [PATCH 24/78] Forced LoS on RC Fix --- LBHD+AG, v1.3.4.lsl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/LBHD+AG, v1.3.4.lsl b/LBHD+AG, v1.3.4.lsl index 8349dd5..e5ec321 100644 --- a/LBHD+AG, v1.3.4.lsl +++ b/LBHD+AG, v1.3.4.lsl @@ -11,7 +11,7 @@ Secondary Lionheart - Method and integration Criss Ixtar - For collision-location concept and idea. */ -string ver="DHAGv1.3.4";//LBA Version +string ver="DHAGv1.3.5";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Anti-Grief @@ -178,7 +178,13 @@ die() //llResetScript();//Debug llDie();//Otherwise, use this } -vector tar(key id) +integer los(vector start, vector target)//1=LoS,0=Obstructed +{ + list ray=llCastRay(start,target,[RC_REJECT_TYPES,RC_REJECT_AGENTS,RC_DATA_FLAGS,RC_GET_ROOT_KEY,RC_MAX_HITS,1]); + if(llList2Vector(ray,1)==ZERO_VECTOR)return 1; + else return 0; +} +vector tar(key id)//Deprecated { vector av=(vector)((string)llGetObjectDetails(id,[OBJECT_POS])); return av; @@ -244,7 +250,8 @@ default { float dist=llVecDist(targetPos,pos)-2.0; targetPos=targetPos+*llList2Rot(data,2); - damage((integer)amt,id,pos,targetPos,tmod); + if(los(pos,posfix))damage((integer)amt,id,pos,posfix,0.0); + else damage((integer)amt,id,pos,targetPos,0.0); } else damage(amt,id,pos,targetPos,tmod); } From 396313221ea6781a03633794f80cd4c5d0ecd942 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 5 Jun 2020 09:31:58 -0400 Subject: [PATCH 25/78] Rename LBHD+AG, v1.3.4.lsl to LBHD+AG, v1.3.5.lsl --- LBHD+AG, v1.3.4.lsl => LBHD+AG, v1.3.5.lsl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBHD+AG, v1.3.4.lsl => LBHD+AG, v1.3.5.lsl (100%) diff --git a/LBHD+AG, v1.3.4.lsl b/LBHD+AG, v1.3.5.lsl similarity index 100% rename from LBHD+AG, v1.3.4.lsl rename to LBHD+AG, v1.3.5.lsl From 77028c7b0ed005fedc2f9299eb4f3e0c080f785b Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 5 Jun 2020 09:34:10 -0400 Subject: [PATCH 26/78] Forced LoS on RC Fix --- ....4.lsl => LBHD, Directional Armor v1.3.5.lsl | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) rename LBHD, Directional Armor v1.3.4.lsl => LBHD, Directional Armor v1.3.5.lsl (94%) diff --git a/LBHD, Directional Armor v1.3.4.lsl b/LBHD, Directional Armor v1.3.5.lsl similarity index 94% rename from LBHD, Directional Armor v1.3.4.lsl rename to LBHD, Directional Armor v1.3.5.lsl index 1203f11..ba8ddca 100644 --- a/LBHD, Directional Armor v1.3.4.lsl +++ b/LBHD, Directional Armor v1.3.5.lsl @@ -5,13 +5,13 @@ Default settings may make the system incompatible with certain rulesets and equi Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use the standard LBA or LBH core instead. [CREDITS] -datbot Resident/Criss Ixtar - For the initial proof of concept and idea. +Criss Ixtar - For the initial proof of concept and idea. Dread Hudson - Establishing the standard LBA format. Secondary Lionheart - Method and integration Criss Ixtar - For collision-location concept and idea. */ -string ver="DHv1.3.4";//LBA Version +string ver="DHv1.3.5";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage @@ -138,7 +138,13 @@ die() //llResetScript();//Debug llDie();//Otherwise, use this } -vector tar(key id) +integer los(vector start, vector target)//1=LoS,0=Obstructed +{ + list ray=llCastRay(start,target,[RC_REJECT_TYPES,RC_REJECT_AGENTS,RC_DATA_FLAGS,RC_GET_ROOT_KEY,RC_MAX_HITS,1]); + if(llList2Vector(ray,1)==ZERO_VECTOR)return 1; + else return 0; +} +vector tar(key id)//Deprecated { vector av=(vector)((string)llGetObjectDetails(id,[OBJECT_POS])); return av; @@ -198,8 +204,9 @@ default if(llList2Integer(data,1)) { float dist=llVecDist(targetPos,pos)-2.0; - targetPos=targetPos+*llList2Rot(data,2); - damage((integer)amt,id,pos,targetPos,0.0,name); + vector posfix=targetPos+*llList2Rot(data,2); + if(los(pos,posfix))damage((integer)amt,id,pos,posfix,0.0,name); + else damage((integer)amt,id,pos,targetPos,0.0,name); } else damage((integer)amt,id,pos,targetPos,tmod,name); } From aa63ff9cdf823666fa6745687a5dd7c6619e77e2 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 5 Jun 2020 09:35:35 -0400 Subject: [PATCH 27/78] woops --- LBHD+AG, v1.3.5.lsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LBHD+AG, v1.3.5.lsl b/LBHD+AG, v1.3.5.lsl index e5ec321..cf9c82b 100644 --- a/LBHD+AG, v1.3.5.lsl +++ b/LBHD+AG, v1.3.5.lsl @@ -5,7 +5,7 @@ Default settings may make the system incompatible with certain rulesets and equi Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use the standard LBA or LBH core instead. [CREDITS] -datbot Resident/Criss Ixtar - For the initial proof of concept and idea. +Criss Ixtar - For the initial proof of concept and idea. Dread Hudson - Establishing the standard LBA format. Secondary Lionheart - Method and integration Criss Ixtar - For collision-location concept and idea. @@ -249,7 +249,7 @@ default if(llList2Integer(data,1)) { float dist=llVecDist(targetPos,pos)-2.0; - targetPos=targetPos+*llList2Rot(data,2); + vector posfix=targetPos+*llList2Rot(data,2); if(los(pos,posfix))damage((integer)amt,id,pos,posfix,0.0); else damage((integer)amt,id,pos,targetPos,0.0); } From a6e87aaeaf023985acd2af955dd7ad671b2739b1 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 5 Jun 2020 09:36:38 -0400 Subject: [PATCH 28/78] Text cleanup --- LBHD, Directional Armor v1.3.5.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBHD, Directional Armor v1.3.5.lsl b/LBHD, Directional Armor v1.3.5.lsl index ba8ddca..01fdd4e 100644 --- a/LBHD, Directional Armor v1.3.5.lsl +++ b/LBHD, Directional Armor v1.3.5.lsl @@ -119,7 +119,7 @@ damage(integer amt, key id,vector pos, vector targetPos, float tmod) llRegionSayTo(llGetOwnerKey(id),0,"Attack was stopped by armor."); return; } - llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage from "+name+" by "+llKey2Name(llGetOwnerKey(id)));//Used to debug output.//Used to debug output. + llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage from "+name+" by "+llKey2Name(llGetOwnerKey(id)));//Used to debug output. llRegionSayTo(llGetOwnerKey(id),0,"/me took "+(string)directional_amt+" ("+(string)amt+") damage"); } if(hp<1)die(); From 725bc7600448b109cb51ccb327ffb2eeda124388 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 5 Jun 2020 09:37:37 -0400 Subject: [PATCH 29/78] Increased information given to owner when damaged --- LBHD+AG, v1.3.5.lsl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/LBHD+AG, v1.3.5.lsl b/LBHD+AG, v1.3.5.lsl index cf9c82b..62f4930 100644 --- a/LBHD+AG, v1.3.5.lsl +++ b/LBHD+AG, v1.3.5.lsl @@ -132,7 +132,7 @@ float collisionmod(vector pos, vector targetPos) else return 0.0; } //Damage Processor -damage(integer amt, key id,vector pos, vector targetPos, float tmod) +damage(integer amt, key id,vector pos, vector targetPos, float tmod,string name) { if(amt>atcap)amt=atcap; if(amt<0)//Allows the object to be healed/repaired @@ -159,7 +159,7 @@ damage(integer amt, key id,vector pos, vector targetPos, float tmod) llRegionSayTo(llGetOwnerKey(id),0,"Attack was stopped by armor."); return; } - llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage");//Used to debug output. + llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage from "+name+" by "+llKey2Name(llGetOwnerKey(id)));//Used to debug output. llRegionSayTo(llGetOwnerKey(id),0,"/me took "+(string)directional_amt+" ("+(string)amt+") damage"); } if(hp<1)die(); @@ -250,13 +250,13 @@ default { float dist=llVecDist(targetPos,pos)-2.0; vector posfix=targetPos+*llList2Rot(data,2); - if(los(pos,posfix))damage((integer)amt,id,pos,posfix,0.0); - else damage((integer)amt,id,pos,targetPos,0.0); + if(los(pos,posfix))damage((integer)amt,id,pos,posfix,0.0,name); + else damage((integer)amt,id,pos,targetPos,0.0,name); } else damage(amt,id,pos,targetPos,tmod); } } - else damage(amt,id,pos,targetPos,0.0); + else damage(amt,id,pos,targetPos,0.0,name); } } } From 1784acb1a4002bec11d48a6d90f79f21fce7b118 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:55:35 -0400 Subject: [PATCH 30/78] Rename LBH Slim v1.2.4.lsl to LBH/LBH Slim v1.2.4.lsl --- LBH Slim v1.2.4.lsl => LBH/LBH Slim v1.2.4.lsl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBH Slim v1.2.4.lsl => LBH/LBH Slim v1.2.4.lsl (100%) diff --git a/LBH Slim v1.2.4.lsl b/LBH/LBH Slim v1.2.4.lsl similarity index 100% rename from LBH Slim v1.2.4.lsl rename to LBH/LBH Slim v1.2.4.lsl From 2c0cd3de694149ba10e0e06432c25a6b177aaa78 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:55:50 -0400 Subject: [PATCH 31/78] Rename LBH-AG v1.2.4.lsl to LBH/LBH-AG v1.2.4.lsl --- LBH-AG v1.2.4.lsl => LBH/LBH-AG v1.2.4.lsl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBH-AG v1.2.4.lsl => LBH/LBH-AG v1.2.4.lsl (100%) diff --git a/LBH-AG v1.2.4.lsl b/LBH/LBH-AG v1.2.4.lsl similarity index 100% rename from LBH-AG v1.2.4.lsl rename to LBH/LBH-AG v1.2.4.lsl From 1d70df3cf86d6501aeea3f7daf5b4ddcfc54033e Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:56:10 -0400 Subject: [PATCH 32/78] Rename LBHD+AG, v1.3.5.lsl to LBH/LBHD+AG, v1.3.5.lsl --- LBHD+AG, v1.3.5.lsl => LBH/LBHD+AG, v1.3.5.lsl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBHD+AG, v1.3.5.lsl => LBH/LBHD+AG, v1.3.5.lsl (100%) diff --git a/LBHD+AG, v1.3.5.lsl b/LBH/LBHD+AG, v1.3.5.lsl similarity index 100% rename from LBHD+AG, v1.3.5.lsl rename to LBH/LBHD+AG, v1.3.5.lsl From cdb3edfe2949538cda54b61d18b4fe5df44164b4 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:56:28 -0400 Subject: [PATCH 33/78] Rename LBHD, Directional Armor v1.3.5.lsl to LBH/LBHD, Directional Armor v1.3.5.lsl --- .../LBHD, Directional Armor v1.3.5.lsl | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBHD, Directional Armor v1.3.5.lsl => LBH/LBHD, Directional Armor v1.3.5.lsl (100%) diff --git a/LBHD, Directional Armor v1.3.5.lsl b/LBH/LBHD, Directional Armor v1.3.5.lsl similarity index 100% rename from LBHD, Directional Armor v1.3.5.lsl rename to LBH/LBHD, Directional Armor v1.3.5.lsl From f0880c18d8e8b6049fc75b48b15f99bf024e9388 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:57:30 -0400 Subject: [PATCH 34/78] Rename LBHD+AG, v1.3.5.lsl to LBHD+AG, Directional Armorv1.3.5.lsl --- LBH/{LBHD+AG, v1.3.5.lsl => LBHD+AG, Directional Armorv1.3.5.lsl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBH/{LBHD+AG, v1.3.5.lsl => LBHD+AG, Directional Armorv1.3.5.lsl} (100%) diff --git a/LBH/LBHD+AG, v1.3.5.lsl b/LBH/LBHD+AG, Directional Armorv1.3.5.lsl similarity index 100% rename from LBH/LBHD+AG, v1.3.5.lsl rename to LBH/LBHD+AG, Directional Armorv1.3.5.lsl From 6ff3f3634bb953c9cf6bfafcf3ebeef3f1a28eb2 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 7 Jun 2020 14:57:48 -0400 Subject: [PATCH 35/78] Rename LBHD+AG, Directional Armorv1.3.5.lsl to LBHD+AG, Directional Armor v1.3.5.lsl --- ...onal Armorv1.3.5.lsl => LBHD+AG, Directional Armor v1.3.5.lsl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBH/{LBHD+AG, Directional Armorv1.3.5.lsl => LBHD+AG, Directional Armor v1.3.5.lsl} (100%) diff --git a/LBH/LBHD+AG, Directional Armorv1.3.5.lsl b/LBH/LBHD+AG, Directional Armor v1.3.5.lsl similarity index 100% rename from LBH/LBHD+AG, Directional Armorv1.3.5.lsl rename to LBH/LBHD+AG, Directional Armor v1.3.5.lsl From 4660f1407a16faf76fa9311506722d0d2feca0b4 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 11:18:28 -0400 Subject: [PATCH 36/78] Merged LBAPOS and COLLISIONMOD Fixed missing parameter in damage function --- ...lsl => LBHD, Directional Armor v1.3.6.lsl} | 42 ++----------------- 1 file changed, 4 insertions(+), 38 deletions(-) rename LBH/{LBHD, Directional Armor v1.3.5.lsl => LBHD, Directional Armor v1.3.6.lsl} (76%) diff --git a/LBH/LBHD, Directional Armor v1.3.5.lsl b/LBH/LBHD, Directional Armor v1.3.6.lsl similarity index 76% rename from LBH/LBHD, Directional Armor v1.3.5.lsl rename to LBH/LBHD, Directional Armor v1.3.6.lsl index 01fdd4e..7de7765 100644 --- a/LBH/LBHD, Directional Armor v1.3.5.lsl +++ b/LBH/LBHD, Directional Armor v1.3.6.lsl @@ -8,10 +8,10 @@ Do [not] use this as your default LBA parser as it would not be optimized for us Criss Ixtar - For the initial proof of concept and idea. Dread Hudson - Establishing the standard LBA format. Secondary Lionheart - Method and integration -Criss Ixtar - For collision-location concept and idea. +Criss Ixtar - For collision-location concept and idea and extensive testing contribution */ -string ver="DHv1.3.5";//LBA Version +string ver="DHv1.3.6";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage @@ -30,40 +30,6 @@ float bottom=1.2; float front_threshold=25.0;//Use positive floats, determines forward range float back_threshold=155.0;//Use positive floats, determines backward range float height_threshold=0.75;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height to ground from root position. -integer lbapos(float dmg,vector pos, vector targetPos, string name) -{ - //We'll use numbers greater than -25.0 but less than 25.0 as our forward direction. This means that numbers less -155.0 and greater than 155.0 are our rear. This will need to be changed based on vehicle size and shape. This will not work on Rho because she's too fat. - if(targetPos) - { - float dist=llVecDist(pos,targetPos); - if(dist<1.0)return llFloor(dmg*middle);//This catches explosions which rezzes AT in the object's root position. - else - { - float mod=targetPos.z-pos.z; - if(llFabs(mod)>=height_threshold)//Determines top/bottom hits - { - if(mod>0.0)mod=top;//Top check - else mod=bottom;//Bottom check - } - else mod=1.0;//Else reset it to 1.0 - rotation targetRot=llRotBetween(<1.0,0.0,0.0>*llGetRot(),llVecNorm(-pos)); - vector targetRotVec=llRot2Euler(targetRot)*RAD_TO_DEG; - //You can optimize this further by doing angles in radians as opposed to degrees. This is written in degrees so its easier to read/follow - //For those who care to do so, here's the formulas: [Degrees = (Radians*180.0)/PI] or [Radians = (Degrees*PI)/180.0] - //Degrees should be returned in values between -180.0 and 180.0 - //llSay(0,"Angle: "+(string)trotvec.z+"| Pos offset: "+(string)(tpos-pos)+" | RotBetween: "+(string)trot);//Debug output - //Now we use the Z-Axis to calculate the horizonal directions. - //Note that vertical direction isn't factored, only the horizonal angle. This the vehicle is sliced up like a pie and damage will be based on how far and which direction from the center the projectile strikes when it hits the top or bottom. - if(targetRotVec.z>-front_threshold&&targetRotVec.zback_threshold)//Back - return llFloor((dmg*back)*mod); - else //If it didn't hit any previous angles, the only thing left to hit is the sides. - return llFloor((dmg*side)*mod); - } - } - else return 0;//If a no vector is returned, do not process damage. -} float collisionmod(vector pos, vector targetPos) { if(targetPos) @@ -92,7 +58,7 @@ float collisionmod(vector pos, vector targetPos) else return 0.0; } //Damage Processor -damage(integer amt, key id,vector pos, vector targetPos, float tmod) +damage(integer amt, key id,vector pos, vector targetPos, float tmod, string name) { if(amt>atcap)amt=atcap; if(amt<0)//Allows the object to be healed/repaired @@ -111,7 +77,7 @@ damage(integer amt, key id,vector pos, vector targetPos, float tmod) { integer directional_amt; if(tmod)directional_amt=llFloor(amt*tmod); - else directional_amt=lbapos(amt,pos,targetPos); + else directional_amt=llFloor(collisionmod(pos,targetPos)*(float)amt); if(directional_amt)hp-=directional_amt; else //Failed to do damage { From 066cd111d42320fb3fbcede5cf93e4405ff78a31 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 11:19:56 -0400 Subject: [PATCH 37/78] Merged LBAPOS and COLLISIONMOD --- LBH/LBHD+AG, Directional Armor v1.3.5.lsl | 38 ++--------------------- 1 file changed, 2 insertions(+), 36 deletions(-) diff --git a/LBH/LBHD+AG, Directional Armor v1.3.5.lsl b/LBH/LBHD+AG, Directional Armor v1.3.5.lsl index 62f4930..52741d0 100644 --- a/LBH/LBHD+AG, Directional Armor v1.3.5.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.3.5.lsl @@ -11,7 +11,7 @@ Secondary Lionheart - Method and integration Criss Ixtar - For collision-location concept and idea. */ -string ver="DHAGv1.3.5";//LBA Version +string ver="DHAGv1.3.6";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Anti-Grief @@ -70,40 +70,6 @@ float bottom=1.2; float front_threshold=25.0;//Use positive floats, determines forward range float back_threshold=155.0;//Use positive floats, determines backward range float height_threshold=0.75;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height to ground from root position. -integer lbapos(float dmg,vector pos, vector targetPos) -{ - //We'll use numbers greater than -25.0 but less than 25.0 as our forward direction. This means that numbers less -155.0 and greater than 155.0 are our rear. This will need to be changed based on vehicle size and shape. This will not work on Rho because she's too fat. - if(targetPos) - { - float dist=llVecDist(pos,targetPos); - if(dist<1.0)return llFloor(dmg*middle);//This catches explosions which rezzes AT in the object's root position. - else - { - float mod=targetPos.z-pos.z; - if(llFabs(mod)>=height_threshold)//Determines top/bottom hits - { - if(mod>0.0)mod=top;//Top check - else mod=bottom;//Bottom check - } - else mod=1.0;//Else reset it to 1.0 - rotation targetRot=llRotBetween(<1.0,0.0,0.0>*llGetRot(),llVecNorm(-pos)); - vector targetRotVec=llRot2Euler(targetRot)*RAD_TO_DEG; - //You can optimize this further by doing angles in radians as opposed to degrees. This is written in degrees so its easier to read/follow - //For those who care to do so, here's the formulas: [Degrees = (Radians*180.0)/PI] or [Radians = (Degrees*PI)/180.0] - //Degrees should be returned in values between -180.0 and 180.0 - //llSay(0,"Angle: "+(string)trotvec.z+"| Pos offset: "+(string)(tpos-pos)+" | RotBetween: "+(string)trot);//Debug output - //Now we use the Z-Axis to calculate the horizonal directions. - //Note that vertical direction isn't factored, only the horizonal angle. This the vehicle is sliced up like a pie and damage will be based on how far and which direction from the center the projectile strikes when it hits the top or bottom. - if(targetRotVec.z>-front_threshold&&targetRotVec.zback_threshold)//Back - return llFloor((dmg*back)*mod); - else //If it didn't hit any previous angles, the only thing left to hit is the sides. - return llFloor((dmg*side)*mod); - } - } - else return 0;//If a no vector is returned, do not process damage. -} float collisionmod(vector pos, vector targetPos) { if(targetPos) @@ -151,7 +117,7 @@ damage(integer amt, key id,vector pos, vector targetPos, float tmod,string name) { integer directional_amt; if(tmod)directional_amt=llFloor(amt*tmod); - else directional_amt=lbapos(amt,pos,targetPos); + else directional_amt=llFloor(collisionmod(pos,targetPos)*(float)amt); if(directional_amt)hp-=directional_amt; else //Failed to do damage { From e498a4c674e3adabfb290e670b6b5d848dcc34b4 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 11:20:10 -0400 Subject: [PATCH 38/78] Rename LBHD+AG, Directional Armor v1.3.5.lsl to LBHD+AG, Directional Armor v1.3.6.lsl --- ...nal Armor v1.3.5.lsl => LBHD+AG, Directional Armor v1.3.6.lsl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBH/{LBHD+AG, Directional Armor v1.3.5.lsl => LBHD+AG, Directional Armor v1.3.6.lsl} (100%) diff --git a/LBH/LBHD+AG, Directional Armor v1.3.5.lsl b/LBH/LBHD+AG, Directional Armor v1.3.6.lsl similarity index 100% rename from LBH/LBHD+AG, Directional Armor v1.3.5.lsl rename to LBH/LBHD+AG, Directional Armor v1.3.6.lsl From ce85171ca9c5d22e45a7bbe03497c90df7d4c99d Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:14:42 -0400 Subject: [PATCH 39/78] Create LBHD-Component, v1.3.6.lsl --- LBH/LBHD-Component, v1.3.6.lsl | 308 +++++++++++++++++++++++++++++++++ 1 file changed, 308 insertions(+) create mode 100644 LBH/LBHD-Component, v1.3.6.lsl diff --git a/LBH/LBHD-Component, v1.3.6.lsl b/LBH/LBHD-Component, v1.3.6.lsl new file mode 100644 index 0000000..8c1b8c6 --- /dev/null +++ b/LBH/LBHD-Component, v1.3.6.lsl @@ -0,0 +1,308 @@ +//MBTLBA was a stupid name +string ver="DHCv1.3.6,";//LBA Version +//efx +integer burning;//burning flag +integer repair;//repair timer +integer detrack;//detrack flah +integer layer;//detrack layers +integer ml;//Mouselook tracker +integer emk;//em kit +// +integer mhp=250;//Maximum HP +integer hp=mhp;//Current HP +//Positive Numbers Deal Damage +//Negative Numbers Restore Health +//Damage Multipliers: 0 = Invulnerable, 1.0 = 100% Damage, High numbers = Higher Damage +integer atcap=500; +float front=0.5; +float side=1.0; +float back=1.5; +float middle=0.1; +//Note that following modifiers multiply the final damage. So it stacks multiplicatively with the previous modifiers +float top=1.2; +float bottom=1.2; +//Directional Processor +float front_threshold=20.0;//Use positive floats, determines forward range +float back_threshold=160.0;//Use positive floats, determines backward range +float height_threshold=0.7;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height. +vector collisionmod(vector pos, vector targetPos) +{ + if(targetPos) + { + float trak; + float dist=llVecDist(pos,targetPos); + if(dist<1.0)return <0.01,0.0,0.0>;//This catches explosions which rezzes AT in the object's root position. + else + { + float mod=targetPos.z-pos.z; + if(llFabs(mod)>=height_threshold)//Determines top/bottom hits + { + if(mod>0.0)mod=top;//Top check + else + { + ++trak;//Chance to detrack + mod=bottom;//Bottom check + } + } + else mod=1.0;//Else reset it to 1.0 + rotation targetRot=llRotBetween(<1.0,0.0,0.0>*llGetRot(),llVecNorm(-pos)); + vector targetRotVec=llRot2Euler(targetRot)*RAD_TO_DEG; + if(targetRotVec.z>-front_threshold&&targetRotVec.z; + else if(targetRotVec.z<-back_threshold||targetRotVec.z>back_threshold)return ;//chance to burn + else return ; + } + } + else return ZERO_VECTOR; +} +//Damage Processor +damage(integer amt, key id,vector pos, vector targetPos,vector tmod,string name) +{ + //Tmod Dump: Damage modifier, Did I detrack?, Did I burn? + if(amt>atcap)amt=atcap; + if(amt<0)//Allows the object to be healed/repaired + { + if(llGetTime()>1.0)//Optional healing cooldown + { + if(burning||detrack) + { + burning=0; + detrack=0; + llMessageLinked(-4,1,"",""); + llOwnerSay("Status Repaired"); + } + if(amt>(float)hp*0.1)amt=llRound(hp*0.1);//Optional healing cap + hp-=amt; + if(hp>mhp)hp=mhp;//Used to prevent overhealing + llResetTime(); + } + //Be sure to update the listen event code block to allow negative damage values through. + } + else if(amt<2) + { + llRegionSayTo(llGetOwnerKey(id),0,"*plink*"); + return; //Blocks micro-LBA, stop that shit + } + else + { + key oid=llGetOwnerKey(id); + integer directional_amt; + if(tmod==ZERO_VECTOR)tmod=collisionmod(pos,targetPos); + directional_amt=llFloor(tmod.x*(float)amt); + if(tmod.y>0.0&&!detrack) + { + if(llFrand(100.0)-amt<0.0)//roll for detrack + { + if(layer>1) + { + llTriggerSound("9213b540-c8de-c7a6-a228-fa3569c5c6ae",1.0); + llOwnerSay("Tracks hit!"); + layer=0; + } + else + { + ++detrack; + list sounds=["af44ee43-b6c8-130a-161d-19282010a84e","d6190a72-9221-3b24-4d0a-a206923f63f1"]; + llTriggerSound(llList2String(sounds,llRound(llFrand(1.0))),1.0); + llOwnerSay("De-tracked!"); + if(!burning)llMessageLinked(-4,0,"",""); + repair=0; + } + } + } + if(tmod.z>0.0&&!burning) + { + if(llFrand(100.0)-amt<0.0)//roll for burn + { + ++burning; + list sounds=["f288bc4f-62bd-9ca1-501e-3afb42d23ef5","2caf350b-ecae-2bc4-1c27-8e7c16ab9e11"]; + llTriggerSound(llList2String(sounds,llRound(llFrand(1.0))),1.0); + llMessageLinked(-4,2,"",""); + repair=0; + } + } + if(directional_amt>1.0) + { + list sounds=["a6c864a1-015a-83d1-bc63-d4b2d5df8482","fd462a07-c691-585c-1c2b-63554c0a71eb","91e2c1a7-238d-b7a7-43b2-00a7fe8f371e"]; + llTriggerSound(llList2String(sounds,llRound(llFrand(2.0))),1.0); + hp-=directional_amt; + } + else //Failed to do damage + { + llOwnerSay("Damage Blocked by Armor"); + llRegionSayTo(llGetOwnerKey(id),0,"Attack was stopped by armor."); + return; + } + llOwnerSay("/me took "+(string)directional_amt+" ("+(string)amt+") damage from "+name+" by "+llKey2Name(oid));//Used to debug output. + llRegionSayTo(oid,0,"/me took "+(string)directional_amt+" ("+(string)amt+") damage"); + } + if(hp<1)die(); + else update(); +} +string modifierstring;//This is visible so moderators can confirm vehicle attributes are within regulation. +update()//SetText +{ + string mod="\n"; + if(burning||detrack) + { + if(burning)mod+="[Burning] "; + if(detrack)mod+="[Detracked]"; + if(!ml)mod+="\n Repair-in-Progress \n"+(string)((integer)repair*10)+"/100"; + } + llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHD]\n "+(string)hp+" / "+(string)mhp+" HP"+mod,<0.0,0.75,1.0>,1.0, + PRIM_DESC,"LBA.v."+ver+(string)hp+","+(string)mhp+","+(string)atcap+",666"+modifierstring]); + //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) +} +die() +{ + llRezObject("Explosion",llGetPos(),ZERO_VECTOR,ZERO_ROTATION,1); + //Add extra shit here + //llResetScript();//Debug + llDie();//Otherwise, use this +} +vector tar(key id) +{ + vector av=(vector)((string)llGetObjectDetails(id,[OBJECT_POS])); + return av; +} +key user; +key gen;//Object rezzer +key me; +integer hear; +boot(integer entry) +{ + modifierstring=",F-"+llGetSubString((string)front,0,2)+//Frontal modifier + ",S-"+llGetSubString((string)side,0,2)+//Side modifier + ",R-"+llGetSubString((string)back,0,2)+//Rear modifier + ",T-"+llGetSubString((string)top,0,2)+//Top modifier + ",B-"+llGetSubString((string)bottom,0,2)+//Bottom modifier + ",M-"+llGetSubString((string)middle,0,2);//Middle Modifier + user=llGetOwner(); + me=llGetKey(); + gen=(string)llGetObjectDetails(me,[OBJECT_REZZER_KEY]); + if(hear)llListenRemove(hear); + integer hex=(integer)("0x" + llGetSubString(llMD5String((string)me,0), 0, 3)); + hear=llListen(hex,"","",""); + llSetTimerEvent(1.0);//Used for auto-delete. + update(); + if(entry)return; + emk=(integer)("0x" + llGetSubString(llMD5String(user,0), 1, 4)); + llListen(emk,"","","emk"); +} +list tracker; +default +{ + state_entry() + { + boot(1); + } + on_rez(integer p) + { + boot(0); + } + listen(integer chan, string name, key id, string message) + { + //[ALWAYS] USE llRegionSayTo(). Do not flood the channel with useless garbage that'll poll every object in listening range. + if(chan==emk) + { + if(llGetOwnerKey(id)!=user)return; + if(detrack) + { + list sounds=["62fafb58-f350-632c-c16d-8928514d52d8","47c80392-832f-8212-a42e-00437fa7ff01"]; + llTriggerSound(llList2String(sounds,llRound(llFrand(1.0))),1.0); + detrack=0; + if(!burning)llMessageLinked(-4,1,"",""); + } + else + { + if(layer<1)++layer; + llOwnerSay("Protected "+(string)layer+" track(s)"); + } + } + else + { + list parse=llParseString2List(message,[","],[" "]); + if(llList2Key(parse,0)==me)//targetcheck + { + list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT]); + vector pos=llGetPos(); + vector targetPos=llList2Vector(data,0); + vector tmod; + integer f=llListFindList(tracker,[name]); + if(f>-1)tmod=llList2Vector(tracker,f+1); + float amt=llList2Float(parse,-1); + if(llFabs(amt)<666.0) + { + if(llList2Integer(data,1)) + { + float dist=llVecDist(targetPos,pos)-1.25;//Backtrack so we don't end up triggering the middle filter. + vector posfix=targetPos+*llList2Rot(data,2);//Do math + if(llVecDist(pos,posfix)<5.0)damage((integer)amt,id,pos,posfix,ZERO_VECTOR,name); + //Check offset to prevent camera-related oofs. + //This technically drops damage but w/e, not a huge issue. + } + else + { + if(tmod)damage((integer)amt,id,pos,targetPos,tmod,name); + else damage((integer)amt,id,pos,targetPos,ZERO_VECTOR,name); + } + } + } + } + } + collision_start(integer c) + { + if(llVecMag(llDetectedVel(0))>40.0) + { + vector gpos=llGetPos(); + if(tracker==[])llSetTimerEvent(1.0); + string name=llDetectedName(0); + integer f=llListFindList(tracker,[name]); + if(f>-1)tracker=llListReplaceList(tracker,[collisionmod(gpos,llDetectedPos(0))],f+1,f+1); + else + { + if(llGetListLength(tracker)>10)tracker=llDeleteSubList(tracker,0,1);//Delete eldest entry to prevent stack-heap + vector cmod=collisionmod(gpos,llDetectedPos(0)); + if(cmod)tracker+=[name,cmod]; + } + //Stores data as follows: OBJECT_NAME,OBJECT_POS + //Updates objects of the same name to the most recent. + } + } + timer()/ + { + if(burning||detrack) + { + ml=llGetAgentInfo(user)&AGENT_MOUSELOOK; + if(ml)repair=0; + else if(++repair>9) + { + if(burning) + { + list sounds=["ada6486e-81ef-667b-0a92-17f20184a7eb","fa2f0288-f012-6741-948c-da30f5cfff68","c13344d6-a9b1-3541-5f40-f0703ce97b8d","2a4d1e97-24ec-250b-ac1c-8e2e9134be26","f0fc1dc6-b4b3-f7bf-a3ce-6961845afbad"]; + llTriggerSound(llList2String(sounds,llRound(llFrand(4.0))),1.0); + burning=0; + if(!detrack)llMessageLinked(-4,1,"",""); + llOwnerSay("Fire is out"); + } + else if(detrack) + { + list sounds=["62fafb58-f350-632c-c16d-8928514d52d8","47c80392-832f-8212-a42e-00437fa7ff01"]; + llTriggerSound(llList2String(sounds,llRound(llFrand(1.0))),1.0); + detrack=0; + llMessageLinked(-4,1,"",""); + llOwnerSay("Tracks repaired"); + } + repair=0; + update(); + } + if(burning) + { + hp-=5; + if(hp>0)update(); + else die(); + } + } + if(tar(gen))return; + llDie(); + } +} From f5f20052964264fead0b37acdcf26179173930b4 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:15:08 -0400 Subject: [PATCH 40/78] Create README.md --- LBH/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 LBH/README.md diff --git a/LBH/README.md b/LBH/README.md new file mode 100644 index 0000000..de45c0e --- /dev/null +++ b/LBH/README.md @@ -0,0 +1,13 @@ +[IMPORTANT] +This requires vehicles/deployables to be aligned properly down the X-axis in order to function properly. Objects which require a rotational offset to function will need to be adjusted. + +Some settings may make the system incompatible with certain rulesets and equipment. However, notes and code for switching these features on and off is present for those who wish to use them. + +Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use a standard LBA core or a different LBA parser instead. + +[CREDITS] +Criss Ixtar - For the initial proof of concept and idea, extensive aid with testing and further development. +Dread Hudson - Establishing the standard LBA format. +Secondary Lionheart - Method, integration, and code. +datbot - For complaining about things he already "fixed" instead of actually helping the community fix them. #OpenSource +Hadet - For convincing Secondary to make a git for LBHD From b86b4b54e95eeaea4cc0d508637ed1f528eed371 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:17:29 -0400 Subject: [PATCH 41/78] Update README.md --- LBH/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/LBH/README.md b/LBH/README.md index de45c0e..7b573de 100644 --- a/LBH/README.md +++ b/LBH/README.md @@ -1,4 +1,5 @@ [IMPORTANT] + This requires vehicles/deployables to be aligned properly down the X-axis in order to function properly. Objects which require a rotational offset to function will need to be adjusted. Some settings may make the system incompatible with certain rulesets and equipment. However, notes and code for switching these features on and off is present for those who wish to use them. @@ -6,8 +7,23 @@ Some settings may make the system incompatible with certain rulesets and equipme Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use a standard LBA core or a different LBA parser instead. [CREDITS] + Criss Ixtar - For the initial proof of concept and idea, extensive aid with testing and further development. + Dread Hudson - Establishing the standard LBA format. + Secondary Lionheart - Method, integration, and code. + datbot - For complaining about things he already "fixed" instead of actually helping the community fix them. #OpenSource + Hadet - For convincing Secondary to make a git for LBHD + + +[VERSIONS] +Slim - Basic Parser. + +AG - Anti-Grief System Included + +HD - Directional Armor + +Component - Includes component system From be7b0a5ebd517e223e9d28808987a2a2ac17f896 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:17:42 -0400 Subject: [PATCH 42/78] Update README.md --- LBH/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/LBH/README.md b/LBH/README.md index 7b573de..620468d 100644 --- a/LBH/README.md +++ b/LBH/README.md @@ -20,6 +20,7 @@ Hadet - For convincing Secondary to make a git for LBHD [VERSIONS] + Slim - Basic Parser. AG - Anti-Grief System Included From f123b838e5b5730634f57d1316db5e698b7a937e Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:18:53 -0400 Subject: [PATCH 43/78] Update LBHD+AG, Directional Armor v1.3.6.lsl --- LBH/LBHD+AG, Directional Armor v1.3.6.lsl | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/LBH/LBHD+AG, Directional Armor v1.3.6.lsl b/LBH/LBHD+AG, Directional Armor v1.3.6.lsl index 52741d0..ab18d46 100644 --- a/LBH/LBHD+AG, Directional Armor v1.3.6.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.3.6.lsl @@ -1,16 +1,3 @@ -/*[IMPORTANT] This requires vehicles/deployables to be aligned properly down the X-axis in order to function properly. Objects which require a rotational offset to function will need to be adjusted. - -Default settings may make the system incompatible with certain rulesets and equipment. However, notes and code for changing these features is present for those who wish to use them. - -Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use the standard LBA or LBH core instead. - -[CREDITS] -Criss Ixtar - For the initial proof of concept and idea. -Dread Hudson - Establishing the standard LBA format. -Secondary Lionheart - Method and integration -Criss Ixtar - For collision-location concept and idea. - -*/ string ver="DHAGv1.3.6";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP From 5ee04231fc33a6cb5341c6b4ccd24f5e5b1a800a Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:19:23 -0400 Subject: [PATCH 44/78] Update LBHD, Directional Armor v1.3.6.lsl --- LBH/LBHD, Directional Armor v1.3.6.lsl | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/LBH/LBHD, Directional Armor v1.3.6.lsl b/LBH/LBHD, Directional Armor v1.3.6.lsl index 7de7765..39f0013 100644 --- a/LBH/LBHD, Directional Armor v1.3.6.lsl +++ b/LBH/LBHD, Directional Armor v1.3.6.lsl @@ -1,16 +1,3 @@ -/*[IMPORTANT] This requires vehicles/deployables to be aligned properly down the X-axis in order to function properly. Objects which require a rotational offset to function will need to be adjusted. - -Default settings may make the system incompatible with certain rulesets and equipment. However, notes and code for changing these features is present for those who wish to use them. - -Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use the standard LBA or LBH core instead. - -[CREDITS] -Criss Ixtar - For the initial proof of concept and idea. -Dread Hudson - Establishing the standard LBA format. -Secondary Lionheart - Method and integration -Criss Ixtar - For collision-location concept and idea and extensive testing contribution - -*/ string ver="DHv1.3.6";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP From eaca2def9e451f5b4bb925155885a71d735552ed Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:24:15 -0400 Subject: [PATCH 45/78] Update README.md --- LBH/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/README.md b/LBH/README.md index 620468d..a100a75 100644 --- a/LBH/README.md +++ b/LBH/README.md @@ -4,7 +4,7 @@ This requires vehicles/deployables to be aligned properly down the X-axis in ord Some settings may make the system incompatible with certain rulesets and equipment. However, notes and code for switching these features on and off is present for those who wish to use them. -Do [not] use this as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use a standard LBA core or a different LBA parser instead. +Do [not] use LBHD systems as your default LBA parser as it would not be optimized for use in equipment that has no intention of benefitting from directional damage resistances. Use a standard LBA or LBH-Slim/AG core instead. [CREDITS] From 71981a86ad7973d6108511810bd49b85d6ab69ee Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:31:43 -0400 Subject: [PATCH 46/78] Update README.md --- LBH/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/LBH/README.md b/LBH/README.md index a100a75..855661e 100644 --- a/LBH/README.md +++ b/LBH/README.md @@ -18,6 +18,7 @@ datbot - For complaining about things he already "fixed" instead of actually hel Hadet - For convincing Secondary to make a git for LBHD +Soapy Boi Gay Pink Dragon - For inspiring the creation of the Hansen, a community effort that has rallied support and development for this project and showing off the capabilities of a directional armor system. [VERSIONS] From 51fee742b8caa63dca23222c1186b278a7911e65 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 9 Jun 2020 18:32:22 -0400 Subject: [PATCH 47/78] Update README.md --- LBH/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/README.md b/LBH/README.md index 855661e..53d7b3b 100644 --- a/LBH/README.md +++ b/LBH/README.md @@ -18,7 +18,7 @@ datbot - For complaining about things he already "fixed" instead of actually hel Hadet - For convincing Secondary to make a git for LBHD -Soapy Boi Gay Pink Dragon - For inspiring the creation of the Hansen, a community effort that has rallied support and development for this project and showing off the capabilities of a directional armor system. +Soapy Boi Gay Pink Dragon - For inspiring the creation of the Hansen, a community effort that has rallied support and development for this project and has allowed us to show off the capabilities of a directional armor system. [VERSIONS] From d18379fafc3f9b17c443427a55797bff7fc4675a Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 16 Jun 2020 04:57:53 -0400 Subject: [PATCH 48/78] Incline fix Fixed inclines/declines causing modifiers to be miscalculated. The first vector in the RotBetween did not have its z-axis removed. --- ...mor v1.3.6.lsl => LBHD+AG, Directional Armor v1.3.7.lsl} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename LBH/{LBHD+AG, Directional Armor v1.3.6.lsl => LBHD+AG, Directional Armor v1.3.7.lsl} (97%) diff --git a/LBH/LBHD+AG, Directional Armor v1.3.6.lsl b/LBH/LBHD+AG, Directional Armor v1.3.7.lsl similarity index 97% rename from LBH/LBHD+AG, Directional Armor v1.3.6.lsl rename to LBH/LBHD+AG, Directional Armor v1.3.7.lsl index ab18d46..c04e7d6 100644 --- a/LBH/LBHD+AG, Directional Armor v1.3.6.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.3.7.lsl @@ -1,4 +1,4 @@ -string ver="DHAGv1.3.6";//LBA Version +string ver="DHAGv1.3.7";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Anti-Grief @@ -72,7 +72,9 @@ float collisionmod(vector pos, vector targetPos) else mod=bottom;//Bottom check } else mod=1.0;//Else reset it to 1.0 - rotation targetRot=llRotBetween(<1.0,0.0,0.0>*llGetRot(),llVecNorm(-pos)); + vector angle=<1.0,0.0,0.0>*llGetRot(); + angle.z=0.0; + rotation targetRot=llRotBetween(llVecNorm(angle),llVecNorm(-pos)); vector targetRotVec=llRot2Euler(targetRot)*RAD_TO_DEG; if(targetRotVec.z>-front_threshold&&targetRotVec.z Date: Tue, 16 Jun 2020 04:58:29 -0400 Subject: [PATCH 49/78] Incline fix --- ... Armor v1.3.6.lsl => LBHD, Directional Armor v1.3.7.lsl} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename LBH/{LBHD, Directional Armor v1.3.6.lsl => LBHD, Directional Armor v1.3.7.lsl} (97%) diff --git a/LBH/LBHD, Directional Armor v1.3.6.lsl b/LBH/LBHD, Directional Armor v1.3.7.lsl similarity index 97% rename from LBH/LBHD, Directional Armor v1.3.6.lsl rename to LBH/LBHD, Directional Armor v1.3.7.lsl index 39f0013..470e089 100644 --- a/LBH/LBHD, Directional Armor v1.3.6.lsl +++ b/LBH/LBHD, Directional Armor v1.3.7.lsl @@ -1,4 +1,4 @@ -string ver="DHv1.3.6";//LBA Version +string ver="DHv1.3.7";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage @@ -32,7 +32,9 @@ float collisionmod(vector pos, vector targetPos) else mod=bottom;//Bottom check } else mod=1.0;//Else reset it to 1.0 - rotation targetRot=llRotBetween(<1.0,0.0,0.0>*llGetRot(),llVecNorm(-pos)); + vector angle=<1.0,0.0,0.0>*llGetRot(); + angle.z=0.0; + rotation targetRot=llRotBetween(llVecNorm(angle),llVecNorm(-pos)); vector targetRotVec=llRot2Euler(targetRot)*RAD_TO_DEG; if(targetRotVec.z>-front_threshold&&targetRotVec.z Date: Tue, 16 Jun 2020 04:59:07 -0400 Subject: [PATCH 50/78] Incline fix --- ...BHD-Component, v1.3.6.lsl => LBHD-Component, v1.3.7.lsl} | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename LBH/{LBHD-Component, v1.3.6.lsl => LBHD-Component, v1.3.7.lsl} (98%) diff --git a/LBH/LBHD-Component, v1.3.6.lsl b/LBH/LBHD-Component, v1.3.7.lsl similarity index 98% rename from LBH/LBHD-Component, v1.3.6.lsl rename to LBH/LBHD-Component, v1.3.7.lsl index 8c1b8c6..4bbd1a9 100644 --- a/LBH/LBHD-Component, v1.3.6.lsl +++ b/LBH/LBHD-Component, v1.3.7.lsl @@ -1,5 +1,5 @@ //MBTLBA was a stupid name -string ver="DHCv1.3.6,";//LBA Version +string ver="DHCv1.3.7,";//LBA Version //efx integer burning;//burning flag integer repair;//repair timer @@ -45,7 +45,9 @@ vector collisionmod(vector pos, vector targetPos) } } else mod=1.0;//Else reset it to 1.0 - rotation targetRot=llRotBetween(<1.0,0.0,0.0>*llGetRot(),llVecNorm(-pos)); + vector angle=<1.0,0.0,0.0>*llGetRot(); + angle.z=0.0; + rotation targetRot=llRotBetween(llVecNorm(angle),llVecNorm(-pos)); vector targetRotVec=llRot2Euler(targetRot)*RAD_TO_DEG; if(targetRotVec.z>-front_threshold&&targetRotVec.z; else if(targetRotVec.z<-back_threshold||targetRotVec.z>back_threshold)return ;//chance to burn From 3f5d581ebf04da7d2c4454c2e4297bd1cf496908 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 21 Jun 2020 08:51:17 -0400 Subject: [PATCH 51/78] Oops Fixed missing condition --- LBH/LBHD+AG, Directional Armor v1.3.7.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/LBHD+AG, Directional Armor v1.3.7.lsl b/LBH/LBHD+AG, Directional Armor v1.3.7.lsl index c04e7d6..0edb662 100644 --- a/LBH/LBHD+AG, Directional Armor v1.3.7.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.3.7.lsl @@ -208,7 +208,7 @@ default if(los(pos,posfix))damage((integer)amt,id,pos,posfix,0.0,name); else damage((integer)amt,id,pos,targetPos,0.0,name); } - else damage(amt,id,pos,targetPos,tmod); + else damage(amt,id,pos,targetPos,tmod,name); } } else damage(amt,id,pos,targetPos,0.0,name); From e2b22d515f6a0a9c45b23f4f13aa5c2b0307dc5a Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 21 Jun 2020 08:57:49 -0400 Subject: [PATCH 52/78] Oops --- LBH/LBHD-Component, v1.3.7.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/LBHD-Component, v1.3.7.lsl b/LBH/LBHD-Component, v1.3.7.lsl index 4bbd1a9..5199004 100644 --- a/LBH/LBHD-Component, v1.3.7.lsl +++ b/LBH/LBHD-Component, v1.3.7.lsl @@ -270,7 +270,7 @@ default //Updates objects of the same name to the most recent. } } - timer()/ + timer() { if(burning||detrack) { From 7f15c31d1187e3d902c7ba4ecfb306f6d1cb0a16 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 21 Jun 2020 12:38:20 -0400 Subject: [PATCH 53/78] No longer supported. LBA or GTFO --- LBH/LBHD, Directional Armor v1.3.7.lsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LBH/LBHD, Directional Armor v1.3.7.lsl b/LBH/LBHD, Directional Armor v1.3.7.lsl index 470e089..35240a6 100644 --- a/LBH/LBHD, Directional Armor v1.3.7.lsl +++ b/LBH/LBHD, Directional Armor v1.3.7.lsl @@ -167,7 +167,7 @@ default } } } - collision_start(integer c)//Enable this block if you want to support legacy collisions. + collision_start(integer c) { if(llVecMag(llDetectedVel(0))>40.0) { @@ -181,7 +181,7 @@ default if(llGetListLength(tracker)>10)tracker=llDeleteSubList(tracker,0,1);//Delete eldest entry to prevent stack-heap tracker+=[name,collisionmod(gpos,llDetectedPos(0))]; } - //Stores data as follows: OBJECT_NAME,OBJECT_POS + //Stores data as follows: OBJECT_NAME,OBJECT_MODIFIER //Updates objects of the same name to the most recent. } } From 1a477ec310dc8872be4643a19ccf32dd7805c17f Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 21 Jun 2020 12:39:10 -0400 Subject: [PATCH 54/78] Updated note with current use-case --- LBH/LBHD+AG, Directional Armor v1.3.7.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/LBHD+AG, Directional Armor v1.3.7.lsl b/LBH/LBHD+AG, Directional Armor v1.3.7.lsl index 0edb662..20a9e82 100644 --- a/LBH/LBHD+AG, Directional Armor v1.3.7.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.3.7.lsl @@ -229,7 +229,7 @@ default if(llGetListLength(tracker)>10)tracker=llDeleteSubList(tracker,0,1);//Delete eldest entry to prevent stack-heap tracker+=[name,collisionmod(gpos,llDetectedPos(0))]; } - //Stores data as follows: OBJECT_NAME,OBJECT_POS + //Stores data as follows: OBJECT_NAME,OBJECT_MODIFIER //Updates objects of the same name to the most recent. } } From fa1260a11b122ef5b2ec3bbc13d3b1e600ca92e1 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 21 Jun 2020 12:39:45 -0400 Subject: [PATCH 55/78] Updated note with current use-case --- LBH/LBHD-Component, v1.3.7.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/LBHD-Component, v1.3.7.lsl b/LBH/LBHD-Component, v1.3.7.lsl index 5199004..38ceebb 100644 --- a/LBH/LBHD-Component, v1.3.7.lsl +++ b/LBH/LBHD-Component, v1.3.7.lsl @@ -266,7 +266,7 @@ default vector cmod=collisionmod(gpos,llDetectedPos(0)); if(cmod)tracker+=[name,cmod]; } - //Stores data as follows: OBJECT_NAME,OBJECT_POS + //Stores data as follows: OBJECT_NAME,OBJECT_MODIFIER //Updates objects of the same name to the most recent. } } From 1a9dd8116561ba52d99c3f201796f4278b8a2b3f Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Sun, 21 Jun 2020 12:40:38 -0400 Subject: [PATCH 56/78] Resolved slight disagreement --- LBH/LBHD, Directional Armor v1.3.7.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/LBHD, Directional Armor v1.3.7.lsl b/LBH/LBHD, Directional Armor v1.3.7.lsl index 35240a6..0248308 100644 --- a/LBH/LBHD, Directional Armor v1.3.7.lsl +++ b/LBH/LBHD, Directional Armor v1.3.7.lsl @@ -12,7 +12,7 @@ float back=1.5; float middle=0.1; //Note that following modifiers multiply the final damage. So it stacks multiplicatively with the previous modifiers float top=1.2; -float bottom=1.2; +float bottom=1.5; //Directional Processor float front_threshold=25.0;//Use positive floats, determines forward range float back_threshold=155.0;//Use positive floats, determines backward range From 83eb3e827e615f1f97825e60ff533ce0257fcb1b Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 26 Jun 2020 11:04:54 -0400 Subject: [PATCH 57/78] v1.4 Threshold Update Top and Bottom thresholds have been separated for more versatile configurations. --- ...r v1.3.7.lsl => LBHD, Directional Armor v1.4.lsl} | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) rename LBH/{LBHD, Directional Armor v1.3.7.lsl => LBHD, Directional Armor v1.4.lsl} (94%) diff --git a/LBH/LBHD, Directional Armor v1.3.7.lsl b/LBH/LBHD, Directional Armor v1.4.lsl similarity index 94% rename from LBH/LBHD, Directional Armor v1.3.7.lsl rename to LBH/LBHD, Directional Armor v1.4.lsl index 0248308..4581aa3 100644 --- a/LBH/LBHD, Directional Armor v1.3.7.lsl +++ b/LBH/LBHD, Directional Armor v1.4.lsl @@ -1,4 +1,4 @@ -string ver="DHv1.3.7";//LBA Version +string ver="DHv1.4";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage @@ -16,7 +16,8 @@ float bottom=1.5; //Directional Processor float front_threshold=25.0;//Use positive floats, determines forward range float back_threshold=155.0;//Use positive floats, determines backward range -float height_threshold=0.75;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height to ground from root position. +float top_threshold=0.75;//How far up the Z axis should the source be to registered a top. (Positive Number) +float bottom_threshold=-0.75;//How far down the Z axis should the source be to registered a bottom hit. (Negative Number) float collisionmod(vector pos, vector targetPos) { if(targetPos) @@ -26,11 +27,8 @@ float collisionmod(vector pos, vector targetPos) else { float mod=targetPos.z-pos.z; - if(llFabs(mod)>=height_threshold)//Determines top/bottom hits - { - if(mod>0.0)mod=top;//Top check - else mod=bottom;//Bottom check - } + if(mod>=top_threshold)mod=top;//Top check + else if(mod<=bottom_threshold)mod=bottom;//Bottom check else mod=1.0;//Else reset it to 1.0 vector angle=<1.0,0.0,0.0>*llGetRot(); angle.z=0.0; From 86264a64086dc21391fe7cb46d49608c5822a8e2 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 26 Jun 2020 11:08:34 -0400 Subject: [PATCH 58/78] v1.4 Threshold Update --- LBH/LBHD-Component, v1.3.7.lsl | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/LBH/LBHD-Component, v1.3.7.lsl b/LBH/LBHD-Component, v1.3.7.lsl index 38ceebb..2c653c8 100644 --- a/LBH/LBHD-Component, v1.3.7.lsl +++ b/LBH/LBHD-Component, v1.3.7.lsl @@ -1,5 +1,5 @@ //MBTLBA was a stupid name -string ver="DHCv1.3.7,";//LBA Version +string ver="DHCv1.4";//LBA Version //efx integer burning;//burning flag integer repair;//repair timer @@ -24,7 +24,8 @@ float bottom=1.2; //Directional Processor float front_threshold=20.0;//Use positive floats, determines forward range float back_threshold=160.0;//Use positive floats, determines backward range -float height_threshold=0.7;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height. +float top_threshold=0.75;//How far up the Z axis should the source be to registered a top. (Positive Number) +float bottom_threshold=-0.75;//How far down the Z axis should the source be to registered a bottom hit. (Negative Number) vector collisionmod(vector pos, vector targetPos) { if(targetPos) @@ -35,14 +36,11 @@ vector collisionmod(vector pos, vector targetPos) else { float mod=targetPos.z-pos.z; - if(llFabs(mod)>=height_threshold)//Determines top/bottom hits + if(mod>=top_threshold)mod=top;//Top check + else if(mod<=bottom_threshold) { - if(mod>0.0)mod=top;//Top check - else - { - ++trak;//Chance to detrack - mod=bottom;//Bottom check - } + ++trak;//Chance to detrack + mod=bottom;//Bottom check } else mod=1.0;//Else reset it to 1.0 vector angle=<1.0,0.0,0.0>*llGetRot(); @@ -151,7 +149,7 @@ update()//SetText if(!ml)mod+="\n Repair-in-Progress \n"+(string)((integer)repair*10)+"/100"; } llSetLinkPrimitiveParamsFast(-4,[PRIM_TEXT,"[LBHD]\n "+(string)hp+" / "+(string)mhp+" HP"+mod,<0.0,0.75,1.0>,1.0, - PRIM_DESC,"LBA.v."+ver+(string)hp+","+(string)mhp+","+(string)atcap+",666"+modifierstring]); + PRIM_DESC,"LBA.v."+ver+","+(string)hp+","+(string)mhp+","+(string)atcap+",666"+modifierstring]); //In order: Current HP, Max HP, Max AT accepted, Max healing accepted (Not implemented) } die() From bc95af1d8f382e3acf4c6687cc6908aa2bafa822 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 26 Jun 2020 11:08:51 -0400 Subject: [PATCH 59/78] Rename LBHD-Component, v1.3.7.lsl to LBHD-Component, v1.4.lsl --- LBH/{LBHD-Component, v1.3.7.lsl => LBHD-Component, v1.4.lsl} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LBH/{LBHD-Component, v1.3.7.lsl => LBHD-Component, v1.4.lsl} (100%) diff --git a/LBH/LBHD-Component, v1.3.7.lsl b/LBH/LBHD-Component, v1.4.lsl similarity index 100% rename from LBH/LBHD-Component, v1.3.7.lsl rename to LBH/LBHD-Component, v1.4.lsl From 38851286d78a7c85fae3a83d501e1e9861fb945f Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 26 Jun 2020 11:10:05 -0400 Subject: [PATCH 60/78] v1.4 Threshold Update --- ...1.3.7.lsl => LBHD+AG, Directional Armor v1.4.lsl} | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) rename LBH/{LBHD+AG, Directional Armor v1.3.7.lsl => LBHD+AG, Directional Armor v1.4.lsl} (95%) diff --git a/LBH/LBHD+AG, Directional Armor v1.3.7.lsl b/LBH/LBHD+AG, Directional Armor v1.4.lsl similarity index 95% rename from LBH/LBHD+AG, Directional Armor v1.3.7.lsl rename to LBH/LBHD+AG, Directional Armor v1.4.lsl index 20a9e82..54e4266 100644 --- a/LBH/LBHD+AG, Directional Armor v1.3.7.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.4.lsl @@ -1,4 +1,4 @@ -string ver="DHAGv1.3.7";//LBA Version +string ver="DHAGv1.4";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Anti-Grief @@ -56,7 +56,8 @@ float bottom=1.2; //Directional Processor float front_threshold=25.0;//Use positive floats, determines forward range float back_threshold=155.0;//Use positive floats, determines backward range -float height_threshold=0.75;//How far up/down the Z axis should the source be to registered a top or bottom hit. Should be roughly half the vehicle's height to ground from root position. +float top_threshold=0.75;//How far up the Z axis should the source be to registered a top. (Positive Number) +float bottom_threshold=-0.75;//How far down the Z axis should the source be to registered a bottom hit. (Negative Number) float collisionmod(vector pos, vector targetPos) { if(targetPos) @@ -66,11 +67,8 @@ float collisionmod(vector pos, vector targetPos) else { float mod=targetPos.z-pos.z; - if(llFabs(mod)>=height_threshold)//Determines top/bottom hits - { - if(mod>0.0)mod=top;//Top check - else mod=bottom;//Bottom check - } + if(mod>=top_threshold)mod=top;//Top check + else if(mod<=bottom_threshold)mod=bottom;//Bottom check else mod=1.0;//Else reset it to 1.0 vector angle=<1.0,0.0,0.0>*llGetRot(); angle.z=0.0; From 239b5a7eddf4d22162a587559b72d88ee4b9baf3 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 26 Jun 2020 11:13:02 -0400 Subject: [PATCH 61/78] Bye Nerd --- LBH/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/LBH/README.md b/LBH/README.md index 53d7b3b..bf24f5f 100644 --- a/LBH/README.md +++ b/LBH/README.md @@ -14,8 +14,6 @@ Dread Hudson - Establishing the standard LBA format. Secondary Lionheart - Method, integration, and code. -datbot - For complaining about things he already "fixed" instead of actually helping the community fix them. #OpenSource - Hadet - For convincing Secondary to make a git for LBHD Soapy Boi Gay Pink Dragon - For inspiring the creation of the Hansen, a community effort that has rallied support and development for this project and has allowed us to show off the capabilities of a directional armor system. From 0de8777fa90a01fa4dcdc421d83618352f08893c Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 26 Jun 2020 11:15:01 -0400 Subject: [PATCH 62/78] Clarified legacy support --- LBH/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LBH/README.md b/LBH/README.md index bf24f5f..e7bbc1c 100644 --- a/LBH/README.md +++ b/LBH/README.md @@ -20,10 +20,10 @@ Soapy Boi Gay Pink Dragon - For inspiring the creation of the Hansen, a communit [VERSIONS] -Slim - Basic Parser. +Slim - Basic Parser, can support Collision Damage. AG - Anti-Grief System Included -HD - Directional Armor +HD - Directional Armor, does not support Collision Damage. Component - Includes component system From d1ae3c439171c162979c0672bcec858c00883acc Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Mon, 27 Jul 2020 10:36:38 -0400 Subject: [PATCH 63/78] v1.4.1 Update - Adjusted detection for some LBA sources rezzed by a non-attached object --- ...mponent, v1.4.lsl => LBHD-Component, v1.4.1.lsl} | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) rename LBH/{LBHD-Component, v1.4.lsl => LBHD-Component, v1.4.1.lsl} (96%) diff --git a/LBH/LBHD-Component, v1.4.lsl b/LBH/LBHD-Component, v1.4.1.lsl similarity index 96% rename from LBH/LBHD-Component, v1.4.lsl rename to LBH/LBHD-Component, v1.4.1.lsl index 2c653c8..a8e486a 100644 --- a/LBH/LBHD-Component, v1.4.lsl +++ b/LBH/LBHD-Component, v1.4.1.lsl @@ -1,5 +1,5 @@ //MBTLBA was a stupid name -string ver="DHCv1.4";//LBA Version +string ver="DHCv1.4.1";//LBA Version //efx integer burning;//burning flag integer repair;//repair timer @@ -223,12 +223,17 @@ default list parse=llParseString2List(message,[","],[" "]); if(llList2Key(parse,0)==me)//targetcheck { - list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT]); + list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT,OBJECT_REZZER_KEY]); vector pos=llGetPos(); vector targetPos=llList2Vector(data,0); - vector tmod; + float tmod; integer f=llListFindList(tracker,[name]); - if(f>-1)tmod=llList2Vector(tracker,f+1); + if(f>-1)tmod=llList2Float(tracker,f+1); + else //Rezzer rezzer's rezzer rezzer + { + f=llListFindList(tracker,[llList2Key(data,4)]); + if(f>-1)tmod=llList2Float(tracker,f+1); + } float amt=llList2Float(parse,-1); if(llFabs(amt)<666.0) { From b098808d3d1ac100fa7464328f23f7756b147d60 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Mon, 27 Jul 2020 10:37:24 -0400 Subject: [PATCH 64/78] Update and rename LBHD, Directional Armor v1.4.lsl to LBHD, Directional Armor v1.4.1.lsl --- ...Armor v1.4.lsl => LBHD, Directional Armor v1.4.1.lsl} | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) rename LBH/{LBHD, Directional Armor v1.4.lsl => LBHD, Directional Armor v1.4.1.lsl} (96%) diff --git a/LBH/LBHD, Directional Armor v1.4.lsl b/LBH/LBHD, Directional Armor v1.4.1.lsl similarity index 96% rename from LBH/LBHD, Directional Armor v1.4.lsl rename to LBH/LBHD, Directional Armor v1.4.1.lsl index 4581aa3..5e711e6 100644 --- a/LBH/LBHD, Directional Armor v1.4.lsl +++ b/LBH/LBHD, Directional Armor v1.4.1.lsl @@ -1,4 +1,4 @@ -string ver="DHv1.4";//LBA Version +string ver="DHv1.4.1";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage @@ -145,12 +145,17 @@ default list parse=llParseString2List(message,[","],[" "]); if(llList2Key(parse,0)==me)//targetcheck { - list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT]); + list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT,OBJECT_REZZER_KEY]); vector pos=llGetPos(); vector targetPos=llList2Vector(data,0); float tmod; integer f=llListFindList(tracker,[name]); if(f>-1)tmod=llList2Float(tracker,f+1); + else //Rezzer rezzer's rezzer rezzer + { + f=llListFindList(tracker,[llList2Key(data,4)]); + if(f>-1)tmod=llList2Float(tracker,f+1); + } float amt=llList2Float(parse,-1); if(llFabs(amt)<666.0) { From d559b428cd5aace9a8d71092d13d729ded14036d Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Mon, 27 Jul 2020 10:39:19 -0400 Subject: [PATCH 65/78] Update and rename LBHD+AG, Directional Armor v1.4.lsl to LBHD+AG, Directional Armor v1.4.1.lsl --- ...v1.4.lsl => LBHD+AG, Directional Armor v1.4.1.lsl} | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename LBH/{LBHD+AG, Directional Armor v1.4.lsl => LBHD+AG, Directional Armor v1.4.1.lsl} (96%) diff --git a/LBH/LBHD+AG, Directional Armor v1.4.lsl b/LBH/LBHD+AG, Directional Armor v1.4.1.lsl similarity index 96% rename from LBH/LBHD+AG, Directional Armor v1.4.lsl rename to LBH/LBHD+AG, Directional Armor v1.4.1.lsl index 54e4266..fa26973 100644 --- a/LBH/LBHD+AG, Directional Armor v1.4.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.4.1.lsl @@ -1,4 +1,4 @@ -string ver="DHAGv1.4";//LBA Version +string ver="DHAGv1.4.1";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Anti-Grief @@ -185,10 +185,10 @@ default list parse=llParseString2List(message,[","],[" "]); if(llList2Key(parse,0)==me)//targetcheck { - list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT]); + list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT,OBJECT_REZZER_KEY]); vector pos=llGetPos(); vector targetPos=llList2Vector(data,0); - integer amt=llList2Integer(parse,-1); + float amt=llList2Float(parse,-1); if(llFabs(amt)<666)//Use this code to allow object healing, Blocks overflow attempts { if(amt>0) @@ -198,6 +198,11 @@ default float tmod; integer f=llListFindList(tracker,[name]); if(f>-1)tmod=llList2Float(tracker,f+1); + else //Rezzer rezzer's rezzer rezzer + { + f=llListFindList(tracker,[llList2Key(data,4)]); + if(f>-1)tmod=llList2Float(tracker,f+1); + } llSetTimerEvent(interval);//Reset interval on new damage update if(llList2Integer(data,1)) { From 7dbb3e55c018f627cd0c2da175a61ed1a8d393a9 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Fri, 7 Aug 2020 10:33:05 -0400 Subject: [PATCH 66/78] Fixed incorrect typecast --- ...D-Component, v1.4.1.lsl => LBHD-Component, v1.4.2.lsl} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename LBH/{LBHD-Component, v1.4.1.lsl => LBHD-Component, v1.4.2.lsl} (98%) diff --git a/LBH/LBHD-Component, v1.4.1.lsl b/LBH/LBHD-Component, v1.4.2.lsl similarity index 98% rename from LBH/LBHD-Component, v1.4.1.lsl rename to LBH/LBHD-Component, v1.4.2.lsl index a8e486a..362449a 100644 --- a/LBH/LBHD-Component, v1.4.1.lsl +++ b/LBH/LBHD-Component, v1.4.2.lsl @@ -1,5 +1,5 @@ //MBTLBA was a stupid name -string ver="DHCv1.4.1";//LBA Version +string ver="DHCv1.4.2";//LBA Version //efx integer burning;//burning flag integer repair;//repair timer @@ -226,13 +226,13 @@ default list data=llGetObjectDetails(id,[OBJECT_POS,OBJECT_ATTACHED_POINT,OBJECT_ROT,OBJECT_REZZER_KEY]); vector pos=llGetPos(); vector targetPos=llList2Vector(data,0); - float tmod; + vector tmod; integer f=llListFindList(tracker,[name]); - if(f>-1)tmod=llList2Float(tracker,f+1); + if(f>-1)tmod=llList2Vector(tracker,f+1); else //Rezzer rezzer's rezzer rezzer { f=llListFindList(tracker,[llList2Key(data,4)]); - if(f>-1)tmod=llList2Float(tracker,f+1); + if(f>-1)tmod=llList2Vector(tracker,f+1); } float amt=llList2Float(parse,-1); if(llFabs(amt)<666.0) From e2fe8112aa97371524439bf4e343f7cb7220e10a Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Tue, 18 Aug 2020 19:02:16 -0400 Subject: [PATCH 67/78] Rotational fix for top/bottom modifiers(TEST THIS) --- LBH/{LBHD-Component, v1.4.2.lsl => LBHD-Component, v1.4.3.lsl} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename LBH/{LBHD-Component, v1.4.2.lsl => LBHD-Component, v1.4.3.lsl} (99%) diff --git a/LBH/LBHD-Component, v1.4.2.lsl b/LBH/LBHD-Component, v1.4.3.lsl similarity index 99% rename from LBH/LBHD-Component, v1.4.2.lsl rename to LBH/LBHD-Component, v1.4.3.lsl index 362449a..d48fc8e 100644 --- a/LBH/LBHD-Component, v1.4.2.lsl +++ b/LBH/LBHD-Component, v1.4.3.lsl @@ -35,7 +35,8 @@ vector collisionmod(vector pos, vector targetPos) if(dist<1.0)return <0.01,0.0,0.0>;//This catches explosions which rezzes AT in the object's root position. else { - float mod=targetPos.z-pos.z; + vector fpos=(targetPos-pos)/llGetRot(); + float mod=fpos.z; if(mod>=top_threshold)mod=top;//Top check else if(mod<=bottom_threshold) { From 1ab8e0ca9c25e87a23df9bba3939ea612fcedb62 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Thu, 10 Sep 2020 17:46:18 -0400 Subject: [PATCH 68/78] Update LBHD-Component, v1.4.3.lsl --- LBH/LBHD-Component, v1.4.3.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/LBHD-Component, v1.4.3.lsl b/LBH/LBHD-Component, v1.4.3.lsl index d48fc8e..6571aea 100644 --- a/LBH/LBHD-Component, v1.4.3.lsl +++ b/LBH/LBHD-Component, v1.4.3.lsl @@ -1,5 +1,5 @@ //MBTLBA was a stupid name -string ver="DHCv1.4.2";//LBA Version +string ver="DHCv1.4.3";//LBA Version //efx integer burning;//burning flag integer repair;//repair timer From 9be159b85e00e2338ceb58dc94bc0b375c67a905 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Thu, 10 Sep 2020 17:47:19 -0400 Subject: [PATCH 69/78] Update and rename LBHD+AG, Directional Armor v1.4.1.lsl to LBHD+AG, Directional Armor v1.4.2.lsl --- ...rmor v1.4.1.lsl => LBHD+AG, Directional Armor v1.4.2.lsl} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename LBH/{LBHD+AG, Directional Armor v1.4.1.lsl => LBHD+AG, Directional Armor v1.4.2.lsl} (98%) diff --git a/LBH/LBHD+AG, Directional Armor v1.4.1.lsl b/LBH/LBHD+AG, Directional Armor v1.4.2.lsl similarity index 98% rename from LBH/LBHD+AG, Directional Armor v1.4.1.lsl rename to LBH/LBHD+AG, Directional Armor v1.4.2.lsl index fa26973..1549513 100644 --- a/LBH/LBHD+AG, Directional Armor v1.4.1.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.4.2.lsl @@ -1,4 +1,4 @@ -string ver="DHAGv1.4.1";//LBA Version +string ver="DHAGv1.4.2";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Anti-Grief @@ -66,7 +66,8 @@ float collisionmod(vector pos, vector targetPos) if(dist<1.0)return middle;//This catches explosions which rezzes AT in the object's root position. else { - float mod=targetPos.z-pos.z; + vector fpos=(targetPos-pos)/llGetRot(); + float mod=fpos.z; if(mod>=top_threshold)mod=top;//Top check else if(mod<=bottom_threshold)mod=bottom;//Bottom check else mod=1.0;//Else reset it to 1.0 From cd5f91e7c112d35eff615613d0b2ef397b7b89df Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Thu, 10 Sep 2020 17:47:49 -0400 Subject: [PATCH 70/78] Update and rename LBHD, Directional Armor v1.4.1.lsl to LBHD, Directional Armor v1.4.2.lsl --- ...l Armor v1.4.1.lsl => LBHD, Directional Armor v1.4.2.lsl} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename LBH/{LBHD, Directional Armor v1.4.1.lsl => LBHD, Directional Armor v1.4.2.lsl} (98%) diff --git a/LBH/LBHD, Directional Armor v1.4.1.lsl b/LBH/LBHD, Directional Armor v1.4.2.lsl similarity index 98% rename from LBH/LBHD, Directional Armor v1.4.1.lsl rename to LBH/LBHD, Directional Armor v1.4.2.lsl index 5e711e6..de66647 100644 --- a/LBH/LBHD, Directional Armor v1.4.1.lsl +++ b/LBH/LBHD, Directional Armor v1.4.2.lsl @@ -1,4 +1,4 @@ -string ver="DHv1.4.1";//LBA Version +string ver="DHv1.4.2";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage @@ -26,7 +26,8 @@ float collisionmod(vector pos, vector targetPos) if(dist<1.0)return middle;//This catches explosions which rezzes AT in the object's root position. else { - float mod=targetPos.z-pos.z; + vector fpos=(targetPos-pos)/llGetRot(); + float mod=fpos.z; if(mod>=top_threshold)mod=top;//Top check else if(mod<=bottom_threshold)mod=bottom;//Bottom check else mod=1.0;//Else reset it to 1.0 From 9fa4b1bc9b4ccd63d1187a312bc9876aeb220ce1 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:56:28 -0400 Subject: [PATCH 71/78] How did I not catch this --- ... Armor v1.4.2.lsl => LBHD+AG, Directional Armor v1.4.3.lsl} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename LBH/{LBHD+AG, Directional Armor v1.4.2.lsl => LBHD+AG, Directional Armor v1.4.3.lsl} (99%) diff --git a/LBH/LBHD+AG, Directional Armor v1.4.2.lsl b/LBH/LBHD+AG, Directional Armor v1.4.3.lsl similarity index 99% rename from LBH/LBHD+AG, Directional Armor v1.4.2.lsl rename to LBH/LBHD+AG, Directional Armor v1.4.3.lsl index 1549513..15527c0 100644 --- a/LBH/LBHD+AG, Directional Armor v1.4.2.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.4.3.lsl @@ -93,8 +93,9 @@ damage(integer amt, key id,vector pos, vector targetPos, float tmod,string name) { if(llGetTime()>1.0)//Optional healing cooldown { + amt*=-1.0; if(amt>(float)hp*0.1)amt=llRound(hp*0.1);//Optional healing cap - hp-=amt; + hp+=amt; if(hp>mhp)hp=mhp;//Used to prevent overhealing llResetTime(); } From e840677ad3b7fe9c362188de101c6fffbccfec7d Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:59:01 -0400 Subject: [PATCH 72/78] Update LBHD+AG, Directional Armor v1.4.3.lsl --- LBH/LBHD+AG, Directional Armor v1.4.3.lsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LBH/LBHD+AG, Directional Armor v1.4.3.lsl b/LBH/LBHD+AG, Directional Armor v1.4.3.lsl index 15527c0..ce575e0 100644 --- a/LBH/LBHD+AG, Directional Armor v1.4.3.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.4.3.lsl @@ -213,10 +213,10 @@ default if(los(pos,posfix))damage((integer)amt,id,pos,posfix,0.0,name); else damage((integer)amt,id,pos,targetPos,0.0,name); } - else damage(amt,id,pos,targetPos,tmod,name); + else damage((integer)amt,id,pos,targetPos,tmod,name); } } - else damage(amt,id,pos,targetPos,0.0,name); + else damage((integer)amt,id,pos,targetPos,0.0,name); } } } From a5915a831ccffa5e83eec07e16facc2455a99422 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:59:49 -0400 Subject: [PATCH 73/78] Fixed healing cap not working --- ...nal Armor v1.4.2.lsl => LBHD, Directional Armor v1.4.3.lsl} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename LBH/{LBHD, Directional Armor v1.4.2.lsl => LBHD, Directional Armor v1.4.3.lsl} (99%) diff --git a/LBH/LBHD, Directional Armor v1.4.2.lsl b/LBH/LBHD, Directional Armor v1.4.3.lsl similarity index 99% rename from LBH/LBHD, Directional Armor v1.4.2.lsl rename to LBH/LBHD, Directional Armor v1.4.3.lsl index de66647..5769c8f 100644 --- a/LBH/LBHD, Directional Armor v1.4.2.lsl +++ b/LBH/LBHD, Directional Armor v1.4.3.lsl @@ -53,8 +53,9 @@ damage(integer amt, key id,vector pos, vector targetPos, float tmod, string name { if(llGetTime()>1.0)//Optional healing cooldown { + amt*=-1.0; if(amt>(float)hp*0.1)amt=llRound(hp*0.1);//Optional healing cap - hp-=amt; + hp+=amt; if(hp>mhp)hp=mhp;//Used to prevent overhealing llResetTime(); } From 1d3ecb82837ba4d4b243026b4ad24cdec9dbbf1e Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:00:49 -0400 Subject: [PATCH 74/78] Update and rename LBHD-Component, v1.4.3.lsl to LBHD-Component, v1.4.4.lsl --- ...HD-Component, v1.4.3.lsl => LBHD-Component, v1.4.4.lsl} | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename LBH/{LBHD-Component, v1.4.3.lsl => LBHD-Component, v1.4.4.lsl} (99%) diff --git a/LBH/LBHD-Component, v1.4.3.lsl b/LBH/LBHD-Component, v1.4.4.lsl similarity index 99% rename from LBH/LBHD-Component, v1.4.3.lsl rename to LBH/LBHD-Component, v1.4.4.lsl index 6571aea..1ed6d6c 100644 --- a/LBH/LBHD-Component, v1.4.3.lsl +++ b/LBH/LBHD-Component, v1.4.4.lsl @@ -1,5 +1,5 @@ //MBTLBA was a stupid name -string ver="DHCv1.4.3";//LBA Version +string ver="DHCv1.4.4";//LBA Version //efx integer burning;//burning flag integer repair;//repair timer @@ -71,14 +71,15 @@ damage(integer amt, key id,vector pos, vector targetPos,vector tmod,string name) llMessageLinked(-4,1,"",""); llOwnerSay("Status Repaired"); } + amt*=-1.0; if(amt>(float)hp*0.1)amt=llRound(hp*0.1);//Optional healing cap - hp-=amt; + hp+=amt; if(hp>mhp)hp=mhp;//Used to prevent overhealing llResetTime(); } //Be sure to update the listen event code block to allow negative damage values through. } - else if(amt<2) + else if(amt<6) { llRegionSayTo(llGetOwnerKey(id),0,"*plink*"); return; //Blocks micro-LBA, stop that shit From 9621ca5b960b30d43ff176caa16f862d687ef7e8 Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:01:00 -0400 Subject: [PATCH 75/78] Update LBHD, Directional Armor v1.4.3.lsl --- LBH/LBHD, Directional Armor v1.4.3.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/LBHD, Directional Armor v1.4.3.lsl b/LBH/LBHD, Directional Armor v1.4.3.lsl index 5769c8f..2254b99 100644 --- a/LBH/LBHD, Directional Armor v1.4.3.lsl +++ b/LBH/LBHD, Directional Armor v1.4.3.lsl @@ -1,4 +1,4 @@ -string ver="DHv1.4.2";//LBA Version +string ver="DHv1.4.3";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Positive Numbers Deal Damage From bc0f679f75515ec9c0f90d4ba2f5469f5f06349f Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:01:14 -0400 Subject: [PATCH 76/78] Update LBHD+AG, Directional Armor v1.4.3.lsl --- LBH/LBHD+AG, Directional Armor v1.4.3.lsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LBH/LBHD+AG, Directional Armor v1.4.3.lsl b/LBH/LBHD+AG, Directional Armor v1.4.3.lsl index ce575e0..08361d7 100644 --- a/LBH/LBHD+AG, Directional Armor v1.4.3.lsl +++ b/LBH/LBHD+AG, Directional Armor v1.4.3.lsl @@ -1,4 +1,4 @@ -string ver="DHAGv1.4.2";//LBA Version +string ver="DHAGv1.4.3";//LBA Version integer mhp=200;//Maximum HP integer hp=mhp;//Current HP //Anti-Grief From 56a9af8098bc91977bf2e5121d7fed03f03b704f Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:01:52 -0400 Subject: [PATCH 77/78] Update and rename LBH-AG v1.2.4.lsl to LBH-AG v1.2.5.lsl --- LBH/{LBH-AG v1.2.4.lsl => LBH-AG v1.2.5.lsl} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename LBH/{LBH-AG v1.2.4.lsl => LBH-AG v1.2.5.lsl} (99%) diff --git a/LBH/LBH-AG v1.2.4.lsl b/LBH/LBH-AG v1.2.5.lsl similarity index 99% rename from LBH/LBH-AG v1.2.4.lsl rename to LBH/LBH-AG v1.2.5.lsl index dccda80..6f44189 100644 --- a/LBH/LBH-AG v1.2.4.lsl +++ b/LBH/LBH-AG v1.2.5.lsl @@ -12,8 +12,9 @@ damage(integer amt, key id) { if(llGetTime()>1.0)//Optional healing cooldown { + amt*=-1; if(amt>(float)hp*0.1)amt=llRound((float)hp*0.1);//Optional healing cap - hp-=amt; + hp+=amt; if(hp>mhp)hp=mhp;//Used to prevent overhealing llResetTime(); } From 1214301a90a288c1a0760351f43dfc767341d52f Mon Sep 17 00:00:00 2001 From: MalefactorIX <64609068+MalefactorIX@users.noreply.github.com> Date: Wed, 12 Oct 2022 14:02:19 -0400 Subject: [PATCH 78/78] Update and rename LBH Slim v1.2.4.lsl to LBH Slim v1.2.5.lsl --- LBH/{LBH Slim v1.2.4.lsl => LBH Slim v1.2.5.lsl} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename LBH/{LBH Slim v1.2.4.lsl => LBH Slim v1.2.5.lsl} (98%) diff --git a/LBH/LBH Slim v1.2.4.lsl b/LBH/LBH Slim v1.2.5.lsl similarity index 98% rename from LBH/LBH Slim v1.2.4.lsl rename to LBH/LBH Slim v1.2.5.lsl index e48b373..de4a3e7 100644 --- a/LBH/LBH Slim v1.2.4.lsl +++ b/LBH/LBH Slim v1.2.5.lsl @@ -12,8 +12,9 @@ damage(integer amt, key id) { if(llGetTime()>1.0)//Optional healing cooldown { + amt*=-1; if(amt>(float)hp*0.1)amt=llRound((float)hp*0.1);//Optional healing cap - hp-=amt; + hp+=amt; if(hp>mhp)hp=mhp;//Used to prevent overhealing llResetTime(); }