Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Combat Meter

Gusher Castaignede
SL Builder
Join date: 8 Oct 2007
Posts: 342
07-08-2008 02:27
Hello all, I am looking for some tutorials on how to create a simple Combat HUD Meter that works with RP Bullets.
_____________________
Vist Us at
http://slurl.com/secondlife/Saddle%20Canyon/94/138/21/
Programmer Wiefel
Registered User
Join date: 8 Mar 2008
Posts: 9
07-08-2008 12:37
haha what a coincidence, I need help with the same thing
Gusher Castaignede
SL Builder
Join date: 8 Oct 2007
Posts: 342
07-08-2008 14:35
From: Programmer Wiefel
haha what a coincidence, I need help with the same thing



I guess its high in demand!
_____________________
Vist Us at
http://slurl.com/secondlife/Saddle%20Canyon/94/138/21/
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
07-08-2008 14:49
Well, there is no such thing as an "RP bullet". They all use their own systems. You might wish to search for DCS2, CCS, and Safezone as a start.
_____________________
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-08-2008 18:21
From: Ordinal Malaprop
Well, there is no such thing as an "RP bullet". They all use their own systems. You might wish to search for DCS2, CCS, and Safezone as a start.

Oh my god its Ordinal Malaprop.. And hes right by the way
Gusher Castaignede
SL Builder
Join date: 8 Oct 2007
Posts: 342
07-08-2008 20:03
From: Ordinal Malaprop
Well, there is no such thing as an "RP bullet". They all use their own systems. You might wish to search for DCS2, CCS, and Safezone as a start.



RP Bullet is what I see on my gun's menu along with Push, Phantom, Training, Deadwood, and Damage ........
_____________________
Vist Us at
http://slurl.com/secondlife/Saddle%20Canyon/94/138/21/
Nexii Malthus
[Cubitar]Mothership
Join date: 24 Apr 2006
Posts: 400
07-08-2008 22:10
Well that gun is specific to one of those systems that maybe Ordinal has listed or another one.
_____________________

Geometric Library, for all your 3D maths needs.
https://wiki.secondlife.com/wiki/Geometric

Creator of the Vertical Life Client
Kahiro Watanabe
Registered User
Join date: 28 Sep 2007
Posts: 572
07-09-2008 07:58
Making a combat system is not like making a notecard giver. If you check the actual CS's they are very complex. They don't use just LSL but also PHP/Mysql and from there, who knows what else. So if you want to make a combat system...you will need to invest some research, study an money.
Jenn Yoshikawa
Registered User
Join date: 14 Nov 2007
Posts: 91
Here is one I moded
07-10-2008 01:30
It was for star wars but I moded it a while back. Its open source. I don;t rember who made. If you any one dose please let me know so I can add there name.

key collided;
integer dead = 0;
integer health;
integer stamina;
integer blocking = 0;
string sfcs;
string title;
string owner;
string heal;
vector color;
integer tick;


fullinit()
{
color = <255, 166, 0> / 255;
title = "";
init();
}
init()
{
llMessageLinked(LINK_THIS, 0, "stopregen", NULL_KEY);
tick = 0;
owner = llToLower(llKey2Name(llGetOwner()));
heal = "heal " + llGetSubString(owner, 0, 0);
sfcs = "SMSM " + llGetSubString(llGetObjectName(), 21, -1);
health = 100;
stamina = 100;
llListen(1, "", "", "";);
llListen(532254, "", "", "";);
llListen(-690069, "", "", "";);
llListen(696969, "", "", "";);
updatehealth();
}
OOC()
{
llSetText("SheMale Slums\n OOC", color, 1.0);
}

updatehealth()
{
string stats;
if(health > 100)
{
health = 100;
}
else if(health < 0)
{
health = 0;
}
if(stamina > 100)
{
stamina = 100;
}
else if(stamina < 0)
{
stamina = 0;
}
if(health == 0)
{
die();
}
if(blocking == 0)
{
stats = sfcs + "\n";
}
else
{
stats = "Blocking....\n";
}
if(title != "";)
{
stats += title + "\n";
}
stats += "Health: "+ (string)health + "% / Stamina: " + (string)stamina + "%";
llShout(-696969, "color " + (string)color);
llShout(-696969, (string)health + "," + (string)stamina);
llSetText(stats, color, 1.0);
}

die()
{
if(dead == 0)
{
dead = 1;
llStartAnimation("sleep";);
llSetTimerEvent(0);
llSay(0, llKey2Name(llGetOwner()) + " has been defeated";);
}
}
live()
{
llStopAnimation("sleep";);
dead = 0;
llSetTimerEvent(3);
}
block()
{
llStartAnimation("block";);
}
unblock()
{
llStopAnimation("block";);
}
healstam(integer damage)
{
if(blocking == 1 && damage < 0)
{
stamina += damage;
}
else if(blocking == 0 && damage < 0)
{
health += damage;
}
else if(damage > 0)
{
if(health == 0)
{
live();
}
health += damage;
stamina = 100;
}

updatehealth();
}



default
{
state_entry()
{
updatehealth();
init();
}
run_time_permissions(integer perms)
{
if(perms & PERMISSION_TAKE_CONTROLS)
{
llTakeControls(CONTROL_ML_LBUTTON | CONTROL_LBUTTON | CONTROL_UP | CONTROL_FWD | CONTROL_BACK | CONTROL_ROT_LEFT | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_ROT_RIGHT | CONTROL_DOWN, TRUE, TRUE);
init();
}
if(perms & PERMISSION_TRIGGER_ANIMATION)
{
live();
}
}
attach(key attached)
{
if(attached != NULL_KEY)
{
llRequestPermissions(llGetOwner(),PERMISSION_TAKE_CONTROLS | PERMISSION_TRIGGER_ANIMATION);
}
}
collision_start(integer total)
{
if(llDetectedKey(0) != collided)
{
collided = llDetectedKey(0);
if(llDetectedName(0) == "Fireball";)
{
healstam(-10);
}
else if(llDetectedName(0) == "Pull";)
{
}
else if(llDetectedType(0) & ACTIVE && !(llDetectedType(0) & AGENT))
{
healstam(-2);
}
}

}
sensor(integer total)
{
integer i;
for(i = 0; i < total; i++)
{
llShout(-690069, llDetectedKey(i));
}
}
timer()
{
if(health < 100 || stamina < 100)
{
if(tick == 1)
{
health += 1;
tick = 0;
}
else if(tick == 0)
{
tick = 1;
}
if(blocking == 0)
{
stamina += 1;
}
updatehealth();
}
}
control(key id,integer held,integer change)
{
if(held & CONTROL_LBUTTON || held & CONTROL_ML_LBUTTON)
{
blocking = 0;
if((change & held & CONTROL_ROT_LEFT) | (change & ~held & CONTROL_LEFT))
{
llSensor("", "", AGENT, 4, PI_BY_TWO);
}
if((change & held & CONTROL_ROT_RIGHT) | (change & ~held & CONTROL_RIGHT))
{
llSensor("", "", AGENT, 4, PI_BY_TWO);
}
if(change & held & CONTROL_FWD)
{
llSensor("", "", AGENT, 4, PI_BY_TWO);
}
if(change & held & CONTROL_BACK)
{
llSensor("", "", AGENT, 4, PI_BY_TWO);
}

}
else if(~held & CONTROL_LBUTTON || ~held & CONTROL_ML_LBUTTON)
{
if((held & CONTROL_BACK) && (held & CONTROL_FWD))
{
if(stamina > 0)
{
blocking = 1;
block();
}
else
{
if(blocking == 1)
{
unblock();
}
blocking = 0;
}
updatehealth();
}
// else if((change & ~held & CONTROL_BACK) && (change & ~held & CONTROL_FWD))
else
{
if(blocking == 1)
{
unblock();
}
blocking = 0;
updatehealth();
}
}
}
link_message(integer sender, integer num, string msg, key id)
{
if(msg == "regen";)
{
if(health < 100 && stamina > 0 && health > 0)
{
stamina -= 2;
health += 2;
}
if(health >= 100 || stamina == 0 || health == 0)
{
llMessageLinked(LINK_THIS, 0, "stopregen", NULL_KEY);
}

updatehealth();
}
else if(msg == "ooc";)
{
state otherway;
}
}
listen(integer chan, string name, key id, string msg)
{
string mesg;
mesg = llToLower(msg);
if(chan == 1)
{
if(llGetOwnerKey(id) == llGetOwner())
{
if(mesg == "reset";)
{
live();
init();
}
else if(mesg == "fullreset";)
{
live();
fullinit();
}
else if(mesg == "regen";)
{
llMessageLinked(LINK_THIS, 0, "startregen", NULL_KEY);
}
else if(mesg == "stopregen";)
{
llMessageLinked(LINK_THIS, 0, "stopregen", NULL_KEY);
}
else if(mesg == "help";)
{
llGiveInventory(llGetOwner(), "SFCS Help";);
}
else if(llGetSubString(mesg, 0, 5) == "color ";)
{
color = (vector)llGetSubString(msg, 6, -1);
color /= 255;
updatehealth();
}
else if(llGetSubString(mesg, 0, 5) == "title ";)
{
title = llGetSubString(msg, 6, -1);
if(llToLower(title) == "none";)
{
title = "";
}
updatehealth();
}
}

if(llGetSubString(mesg, 0, 5) == heal)
{
if(health < 100)
{
healstam(10);
}
updatehealth();
}
}
else if(chan == 532254 && llGetSubString(name, 0, 4) == "Force";)
{
if(msg == (string)llGetOwner())
{
healstam(-2);
}
else if(msg == (string)llGetOwner() + "+";)
{
healstam(5);
}
}
else if(chan == 696969)
{
if(msg == (string)llGetOwner())
{
healstam(-5);
}
else if(msg == (string)llGetOwner() + "+";)
{
healstam(5);
}
else if(llGetSubString(msg, 0, 35) == (string)llGetOwner())
{
healstam((integer)llGetSubString(msg, 36, -1));
}
}
else if(chan == -690069)
{
if(msg == (string)llGetOwner())
{
healstam(-2);
}
else if(msg == "updatehp" && llGetOwnerKey(id) == llGetOwner())
{
updatehealth();
}
}
}

}

state otherway
{
state_entry()
{
llSetText("SheMale Slums\nOOC", color, 1);
}
link_message(integer sender, integer num, string msg, key id)
{
if(msg == "roleplay";)
state default;
}

}