Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Problem with llSay

Gregory McLeod
Registered User
Join date: 21 Oct 2006
Posts: 278
05-20-2007 08:21
I have a game being built which has
1). Failed because it could not rely on llMessageLinked messages reaching there destination prim script.
2). Failed because of prim overloading.
I now have a third problem which I admit may be my own fault through oversight but baffles me.
There are three linked prims involved.
1> The base is used to communicate with players accept options etc
2> The second to respond to the first's command to setup the board for the number of players and receive responses from rezzed prim playing pieces.
3> The third to receive a command to clear the board ready for the next game.

1:
CODE

// Global Constants
integer CHANNEL1000 = 1000; // dialog channel
integer CHANNEL2000 = 2000; // command channel
integer CHANNEL3 = 43; // global reset channel
list MENU_MAIN = ["Info", "Play", "Reset"]; // the main menu
list MENU_OPTIONS = ["5", "6", "...Back", "2", "3", "4"]; // a submenu
list MENU_ALT = ["OPTIONS", "IGNORE"]; // alternate menu
list MENU_ALTOPTS = ["RESET", "CANCEL"]; // alternate sub-menu
// Global Variables
integer Play_Type;
string NAME; // name of interrupter
string ID; // id of user
string P0; // name of red player
string P1; // name of yellow player
string P2; // name of green player
string P3; // name of cyan player
string P4; // name of blue player
string P5; // name of magenta player
list PlayerList = []; // list of active players

// Initialise function
Initialise()
{
Play_Type = 0;
NAME = "";
ID = "";
P0 = "";
P1 = "";
P2 = "";
P3 = "";
P4 = "";
P5 = "";
PlayerList = [];
llListen(CHANNEL1000, "", NULL_KEY, "");
llListen(CHANNEL2000, "", NULL_KEY, "");
llListen(CHANNEL3, "", NULL_KEY, "");
llOwnerSay("Initialised"); // replace with llSay(0,"Initialised")
}

// default state
default
{
state_entry()
{
Initialise();
}

on_rez(integer start_param)
{
Initialise();
}

touch_start(integer total_number)
{
// present dialog on click
ID = llDetectedKey(0);
llDialog(ID, "What do you want to do?", MENU_MAIN, CHANNEL1000);
}

listen(integer channel, string name, key id, string message)
{
if (channel == CHANNEL1000)
{
// verify dialog choice
if (llListFindList(MENU_MAIN + MENU_OPTIONS, [message]) != -1)
{
if (message == "Info") // give notecard info
{
llGiveInventory(ID, llGetInventoryName(INVENTORY_NOTECARD, 0));
}else
if (message == "Play") // present submenu on request
{
llDialog(ID, "How many players?", MENU_OPTIONS, CHANNEL1000);
}else
if (message == "Reset") // reset board
{
llSay(2014,"Reset");
}else
if (message == "...Back") // present main menu on request to go back
{
llDialog(ID, "What do you want to do?", MENU_MAIN, CHANNEL1000);
}else
if (message == "2") // Set up board for 2 players
{
llSay(2015,"Setup2");
}else
if (message == "3") // Set up board for 3 players
{
llSay(2016,"Setup3");
}else
if (message == "4") // Set up board for 4 players
{
llSay(2017,"Setup4");
}else
if (message == "5") // Set up board for 5 players
{
llSay(2018,"Setup5");
}else
if (message == "6") // Set up board for 6 players
{
llSay(2019,"Setup6");
}
}
}else
if (channel == CHANNEL2000)
{
if (message == "Memory")
{
llOwnerSay((string)llGetLinkNumber() + " has " + (string)llGetFreeMemory());
}else
if (message == "Where")
{
llOwnerSay("ChinChek Base at: " + (string)llGetPos());
llOwnerSay("GeometricCenter at: " + (string)llGetGeometricCenter());
}
}
}

link_message(integer sender_num, integer num, string str, key id)
{
list ColorSelectors = ["8","9","10","11","12","13"];
if (llListFindList(ColorSelectors,[ (string)sender_num ]) != -1)
{
if (num == 0)
{
llOwnerSay(str + " has selected Red");
P0 = str;
}else
if (num == 1)
{
llOwnerSay(str + " has selected Yellow");
P1 = str;
}else
if (num == 2)
{
llOwnerSay(str + " has selected Green");
P2 = str;
}else
if (num == 3)
{
llOwnerSay(str + " has selected Cyan");
P3 = str;
}else
if (num == 4)
{
llOwnerSay(str + " has selected Blue");
P4 = str;
}else
if (num == 5)
{
llOwnerSay(str + " has selected Magenta");
P5 = str;
}
llOwnerSay(P0 + P1 + P2 + P3 + P4 + P5);
}
else
{
list NextSelectors = ["123","124","125","126"];
if (llListFindList(NextSelectors,[ (string)sender_num ]) != -1)
{
llOwnerSay("Next clicked");
}
}
}

timer()
{
if (Play_Type == 2)
{
if(P0 == "" || P3 == "")
{
llOwnerSay("Waiting for players to select colors.");
}
else
{
llSetTimerEvent(0.0);
PlayerList = [P0,P3];
llOwnerSay("\n" + P0 + " has selected Red \n"
+ P3 + " has selected Cyan.");
// llMessageLinked(140,0,llList2CSV(PlayerList),NULL_KEY);
state Play;
}
}else
if (Play_Type == 3)
{
if(P0 == "" || P2 == "" || P4 == "")
{
llOwnerSay("Waiting for players to select colors.");
}
else
{
llSetTimerEvent(0.0);
llOwnerSay("\n" + P0 + " has selected Red \n"
+ P2 + " has selected Green \n"
+ P4 + " has selected Blue.");
// llMessageLinked(141,0,P0 + P2 + P4,NULL_KEY);
}
}else
if (Play_Type == 4)
{
if(P0 == "" || P1 == "" || P3 == "" || P4 == "")
{
llOwnerSay("Waiting for players to select colors.");
}
else
{
llSetTimerEvent(0.0);
// llMessageLinked(142,0,P0 + P1 + P3 + P4,NULL_KEY);
}
}else
if (Play_Type == 5)
{
if(P1 == "" || P2 == "" || P3 == "" || P4 == "" || P5 == "")
{
llOwnerSay("Waiting for players to select colors.");
}
else
{
llSetTimerEvent(0.0);
// llMessageLinked(143,0,P1 + P2 + P3 + P4 + P5,NULL_KEY);
}
}else
if (Play_Type == 6)
{
if(P0 == "" || P1 == "" || P2 == "" || P3 == "" || P4 == "" || P5 == "")
{
llOwnerSay("Waiting for players to select colors.");
}
else
{
llSetTimerEvent(0.0);
// llMessageLinked(146,0,P0 + P1 + P2 + P3 + P4 + P5,NULL_KEY);
}
}
}
}

state Play
{
state_entry()
{
llOwnerSay(" entered Play state.");
llListen(CHANNEL1000, "", NULL_KEY, "");
llListen(CHANNEL2000, "", NULL_KEY, "");
llListen(CHANNEL3, "", NULL_KEY, "");
}

touch_start(integer avid)
{
llOwnerSay("touched in Play state");
ID = llDetectedKey(0);
NAME = llDetectedName(0);
// present dialog on click
llDialog(ID, "\nPROCEEDING WILL INTERRUPT THE CURRENT GAME!\nPlayers will be told of your choice!", MENU_ALT, CHANNEL2000);

}

listen(integer channel, string name, key id, string message)
{
if (channel == CHANNEL1000)
{
llOwnerSay("Wrong channel");
}else
if (channel == CHANNEL2000)
{
if (message == "Test")
{
llOwnerSay("channel message received in Play state");
llOwnerSay("reverting to default state");
state default;
}else
if (llListFindList(MENU_ALT + MENU_ALTOPTS, [message]) != -1)
{
if (message == "OPTIONS")
{
llDialog(ID, "Action?", MENU_ALTOPTS, CHANNEL2000);
}else
if (message == "CANCEL")
{
llDialog(ID, "What do you want to do?", MENU_ALT, CHANNEL2000);
}else
if (message == "RESET")
{
llOwnerSay(NAME + " has insisted on terminating this game.");
llMessageLinked(133,0,"Reset",NULL_KEY);
state default;
}
}
}else
if (channel == CHANNEL3 && message == "Reset")
{
state default;
}
}

link_message(integer sender_num, integer num, string str, key id)
{
llOwnerSay("message received from " + (string)sender_num);
llOwnerSay("num " + (string)num + " string " + str);
}
}


