turf
name = ""
New()
..()
spawn(13)
src.icon = turn(src.icon, pick(0,90,180,270))
Problem description:
Is this too much for BYOND to handle on New()? It makes my turfs look much better although now I cant even Run after compile.
ID:139673
![]() Oct 2 2010, 9:56 pm
|
|
Code:
turf Problem description: Is this too much for BYOND to handle on New()? It makes my turfs look much better although now I cant even Run after compile. |
Slic3y wrote:
Ok, how would I go about caching my icons? Here's your original code: turf Problem: You are generating a new icon for every turf, instead of using a pre-existing one or saving the result to a variable and reusing it. Your solution could be to pre-generate three extra icons for each unique turf type---one for each step in your rotation---but come on man, all you're doing is making 90-degree turns. Just go into your icon files and make them into directional icons. Give them a NORTH/SOUTH/EAST/WEST icon and in turf/New(), just change src.dir. Alternatively, you could just do this whole randomizing process once and save the result, map the whole thing accordingly (perhaps via automation), and save yourself all of the calculations from then on. |
Rather than messing with turn and everything... Why don't you just have 4 icon states for each dir, and then use a pick Like this
turf/Grass/New(){icon_state = pick("North","South","East","West")} That way, it's a new experience every time ya play! :D I tested it out, and it works really nicely. |
Ohhh! So could you just replace icon with dir? Like
turf/Grass/New(){dir = pick(NORTH,SOUTH,EAST,WEST)} |
You need to cache those icons so only one of each is generated.