Jump to content
  • 0

Scripting a basic clothing HUD and need help.


You are about to reply to a thread that has been inactive for 84 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 post
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 post
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 post
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 post
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 post
Share on other sites
  • 0

Thank you all for your help. I was able to get it working finally. Was also having problems with who the script should listen too.

So funny thing happened, I thought I was in the scripting forum. Woops.

Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 84 days.

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...