2a:
CODE

integer CHANNEL2015 = 2015;
integer No;
vector Pos;
vector YelBaseOffset = <-0.430,0.577,0.24>;

Setup(integer n)
{
Pos = llGetPos();
if (n == 2 || n ==3 || n == 4 || n == 6)
{
llRezObject("PieceRed",Pos + YelBaseOffset + <1.08,0,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1002);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceRed",Pos + YelBaseOffset + <0.94496,-0.07567,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1003);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceRed",Pos + YelBaseOffset + <0.94496,0.08167,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1004);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceRed",Pos + YelBaseOffset + <0.81,-0.15279,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1005);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceRed",Pos + YelBaseOffset + <0.81,0,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1006);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceRed",Pos + YelBaseOffset + <0.81,0.15527,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1007);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceRed",Pos + YelBaseOffset + <0.67517,-0.23512,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1008);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceRed",Pos + YelBaseOffset + <0.67517,-0.07567,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1009);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceRed",Pos + YelBaseOffset + <0.66995,0.08167,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1010);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceRed",Pos + YelBaseOffset + <0.66995,0.23495,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1011);
llSetScriptState(llGetScriptName(),FALSE);
}
if (n == 4 || n == 5 || n == 6)
{
llRezObject("PieceYel",Pos + YelBaseOffset + <0.53859,-0.92638,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1012);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceYel",Pos + YelBaseOffset + <0.40704,-0.85129,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1013);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceYel",Pos + YelBaseOffset + <0.53859,-0.77672,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1014);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceYel",Pos + YelBaseOffset + <0.26697,-0.77672,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1015);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceYel",Pos + YelBaseOffset + <0.40704,-0.69994,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1016);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceYel",Pos + YelBaseOffset + <0.53859,-0.62337,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1017);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceYel",Pos + YelBaseOffset + <0.13344,-0.69994,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1018);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceYel",Pos + YelBaseOffset + <0.27037,-0.62337,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1019);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceYel",Pos + YelBaseOffset + <0.40704,-0.54776,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1020);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceYel",Pos + YelBaseOffset + <0.53859,-0.46741,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1021);
llSetScriptState(llGetScriptName(),FALSE);
}
if (n == 3 || n == 5 || n == 6)
{
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.5463,-0.92638,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1022);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.54613,-0.77672,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1023);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.40681,-0.85129,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1024);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.54593,-0.62337,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1025);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.40781,-0.69994,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1026);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.26724,-0.77672,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1027);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.54469,-0.46741,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1028);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.40646,-0.54776,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1029);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.26712,-0.62337,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1030);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceGrn",Pos + YelBaseOffset + <-0.13719,-0.69994,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1031);
llSetScriptState(llGetScriptName(),FALSE);
}
if (n == 2 || n == 4 || n == 5 || n == 6)
{
llRezObject("PieceCyn",Pos + YelBaseOffset + <-1.08,0,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1032);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceCyn",Pos + YelBaseOffset + <-0.94516,0.08167,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1033);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceCyn",Pos + YelBaseOffset + <-0.94643,-0.07567,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1034);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceCyn",Pos + YelBaseOffset + <-0.81229,0.16368,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1035);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceCyn",Pos + YelBaseOffset + <-0.81,0,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1036);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceCyn",Pos + YelBaseOffset + <-0.81279,-0.15279,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1037);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceCyn",Pos + YelBaseOffset + <-0.67229,0.23772,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1038);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceCyn",Pos + YelBaseOffset + <-0.67519,0.08167,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1039);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceCyn",Pos + YelBaseOffset + <-0.68236,-0.07567,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1040);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceCyn",Pos + YelBaseOffset + <-0.67131,-0.23512,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1041);
llSetScriptState(llGetScriptName(),FALSE);
}
if (n == 3 || n == 4 || n == 5 || n == 6)
{
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.53893,0.92934,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1042);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.41096,0.85445,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1043);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.5489,0.78195,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1044);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.27362,0.78195,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1045);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.40976,0.70589,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1046);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.54465,0.62448,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1047);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.13744,0.70589,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1048);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.26764,0.62448,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1049);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.4057,0.54749,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1050);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceBlu",Pos + YelBaseOffset + <-0.5100021,0.46812,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1051);
llSetScriptState(llGetScriptName(),FALSE);
}
if (n == 5 || n == 6)
{
llRezObject("PieceMag",Pos + YelBaseOffset + <0.53999,0.92934,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1052);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceMag",Pos + YelBaseOffset + <0.53999,0.78195,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1053);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceMag",Pos + YelBaseOffset + <0.40727,0.85445,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1054);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceMag",Pos + YelBaseOffset + <0.53999,0.62448,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1055);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceMag",Pos + YelBaseOffset + <0.40727,0.70589,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1056);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceMag",Pos + YelBaseOffset + <0.26987,0.78195,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1057);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceMag",Pos + YelBaseOffset + <0.53999,0.46812,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1058);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceMag",Pos + YelBaseOffset + <0.40727,0.54749,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1059);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceMag",Pos + YelBaseOffset + <0.26822,0.62448,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1060);
llSetScriptState(llGetScriptName(),FALSE);
llRezObject("PieceMag",Pos + YelBaseOffset + <0.13013,0.70589,0.1>,
ZERO_VECTOR,ZERO_ROTATION,1061);
llSetScriptState(llGetScriptName(),FALSE);
}
}

