Created
June 26, 2012 12:50
-
-
Save svandragt/2995629 to your computer and use it in GitHub Desktop.
Sculptie Damage Script - SecondLife Armor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is an initial finished prototype demonstrating Sculptie based armor that is affected by damage. (multiple stages of degradation, bullit holes etc) | |
integer damageStage = -1; | |
SendStatus(integer dmg) | |
{ | |
string texture = llGetInventoryName(INVENTORY_TEXTURE,dmg); | |
list params = [PRIM_TYPE, PRIM_TYPE_SCULPT, texture, PRIM_SCULPT_TYPE_SPHERE]; | |
llSetLinkPrimitiveParams(LINK_ALL_OTHERS,params); | |
} | |
DamageIncrease() | |
{ | |
damageStage++; | |
integer totalSculpts = llGetInventoryNumber(INVENTORY_TEXTURE); | |
if (damageStage >= totalSculpts) | |
damageStage -= totalSculpts; | |
string texture = llGetInventoryName(INVENTORY_TEXTURE,damageStage); | |
list params = [PRIM_TYPE, PRIM_TYPE_SCULPT, texture, PRIM_SCULPT_TYPE_SPHERE]; | |
llSetPrimitiveParams(params); | |
SendStatus(damageStage + 1); | |
} | |
default | |
{ | |
state_entry() | |
{ | |
llSetLinkAlpha(LINK_ALL_OTHERS, 0.0,ALL_SIDES); | |
DamageIncrease(); | |
} | |
collision_end(integer total_number) | |
{ | |
DamageIncrease(); | |
llSay(0,"success"); | |
} | |
touch_end(integer total_number) | |
{ | |
DamageIncrease(); | |
llOwnerSay("success"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment