Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

comunication trouble

Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-05-2007 15:40
this is myu problem, in theroy it should work, i made a gun that fires a sensor beam it whispers targeted on Mrc Homewood (whoever i aim at) then will say hit Mrc Homewood (whoever is aimed at) that part works fine but then it will say shout ect and the hud that is worn by that avatar should listen on the channel for hit (owners name) in my script i get no errors gun works but hud dosent respond


CODE

===============gun===============
llWhisper(0,"Targeted on " + (string)llDetectedName(0));
target = llDetectedKey(0);
llSay(0, "hit "+(string)llKey2Name(target));

what it says
--------------------------------
Targeted on Mrc Homewood
hit Mrc Homewood

===============HUD===============
listen(integer channel, string name, key id, string message)
{
owner = llGetOwner();
if(message == "hit" + llKey2Name(owner))
{
llSay(0,"You were killed");
}

what it listens for and says
---------------------------------------
hit Mrc Homewood

if it hears that

"You were killed" (dosent respond i ran it threw lsl editor and it found no errors eather)
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
12-05-2007 16:08
From: Mrc Homewood
===============gun===============
llSay(0, "hit "+(string)llKey2Name(target));

===============HUD===============
if(message == "hit" + llKey2Name(owner))
You have a <space> after "hit" in the gun's llSay, but you don't include the <space> in your HUD's listen if-statement.
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-05-2007 16:47
o, that may be why :P

my dumb little errors still haunt me
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
12-05-2007 16:55
Cool! You are using LSLEditor now! Format looks good, script looks good. Still won't help with mistakes like this. But you should find that you will improve much more quickly now.
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-05-2007 17:13
haha, ya that is the basic format of my weapon system, saprisingly i found out a good way of doing it today, but my sniper rifles have to much range i can shoot someone on other side of sim and about 2 seconds later they fall over dead xD the chat dosent get to them fast enought lol
Squirrel Wood
Nuteater. Beware!
Join date: 14 Jun 2006
Posts: 471
12-06-2007 01:02
I would suggest you just go and use the players UUID instead of the name as that requires fewer steps to obtain / process which in the long run increases the processing speed.
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-06-2007 13:14
im back hehe

the script noe seams to work without much troube but i tryed to add 2 difrent damage types, i bomb and name

hit Mrc Homewood (should deal 1 damage

bomb (should deal 50 damage)

but they dont seam to work, i added hovertext to it also and that dosent update past 0%

CODE

integer damage;
default
{
state_entry()
{
llRequestPermissions(llGetOwner(), PERMISSION_TRIGGER_ANIMATION);
llSay(0, "HCS HUD LOADED");
llListen(0,"","","");
llSetText("Damage \n" + (string)(damage * 10) + "% \n \n \n \n \n \n \n \n ",<1,1,1>,1.0);
damage = 0;
}
on_rez(integer start)
{
llResetScript();
}
listen(integer channel, string name, key id, string message)
{
if(message == "hit " + llKey2Name(llGetOwner()))
{
if(damage < 9)
{
damage += 10;
}
}
else if(message == "bomb")
{
if(damage < 9)
{
damage += 5;
}

}
else
{
llSay(0,"Dead");
llStartAnimation("dead");
}
}
run_time_permissions(integer perm)
{
if (perm & PERMISSION_TRIGGER_ANIMATION){
llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
damage = 0;
}
}
}
Mrc Homewood
Mentor of Randomness
Join date: 24 Feb 2007
Posts: 779
12-06-2007 17:29
id hate to spam and all but i kinda havent figured this out yet xD im in a slight rush with geting a beta of my combat system out