chaospearl Posted July 28, 2010 Share Posted July 28, 2010 (edited) Edited for length, clarity, and because I change my mind every twenty minutes. As the title says. I'm just getting into scripting (read: I have no idea what I'm doing). The only programming I've done aside from HTML and CSS -- which don't really count -- was in a proprietary language for a MMORPG company. When I was learning that language I found that I tend to learn best by looking at examples of how something works. So... what I'm looking for is an example of a cell with objects that change randomly depending on circumstances. I'm making an art gallery and I want the paintings to change every week. Let's say that there will always be 10 paintings hanging and they'll always be in the same place on the walls. I'm trying to set it up so that 10 different paintings hang each week; the gallery closes on Sundas and the next day, a new set of paintings is there for the week. I can't think of anything in the game that does something similar so I can look at the scripting. Anyone have suggestions? It doesn't need to be exactly the same; I just need a general idea of what the code looks like and I can modify and polish from there to suit my exact requirements. If I could see a code snippet for something in the game that changes which item appears depending on predefined circumstances, and a snippet for something that's random, anything at all that ISN'T a leveled list... that would be a huge help. Edit: After several hours of poking through the CS Wiki, it seems that the best (only?) way to accomplish this is by putting all the paintings into the cell to begin with, stacked on top of one another, and set to initially disabled. Then enable a different set of paintings with each reset. Now the problem is how to accomplish the resets so that they happen once a week on a particular day, but only once. Edited July 28, 2010 by chaospearl Link to comment Share on other sites More sharing options...
slygothmog Posted July 29, 2010 Share Posted July 29, 2010 Thats a tall order. you would need a variable to controll each painting if haywain == 0 && getdayofweek == 1 ; 1 is mondayHayWainRef.enableset haywain to 1endif if haywain == 1 && getdayofweek == 2 ; 2 is tuesdayHayWainRef.disableset haywain to 2 ( or 0 if you want it back next week )endif you would need to do this for each painting, here's the numeric value for each day for you. sun = 0mon = 1tue = 2wed = 3thur = 4fri = 5sat = 6 hope that helps. Link to comment Share on other sites More sharing options...
chaospearl Posted July 29, 2010 Author Share Posted July 29, 2010 Very helpful, thank you. I didn't realize I could get the script to recognize the day of the week, heh. I looked at the list of global variables (which there are for the day of the month, the year, even the hour, but not the day of the week) but for some reason didn't think to check if there was a function for it. I just assumed there wouldn't be since there was no global. D'oh. Edit: Is there a reason I can't just daisy-chain each set of paintings to a parent ref and then enable\disable the parents instead of doing it individually for each painting? Link to comment Share on other sites More sharing options...
slygothmog Posted July 29, 2010 Share Posted July 29, 2010 To be honest i dont know, It's not something I have ever tried....if you can get it to work like that it will save you allot of script writing. Link to comment Share on other sites More sharing options...
Recommended Posts