Initialise()
{
llListen(CHANNEL2015, "", NULL_KEY, "");
}
default
{
state_entry()
{
Initialise();
}

on_rez(integer start_param)
{
Initialise();
}

touch_start(integer total_number)
{
llOwnerSay("Touched");
}

listen(integer channel, string name, key id, string message)
{
if(channel == 2015)
{
if(message == "Setup2") No = 2;
else
if(message == "Setup3") No = 3;
else
if(message == "Setup4") No = 4;
else
if(message == "Setup5") No = 5;
else
if(message == "Setup6") No = 6;
}
Setup(No);
if(channel == 2015 && message == "Where")
{
llOwnerSay("at: " + (string)llGetPos());
llOwnerSay("GeoCntr: " + (string)llGetGeometricCenter());
llOwnerSay("RootPos: " + (string)llGetRootPosition());
}
}
}


2b:
CODE

integer channel;
list PObjs;
default
{
state_entry()
{
PObjs = [];
llListen(channel, "", NULL_KEY, "");
}

object_rez(key id)
{
// llOwnerSay("Script received object rez event interrupt");
// llOwnerSay("Object being altered");
// llOwnerSay((string)[1,2,3] + ",0," + "Params");
llSleep(0.1);
// llOwnerSay("Script being restarted");
llSetScriptState("ObjRez",TRUE);
}

listen(integer channel, string name, key id, string message)
{
llOwnerSay("Channel: " + (string)channel + " Name: " + name + " Key: " + (string)id + " ....");
llOwnerSay(".... Message: " + message);
}
}


3:
CODE
integer CHANNEL2014 = 2014;
vector Pos;
Initialise()
{
llListen(CHANNEL2014, "", NULL_KEY, "");
}
default
{
state_entry()
{
Initialise();
llOwnerSay("Hello,Avatar!");
}

on_rez(integer start_param)
{
Initialise();
llOwnerSay("rezzed");
}

touch_start(integer total_number)
{
llOwnerSay("Touched");
}

listen(integer channel, string name, key id, string message)
{
if(channel == 2014 && message == "Reset")
{
integer i;
for (i = 1002; i<= 1122; ++i)
{
llSay(i,"Die");
}
}
}
}

