dalocogamer Posted December 18, 2012 Share Posted December 18, 2012 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. PROBLEMI 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 More sharing options...
Rolig Loon Posted December 18, 2012 Share Posted December 18, 2012 So you need a script in the apple that identifies itself when clicked and sends a message to your HUD. Every time your HUD hears the message, it adds +1 to its counter. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted December 18, 2012 Share Posted December 18, 2012 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 More sharing options...
Ela Talaj Posted December 18, 2012 Share Posted December 18, 2012 There are ways to do it without a script in each apple, but then the apples must be physically removed from the ground, that is either put in a basket carried by the agent or de-rezzed or taken into inventory. Link to comment Share on other sites More sharing options...
Innula Zenovka Posted December 18, 2012 Share Posted December 18, 2012 Would I be correct in thinking that method depends on there only being one person picking the apples (and on there being no more than 16 apples to start with)? Link to comment Share on other sites More sharing options...
Qie Niangao Posted December 18, 2012 Share Posted December 18, 2012 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 More sharing options...
Rolig Loon Posted December 18, 2012 Share Posted December 18, 2012 There are all sorts of clever ways to do this. If you're a novice scripter, though, it's still easiest to put a simple script in each apple that responds to touch, pings the HUD, and dies. Link to comment Share on other sites More sharing options...
dalocogamer Posted December 18, 2012 Author Share Posted December 18, 2012 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 More sharing options...
Ela Talaj Posted December 18, 2012 Share Posted December 18, 2012 Yeah. Most prolly one person at a time until picks all or quits. As the scanner would be in the HUD and the wearing avatar moves around seeking apples the 16 limitation would not apply in most cases. Link to comment Share on other sites More sharing options...
Recommended Posts
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