Foulcault Mechanique
Father Cheesemonkey
Join date: 28 Mar 2005
Posts: 557
|
08-15-2005 15:46
I am trying to make a code that rezzes on an alt channel an item. The trick is I don't want to be able to rez any objec in the box by using the objects name. If I want a hat type /69 hat or a boat type /69 boat if bigstatueofgodlinden then /69 bigstatueofgodlinden I can rez but so far I have to address each item seperatly I was hoping there was a wildcard way to do it that my limited scripting skill cannot see.
_____________________
Foulcault "Keep telling yourself that and someday you just might believe it." "Every Technomage knows the 14 words that will make someone fall in love with you forever, but she only needed one. "Hello"" Galen from Babylon 5 Crusade From: Jeska Linden I'm moving this over to Off-Topic for further Pez ruminations.
|
Zeno Concord
To infinity, and beyond!
Join date: 28 Mar 2005
Posts: 51
|
08-15-2005 17:38
Your question is not clear, due to the possibility of a misplaced negative. I think you want to select an object from the inventory based on a partial match of what the user types, rather than requiring the full name.
If so, I can think of two possible solutions. You could loop through all the objects in the inventory and compare the name to what the user entered, looking for a partial match. Or maybe you want to allow different names for the same thing, in which case you would have to match against each of those different strings. I would recommend using a notecard to store the list of input patterns paired with the names of objects in the inventory.
|
Foulcault Mechanique
Father Cheesemonkey
Join date: 28 Mar 2005
Posts: 557
|
08-15-2005 17:59
ok in the Item I have the following objects. A B C D Right now the script I am running is listing a seperate code to listen for the triggers for each item. I want to make it so the rez code is written once to rez any item including any that I add later. A dynamic code. Working the way the BDSM collars do for animations. they come with preset animations you can trigger and then add your own. I do want the user to type the full name of the object. That way if there is 'objectA' and 'objectB' there is no confusion.
_____________________
Foulcault "Keep telling yourself that and someday you just might believe it." "Every Technomage knows the 14 words that will make someone fall in love with you forever, but she only needed one. "Hello"" Galen from Babylon 5 Crusade From: Jeska Linden I'm moving this over to Off-Topic for further Pez ruminations.
|
DoteDote Edison
Thinks Too Much
Join date: 6 Jun 2004
Posts: 790
|
08-15-2005 19:44
Your listen receives the chat as string msg... so, within the prvate chat channel listen, do: listen(integer ch, string name, key id, string msg) { if(llGetInventoryKey(llToLower(msg)) != NULL_KEY) { llRezObject(llToLower(msg), ZERO_VECTOR, ZERO_VECTOR, ZERO_ROTATION, 0); } else llSay(0, "The object, " + msg + ", was not found within inventory, try again"); }
Make sure the object names in inventory are all lower-case. That way, a user can enter the name with any case, and it gets converted to lowercase before the inventory check and rez takes place.
|
Foulcault Mechanique
Father Cheesemonkey
Join date: 28 Mar 2005
Posts: 557
|
08-17-2005 14:41
From: DoteDote Edison Your listen receives the chat as string msg... so, within the prvate chat channel listen, do: listen(integer ch, string name, key id, string msg) { if(llGetInventoryKey(llToLower(msg)) != NULL_KEY) { llRezObject(llToLower(msg), ZERO_VECTOR, ZERO_VECTOR, ZERO_ROTATION, 0); } else llSay(0, "The object, " + msg + ", was not found within inventory, try again"); }
Make sure the object names in inventory are all lower-case. That way, a user can enter the name with any case, and it gets converted to lowercase before the inventory check and rez takes place. Thanks for the code. I tried playing with it last night and encountered some errors but I think I got them resolved mostly.
_____________________
Foulcault "Keep telling yourself that and someday you just might believe it." "Every Technomage knows the 14 words that will make someone fall in love with you forever, but she only needed one. "Hello"" Galen from Babylon 5 Crusade From: Jeska Linden I'm moving this over to Off-Topic for further Pez ruminations.
|