Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Scripter needed for a project

Programmer Wiefel
Registered User
Join date: 8 Mar 2008
Posts: 9
07-15-2008 14:56
Hi everyone!

Im doing a combat system for a friend, but I don't have anytime! Im going on vacation for the next couple weeks, so I need someone to modify this open source combat system for me.

What I need done-

1. The display on the Combat system (I'll just call is CS" is broken, I need that fixed.
2. I need the system to tell 3 objects attached to a HUD when to be set alpha. The first prim becomes clear when 66% of the health is gone, the second at 33%, and the third when there is 0% health, then when the person revives, they all become opaque again.
3. Take out the Armor part of the system.


Im willing to pay 1.5k Lindens for someone to do this. Heres the open source CS:



/////////////// Simple Combat Display - Uniform Mass Collision v1.1 \\\\\\\\\\\\\\\\\\\\\\\\\\\\
//////////////////////////////// by: Haplo Voss

// If you do actually use this as a model, by all means have at it. I'd appreciate it if you would
// leave my name in the credits above, and anyone else who might add / change this as it moves along
//

// This is a very simple system and does not attemp to dilineate where an impact occurred. I have
// left plenty of moddable variables to add any sort of chat based weapon-specific report you want
// still leaving it open to any impact at all if you so choose. Why? NO MODDED WEAPONS NEEDED


key gID;
string owner;

// Setup the meters. Probably a better way to do this.
string display_E = "|||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||||";
string display_AS = display_E;
string display_ARM = display_E;
string display_E_S = " ";
string display_AS_S = display_E_S;
string display_ARM_S = display_E_S;

// These are the meter descriptors
string display_e;
string display_as;
string display_arm;

string class = "Warrior"; //(Generic - rename accordingly)
// This block contains your starting points for calculation maths. Do not change from 80.
// If you know a way to update to make all variables work that's great, this script as it sits... doesn't

integer health = 80;
integer endurance = 80;
integer armor = 80;

//These are your damage scale variables. You will define them below.
integer he_damage;
integer en_damage;
integer ar_damage;

//Display Text Color variables
float r = 0; float g = 1; float b = 1;

//////////////////////////////////////////////////////////////////////////////////////


armor_calc(integer damage)
{
if (damage > ar_damage)
{
health = (health - he_damage);
armor = (armor - ar_damage);
}

else if (damage < (ar_damage + 1))
{
armor = 0;
health = (health - (he_damage + 8));
endurance = (endurance - en_damage);
r = 1; g = 0; b = 0;
}
}

health_calc(integer damage)
{
if (health < 1)
{
health = 0;
armor = 0;
endurance = (endurance - (en_damage + 6));
}
}

endurance_calc(integer damage)
{
if (endurance < 1)
{
endurance = 0;
process_text(0);
llSay(0, "You are DEAD!!!";);
llRequestPermissions(llGetOwner(),PERMISSION_TRIGG ER_ANIMATION);
llStartAnimation("driver3";);
llSleep(5);
llStopAnimation("driver3";);
health = 80;
endurance = 80;
armor = 80;
display_e = display_E;
display_as = display_AS;
display_arm = display_ARM;
r = 0; g = 1; b = 1;
}
}

process_text(integer none)
{
display_e = "";
display_as = "";
display_arm = "";
display_e = llGetSubString(display_E,0,health/2) + llGetSubString(display_E_S,0,(40 - (health/2)));
display_as = llGetSubString(display_AS,0,endurance/2)+ llGetSubString(display_AS_S,0,(40 - (endurance/2)));
display_arm = llGetSubString(display_ARM,0,armor/2) + llGetSubString(display_ARM_S,0,(40 - (armor/2)));

llSetText(owner + " - " + class + "\n" +
"[ " + display_e + " ] : Health :\n" +
"[ " + display_as + " ] : Stamina :\n" +
"[ " + display_arm + " ] : Armor :",<r,g,b>,1);
}


health_level(string weapon)
{
armor_calc(armor);

health_calc(health);

endurance_calc(endurance);

process_text(0);
}

recharge()
{
if ((health + 2) < 80){health += 3;}
if ((endurance + 3) < 80){endurance += 4;}
if ((armor + 2) < 80){armor += 2;}
process_text(0);
}



default
{
state_entry()
{
llRequestPermissions(llGetOwner(),PERMISSION_TRIGG ER_ANIMATION);
gID = llGetOwner();
owner = llKey2Name(gID);
llSetText("",<1,1,1>,1);
process_text(0);

llSetTimerEvent(4); // (Time it takes for each incriment towards recharge.

llListen (9919,"","","";);
}

listen (integer channel, string name, key id, string msg)
{
// This is an example of a specific weapon definition
if (msg == "blaster";)
{
he_damage = 3;
en_damage = 2;
ar_damage = 8;

health_level(msg); //Use this to pass information to the sub if you want
//Even more options within the call.
}

else if (msg != "";) // This would be your standard undefined weapon "hit"
{
he_damage = 3;
en_damage = 2;
ar_damage = 5;

health_level(msg);
}
}

timer ()
{
if (armor > 40){r=.5; g=1; b=1;}
if (armor > 40){r=.1; g=1; b=1;}
recharge();
}

}

Thanks for reading this. If you are interested, Post here or send me a notecard inworld.
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
07-15-2008 14:57
Hello - you have posted this in the wrong forum. I might suggest that you will get the response you require if you post this in "Products Wanted". This is "Scripting Tips".
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Programmer Wiefel
Registered User
Join date: 8 Mar 2008
Posts: 9
07-15-2008 15:40
Sorry! How can I get this moved?
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
07-15-2008 15:42
Just post it again in "Products Wanted", that will be the quickest thing to be honest.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!

http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal

http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
Programmer Wiefel
Registered User
Join date: 8 Mar 2008
Posts: 9
Thanks
07-15-2008 16:05
From: Ordinal Malaprop
Just post it again in "Products Wanted", that will be the quickest thing to be honest.


Thanks!

PS Im a big fan of your bottle crate target!