Jump to content
  • 0

Scripting a basic clothing HUD and need help.


bodbuiler65
 Share

You are about to reply to a thread that has been inactive for 1187 days.

Please take a moment to consider if this thread is worth bumping.

Question

I'm trying to make a very basic clothing HUD the operates very similarly to an omega applier. A single button that will send texture map, normal map, specular map, and glossiness. I'm using llRegionSayto() to send the UUIDs from the HUD over to the clothing. I'm using llSetLinkPrimitiveParamsFast to set the maps to the clothing. the only problem I'm having right now is being able to set a value for glossiness in the HUD script that will then send over too the clothing script. Any help is greatly appreciated.

 

Reciever Script

Screenshot 2021-01-16 224509.png

HUD Script

Screenshot 2021-01-16 224544.png

Edited by bodbuiler65
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 1

Consider to send multiple values in a single message. 

Example:

Sender:
llRegionSayTo(llGetOwner(),-50100,llDumpList2String([8b5fec65-8d8d-9dc5-cda8-8fdf2716e361,8b5fec65-8d8d-9dc5-cda8-8fdf2716e361,8b5fec65-8d8d-9dc5-cda8-8fdf2716e361,51],"|"));
send everything in one string - values separated by "|"

Receiver:
// split up the string
list p = llParseString2List(msg,["|"],[]);
string tex1 = llList2String(p,0);
string tex2 = llList2String(p,1);
string tex3 = llList2String(p,2);
integer gloss = llList2Integer(p,3);
// execute
llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN,[PRIM_TEXTURE,ALL_SIDES,tex1,<1,1,0>,<0,0,0>,0.0,PRIM_NORMAL,ALL_SIDES,tex2,<1,1,0>,<0,0,0>,0.0,PRIM_SPECULAR,ALL_SIDES,tex3,<1,1,0>,<0,0,0>,0.0,<0.5,0.5,0.5>,gloss,0]);

 

Link to comment
Share on other sites

  • 1

Only a couple of problems, actually.  Your variable singlet appears in the sending script but is undefined in the receiving one. In the receiving script, it is msg.  The block of code that starts with list p = and ends with integer gloss = is not in any event at all.  You probably meant it to be in the listen event. Your use of llParseString2List and llDumpList2String are fine.

A conversation like this really belongs in the Scripting forum, BTW.  😉

Edited by Rolig Loon
Link to comment
Share on other sites

  • 0
9 hours ago, Nova Convair said:

Consider to send multiple values in a single message. 

Example:

Sender:
llRegionSayTo(llGetOwner(),-50100,llDumpList2String([8b5fec65-8d8d-9dc5-cda8-8fdf2716e361,8b5fec65-8d8d-9dc5-cda8-8fdf2716e361,8b5fec65-8d8d-9dc5-cda8-8fdf2716e361,51],"|"));
send everything in one string - values separated by "|"

Receiver:
// split up the string
list p = llParseString2List(msg,["|"],[]);
string tex1 = llList2String(p,0);
string tex2 = llList2String(p,1);
string tex3 = llList2String(p,2);
integer gloss = llList2Integer(p,3);
// execute
llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN,[PRIM_TEXTURE,ALL_SIDES,tex1,<1,1,0>,<0,0,0>,0.0,PRIM_NORMAL,ALL_SIDES,tex2,<1,1,0>,<0,0,0>,0.0,PRIM_SPECULAR,ALL_SIDES,tex3,<1,1,0>,<0,0,0>,0.0,<0.5,0.5,0.5>,gloss,0]);

 

I tried what you said and I get syntax errors in the reciever. I'm still reletively new to lsl so bare with me here. I'm not familiar with llDumpList2String or llParseString2List. There is a good chance that I am using them wrong.

sender.png

reciever.png

Edited by bodbuiler65
adding screenshots
Link to comment
Share on other sites

  • 0

Turns out into something that belongs in the scripting forum. Script stuff is always more than just a question. 😁

All code in a lsl script is in events, maybe take a class if you are interested in scripting, makes the start easier.

llListen (integer chan, string what, key who, string msg) {

	if (llGetOwnerKey(who) != llGetOwner()) return;

	list p = llParseString2List(msg,["|"],[]);
	string tex1 = llList2String(p,0);
	string tex2 = llList2String(p,1);
	string tex3 = llList2String(p,2);
	integer gloss = llList2Integer(p,3);
	llSetLinkPrimitiveParamsFast(LINK_ALL_CHILDREN,[PRIM_TEXTURE,ALL_SIDES,tex1,<1,1,0>,<0,0,0>,0.0,PRIM_NORMAL,ALL_SIDES,tex2,<1,1,0>,<0,0,0>,0.0,PRIM_SPECULAR,ALL_SIDES,tex3,<1,1,0>,<0,0,0>,0.0,<0.5,0.5,0.5>,gloss,0]);
	
}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1187 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...