Jump to content

Trinity Fraktul

Resident
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Trinity Fraktul

  1. Full Region for sale, except you can just have it if you take over the payments and cover the cost of transfer. 295US a month. http://maps.secondlife.com/secondlife/MentalPad/97/109/50 I had my fun, now I'm done :) pretty good traffic, was a featured destination for quite a while. Contact me for any info...
  2. awesome feedback, void! thank you both so much.
  3. What I'm hoping to get from this thread is more of a "best practices" guide so I can start off doing things the right way o.0 In my object oriented brain, I would think that if I had an object which was a gameboard, each of the sections of the scoresheet would have a lot of common properties and functionality, so they would implement the defined functionality of an abstracted "scoresheet item" and customize themselves as need be, like so: (pardon my psuedo oo code) game = new AwesomeGame(); item = new ScoreSheetItem(); item.value = 25; //for 25 points item.text = "the floating text above this says its value"; game.scoresheet.add(item); item2 = new ScoreSheetItem(); item2.value = 50; //for 25 points item.text = "I'm the second item"; game.scoresheet.add(item2); ...each ScoreSheetItem would handle its own events, touch or reset or blastParticles or whatever they need to do. when you wanted the total score of the game, you could iterate through all of the items in the game.scoresheet and total the score. How do you accomplish this with lsl? or do you not even look at it the same way? I built the game, the game is working, but I have to think I didn't do it in the best way. What i did was create 12 scoresheet items, and copy the same script into each of them, made some minimal customization to the variables in the script (the score, display text, texture offset (they're all using on texture)), and then in the root game prim, send and recieve messages for those children to report back with their score when they had been touched. the pattern goes like this: on rez of game, root prim asks all children to report themselves, and listens for their message. all child prims message the root back with their number and what they are - scoresheet item, or other primroot prim keeps a strided list of these in a scoresheet list - [1, 0, FALSE, 2, 0, FALSE ]when the child it touched, it sends a message to the root with its number and current score, which gets replaced with the scored values in the list - [1, 25, TRUE, 2, 50, TRUE]at the end of the game, I run through that list and add up the 2nd entry in the stride of 3 to get the total score. Right off the bat, I see this is the wrong way to go. Theres a ton of repetitive, unnecessary code, and that must have a direct impact on the size of the script. I had a couple ideas about how to optimize this, one being to remove the script from the child prim altogether and have the parent handle all the events, customization, etc. This is the route Id like to go, but what I don't see clearly is how to get a handle on which of the linked items are scoresheet items and not other types of linked items - do I have to know the child objects name in order to do this? ie: iterate though llGetNumberOfPrims(), use llGetLinkName(iterator) to see if its a "scoresheet item" and if so, set the texture to the right offset and etc. This seems like a step in the right direction, but still not streamlined - would either have to depend on the order of the linking to know which scoresheet item is the one to assign as 25 points or 50, or what texture offset to give it, or I would have to name each item something unique and have a check for each name in the iterator. Is it better then to have the root object rez & link its own children? that seems like a larger script, but possibly with more control over it. I haven't thought this one entirely through, but I think I would still have to uniquely name each of the inventory objects to be rezz'd. I should add that the 4th option would be to use 1 prim for the entire scoresheet, and use the vector of the touch to decide what the score would be, but at this point I want to be able to float some text over the score item so that wouldn't work, and creating a texture that large with every possible combination of scores seems like a really big undertaking :) ok, theres my enormous question, I hope my logic at least makes partial sense :-) Thanks in advance for any replies...
×
×
  • Create New...