The object being rezzed contains this code
CODE
integer strt_parm;
integer Flashing;
default
{
state_entry()
{
llOwnerSay("Hello");
}

on_rez(integer start_param)
{
strt_parm = start_param;
// llOwnerSay("start_param: " + (string)start_param);
llListen(strt_parm,"",llGetOwner(),"");
}

listen(integer channel, string name, key id, string message)
{
if (channel == strt_parm && message == "Die")
{
llOwnerSay("Die Command received. Die in 5 seconds.");
llSleep(5.0);
llDie();
}else
if (channel == strt_parm && message == "Who")
{
llOwnerSay("I am: " + (string)llGetKey());
}else
if (channel == strt_parm && message == "FlashON")
{
llOwnerSay("Flashing started.");
llSetTimerEvent(0.5);
}else
if (channel == strt_parm && message == "FlashOF")
{
llOwnerSay("Flashing stopped.");
llSetTimerEvent(0.0);
llSetAlpha(1.0,ALL_SIDES);
}else
if (channel == strt_parm && message == "Dimmed")
{
llOwnerSay("Dimmed started.");
llSetTimerEvent(0.0);
llSetAlpha(0.5,ALL_SIDES);
}else
if (channel == strt_parm && message == "Colored")
{
llOwnerSay("Colored started.");
llSetTimerEvent(0.0);
llSetAlpha(1.0,ALL_SIDES);
}
}

timer()
{
if (Flashing == 0)
{
llSetAlpha(0.0,ALL_SIDES);
Flashing = 1;
}else
{
llSetAlpha(1.0,ALL_SIDES);
Flashing = 0;
}

}
}


Now the problem is that while the llSay communicates correctly between the base and the setup and the rezzed pieces appear correctly when I try to use the Reset function from the third prim it appears to issue the commands 1002Die etc but they dont get received. Issuing the command from the av chat bar is acted upon.

WHY?

NB I will of course be changing the chat channels to negative numbers eventually.
Sorry for the length of the post but I feel it is necessary to illustrate the problem.
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
05-20-2007 08:33
From: Gregory McLeod
I have a game being built which has
1). Failed because it could not rely on llMessageLinked messages reaching there destination prim script.


Hmm. Only because the prims aren't linked, you are sending too many link messages, or the destination prims aren't fully rezzed and running yet.

From: someone
2). Failed because of prim overloading.


Not sure what you mean by this. Are you talking about parcel full conditions, or Rez failure? If it is the former, get a bigger piece of land, or figure a way to use less prims. If it is the latter (looking at your script, you might be running into the grey goo fence), set the pieces out like you want them, then select them all and take them into inventory as a group object (not linked). Then put the group object in your rezzer object and rez the group object, which will rez all the pieces at the same time.

From: someone
I now have a third problem which I admit may be my own fault through oversight but baffles me.
There are three linked prims involved.
1> The base is used to communicate with players accept options etc
2> The second to respond to the first's command to setup the board for the number of players and receive responses from rezzed prim playing pieces.
3> The third to receive a command to clear the board ready for the next game.

Now the problem is that while the llSay communicates correctly between the base and the setup and the rezzed pieces appear correctly when I try to use the Reset function from the third prim it appears to issue the commands 1002Die etc but they dont get received. Issuing the command from the av chat bar is acted upon.

WHY?


Because of this line in the on_rez event in your third script for the pieces:

CODE

llListen(strt_parm,"",llGetOwner(),"");


That means it will listen to the owner, but not anyone or anything else, including any other objects you may or may not own. If you want it to listen to objects, then you will have to use NULL_KEY and then wrap your listen() event code with:

CODE

if (llGetOwnerKey(id) == llGetOwner()) {
}


to make it only listen to you AND objects you own.
Pale Spectre
Registered User
Join date: 2 Sep 2005
Posts: 586
05-20-2007 08:39
From: LSL Wiki
Objects do not 'hear' themselves talk. This helps prevent infinite loops which would probably happen often if objects could hear themselves. For example, if your script returned a message saying 'Unknown command', you could go into an infinite loop easily if you didn't filter out 'Unknown command'. This applies to all of the local chat functions: llWhisper, llSay, and llShout.
...just to rule out the easy one.
Gregory McLeod
Registered User
Join date: 21 Oct 2006
Posts: 278
05-20-2007 10:38
From: Talarus Luan
CODE

llListen(strt_parm,"",llGetOwner(),"");


That means it will listen to the owner, but not anyone or anything else, including any other objects you may or may not own. If you want it to listen to objects, then you will have to use NULL_KEY

I knew it had to be simple that was the problem. The other suggestions I will check out later.

Thanks for that.

I really must concentrate and understand the llListen/listen function/event coding.