While making 'a piece of saltwater taffy' I had the idea of using a single random colour code for 'taffy' to help describe the many colors that all tasted the same.
When I checked, I didn't see any functions to do this. Used sparingly this can be fun, used too much it's an eyesore - but I could say the same of colour codes in general.
Can anyone else think of fun ways to use a random colour code?
Random Colour code
Random Colour code
Cattle die
kinsmen die
all men are mortal.
Words of praise
will never perish
nor a noble name.
- Hávamál
kinsmen die
all men are mortal.
Words of praise
will never perish
nor a noble name.
- Hávamál
Re: Random Colour code
Are You looking at using a rand_prog or just General ideas?
Weit in der Champagne im Mittsommergrün,
dort, wo zwischen Grabkreuzen Mohnblumen blühn,
da flüstern die Gräser und wiegen sich leicht
im Wind, der sanft über das Gräberfeld streicht.
dort, wo zwischen Grabkreuzen Mohnblumen blühn,
da flüstern die Gräser und wiegen sich leicht
im Wind, der sanft über das Gräberfeld streicht.
Re: Random Colour code
There are several candy objects in the game which are styled as bags of candy, and a PC can use a command (e.g. get taffy bag) to produce a finite number of edible pieces (the total count can be governed, if desired, by value5). In this case, one could include an if rand check in the intercept program to vary colors.
Alternatively, you could junk the bag on the last candy by adding a little check at the end.
Code: Select all
>intercept_prog get~
if stringprefix($2) == bag
if stringprefix($1) == taffy
if objval5($o) > 1
mpoload 1234
if rand(50)
mposet i1234 short {90}a piece of taffy
else
mposet i1234 short {A0}a piece of taffy
endif
mpgive i1234 $n
mpoadd on $n $o value5 -1
else
mpechoat $n {90}The bag is empty.
endif
else
mpunintercept
endif
else
mpunintercept
endif
~
|
Code: Select all
if objval5($o) == 1
mpechoat $n You finish a bag of candy.
mpechoaround $n @N finishes a bag of candy.
mpjunk $o
endif
"A man may die yet still endure if his work enters the greater work, for time is carried upon a current of forgotten deeds, and events of great moment are but the culmination of a single carefully placed thought." - Chime of Eons
Re: Random Colour code
I really like the way you think, Harroghty. Thank you very much for the assist.
Well Larathiel, I was just thinking I could use a regular ansi colour code that would randomly return a color, that the average end user could also potentially use - and I don't know if that -is- the best idea given how gaudy those random colors can look in many cases. Either way, this will suit me just fine, I planned on having players pull a piece from a box with an intercept to cut down on unnecessary nesting.
Well Larathiel, I was just thinking I could use a regular ansi colour code that would randomly return a color, that the average end user could also potentially use - and I don't know if that -is- the best idea given how gaudy those random colors can look in many cases. Either way, this will suit me just fine, I planned on having players pull a piece from a box with an intercept to cut down on unnecessary nesting.
Cattle die
kinsmen die
all men are mortal.
Words of praise
will never perish
nor a noble name.
- Hávamál
kinsmen die
all men are mortal.
Words of praise
will never perish
nor a noble name.
- Hávamál
Re: Random Colour code
I am not a programmer. I try to avoid programming at all costs; however, if you are worried about gawdy colors in your randomized programming... could you not just run the randomizer, assigned the result to a value.
If value < 20 ... then color is super cool looking blue color
If 21 < value < 40 ... then color is super cool looking red color
... and so on.
Again, I might be barking up the wrong tree or might be creating needless routines just so someone can randomly pull a butterscotch flavored candy one time and then a cinnamon flavored candy the next.
Do not mind me. I will go back to OCDing on color schemes in my outfits.
If value < 20 ... then color is super cool looking blue color
If 21 < value < 40 ... then color is super cool looking red color
... and so on.
Again, I might be barking up the wrong tree or might be creating needless routines just so someone can randomly pull a butterscotch flavored candy one time and then a cinnamon flavored candy the next.
Do not mind me. I will go back to OCDing on color schemes in my outfits.
Re: Random Colour code
Assuming I read and understand your idea correctly, that is essentially what Harroghty proposed above, just in simpler terms (because coding out even the simplest problems in most any scripting or programming language just has to look waaaayyy more complicated than necessary . The largest difference being that your example stores a random value in a variable and then makes various if-checks on that variable, whereas Harroghty's is pretty much just cutting out the variable middle man (area code cannot make use of variables). But yeah, both would end up with the same effect.Aysa wrote: ... could you not just run the randomizer, assigned the result to a value.
If value < 20 ... then color is super cool looking blue color
If 21 < value < 40 ... then color is super cool looking red color
... and so on.
Nascentes morimur, finisque ab origine pendet.