Jump to content

Apple Hud


dalocogamer
 Share

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

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

Recommended Posts

I am going at this again to get some closer. 

 

I'm making my first hud. Function I'm achieving is simple. It is a gathering hud of apples. On the hud side I want to be able to update my variable basket each time I pick up a apple. When I pick up a apple I am simply touching the object on the ground named apple. 

PROBLEM

I am not able to update the hud when I gather one apple from the ground. 

 

Any suggestions would be welcomed and tried. 

Link to comment
Share on other sites

I think I would have the hud listen on a channel generated from the wearer's uuid, using something like this handy Key2Number function from the wiki:

 

integer Key2Number(key objKey) {  return ((integer)("0x"+llGetSubString((string)objKey,-8,-1)) & 0x3FFFFFFF) ^ 0x3FFFFFFF;}

 I would then have my apples, on being touched, generate a channel for llDetectedKey(0) using the same function, then have it say "touched" or whatever to the toucher, using llRegionSayTo(), so the hud can hear it.  

On receiving the message, the hud increments the count of picked apples by one.

You might want to add an offset, I guess, to the Key2Number channel, in case any other objects are using this handy method of generating a predicable but almost unique channel,

 

 

Link to comment
Share on other sites

I'm thinking that for the purposes of this exercise, the sensible approach is with a script in each apple, but there are also more scripting-intensive approaches that wouldn't require a script in each apple, nor that the apples be removed. The mechanism would be a combination of llCastRay() and either camera tracking (which is more my approach) or a full-screen HUD (a la Nexii Malthus). Or, I suppose, mouselook, but that's pretty user-hostile.

Link to comment
Share on other sites

I am a novice scripter. The method of having a script in each apple listen when click seems to be logical chocie for me. I have not thought about doing a listen yet and would be a good way to learn the functions of it.  

 

This HUD for picking up apples is just for one kind of apple. This is developed to learn about making a hud. I will offer this as a open source when I achieve its goal.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4159 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...