User talk:Aichon
Announcement: I'm no longer active. My talk page is still your best bet to get in touch. —Aichon— 04:39, 15 December 2018 (UTC)
- New conversations should be started at the bottom using a level two header (e.g.
==Header==
). - I like to keep conversations wherever they start, but if a conversation ends up here, I will keep it here.
- I will format comments for stylistic reasons, delete comments for whatever reason, and generally do anything else within reason.
NecroTechnicolor
I was needing a leader for my self-group. I wondered if I might be able to talk you into it? You don't have to do anything or be in the group, actually you probably wouldn't meet the qualification of being my alt anyways. So, any chance of making this happen? I'll add a disclaimer that you have nothing to do with the group and aren't responsible for the actions, etc. -- Org XIII Alts 23:33, 15 June 2012 (BST)
- So, it's like an honorary leader position? Or is it more of just being a leader without being a group member? —Aichon— 00:29, 16 June 2012 (BST)
- Honorary. Unless you just really want to boss me around. :P -- Org XIII Alts 02:10, 16 June 2012 (BST)
- I somehow imagine there will be handcuffs, leather, and a whip involved in this... <_< --•▬ ▬••▬ • •••• •▬ ▬•▬• ▬•▬ #nerftemplatedsigs 02:40, 16 June 2012 (BST)
- So long as there's no zerging, I'm down for it. ;) —Aichon— 04:21, 16 June 2012 (BST)
- Honorary. Unless you just really want to boss me around. :P -- Org XIII Alts 02:10, 16 June 2012 (BST)
whyy
Can you summarise in 25 words or less why new Mozilla no longer recognises moz-border codes? Changed to... webkit (I think it is)? DANCEDANCEREVOLUTION (TALK | CONTRIBS) 16:00, 26 June 2012 (BST)
- Yes, I can summarize it in 25 words or less. —Aichon— 16:13, 26 June 2012 (BST)
- Anyway, I assume you're talking about moz-border-radius and the like. The reason why is that all of the prefix CSS properties (i.e. the ones starting with moz, webkit, or the like) are meant to eventually be replaced by a CSS standard equivalent, rather than staying proprietary forever. The border-radius property has been a standard for a long time, so moz-border-radius support was finally phased out in Firefox 13. Assuming you were using {{xbrowsercss}} all along, this wouldn't be an issue for you, since that was designed specifically for the day that this situation arose. That's also why whenever you are using a CSS property with a prefix, you should also try to find the equivalent standard property and use it as well. —Aichon— 16:21, 26 June 2012 (BST)
- It's simpler than that actually. Coder's are lazy and developers intentionally forgot what the prefixes were originally for. This, however, is a really good read on the subject. I may add more links in the future. --Karekmaps 2.0?! 06:37, 27 June 2012 (BST)
thanks for the help
Hi there Aichon - thanks for the help with the Locator. I was away for a couple of days, and couldn't remember my passwords, since most of them are automatically stored in Firefox. :) --FLZombie 00:42, 27 June 2012 (BST)
- No prob. I was doing some scouting for BLF anyway and figured I'd update it so INQ had the info too, and I figured you probably wouldn't mind, given our talks in the past. ;) —Aichon— 01:11, 27 June 2012 (BST)
Function Calls
This is just my asking your opinion, but do you think (performance wise) it is better to have the function call before or after the called function? --Klexur 17:14, 27 June 2012 (BST)
- I don't think it should matter, honestly. The entire file needs to be loaded before it will start executing, so it'll know where both are already, and most of the modern browsers are compiling the code anyway (using JIT or other technologies), further reducing any potential differences in runtime. I'd view it more as a question of code readability rather than efficiency. —Aichon— 17:17, 27 June 2012 (BST)
Wiki design
You, sir, have mad wiki skills. I peaked at your wiki code for some design ideas, and searched around on your talk page to see if this had been previously addressed. I just wanted to officially thank you for the help. =] --Klexur 05:51, 2 July 2012 (BST)
- Thanks, and I'm glad you got some use out of it. I've actually forgotten quite a bit of what I once knew, since I took a year off from the game and the wiki, but most of it is slowly coming back to me. Rooster was a real genius, if you ask me, but I have had a time or two where I did something neat. Have you seen my snazzylink and snazzylinke templates yet? You might find them of interest. And I'm definitely looking forward to your design as you continually refine it. I noticed you started personalizing your space in earnest earlier, and you have me curious how all it will eventually turn out, since it looks pretty awesome already. —Aichon— 06:19, 2 July 2012 (BST)
- I'm not sure I understand what your snazzylink is doing... --Klexur 05:14, 4 July 2012 (BST)
- Check my main user page for examples of how I use them. They're basically templates used to format all links according to whatever style I want to maintain. —Aichon— 06:18, 4 July 2012 (BST)
- Oh, also, snazzylink is smart enough to recognize if you're on the page that's linked, and then will skip applying the fancy styles in that case, just like what happens with regular wiki links, rather than applying the style. Click through the archive links at the top of this page for an example of that in action, or go to the SoC's pages and click through them to see something else I did that basically stole the logic from snazzylink (except that one's technically even smarter, since it lets you apply a secondary style if you're on the actual page). —Aichon— 16:11, 11 July 2012 (BST)
- Check my main user page for examples of how I use them. They're basically templates used to format all links according to whatever style I want to maintain. —Aichon— 06:18, 4 July 2012 (BST)
- I'm not sure I understand what your snazzylink is doing... --Klexur 05:14, 4 July 2012 (BST)
Slashfic
I must admit, it's strange the way an individual's online persona evolves. But I won't stand against public opinion. --Rosslessness 11:14, 8 July 2012 (BST)
- It's one thing to not stand in the way. It's another to encourage and invite it. ;) —Aichon— 22:57, 10 July 2012 (BST)
UD Profile Expander
Need confirmation, but Barrista seems to break its ability to create a table within the gt div. --Klexur 12:10, 11 July 2012 (BST)
- That sounds likely, given that Barrista does remove that particular div. I've never used UD Profile Expander, however, so I can't say for sure. As I recall, its functionality relies on functions that are considered insecure in some browsers, thus preventing it from working at all in them.
- If you're thinking of working on UDPE, what are your suggestions or thoughts? Personally, even though it is the lazy way for me, I think it would be best if UDPE didn't rely on the gt div being there, and instead just added a new div of its own underneath the minimap, similar to what something like UDMap does.
- Also, I've been thinking for a few years that it might not be a bad idea to make a library script that would inject functions into the page's head, thus enabling all of the other scripts to access that functionality (pretty sure we can do that...). For instance, rather than having everyone and their mother implement a function to grab the barricade level, just implement it in the library and let anyone else call GetBarricadeLevel or something like that. Barrista was actually designed with the idea that I would be doing this, but I ended up being lazy and just rolling the early functionality for the library into Barrista, rather than breaking it out, which is why Barrista's code is broken into two halves. —Aichon— 15:40, 11 July 2012 (BST)
- I wasn't really planning on messing with it since I won't be using it, I was mostly curious if you were aware of any problems. The idea of making globally accessible functions sounds beneficial to any future scripts, but it makes me wonder how plausible it would be. You and I might get some immediate use out of it since we seem to be the most active developers, but how often are scripts actually made for UD? --Klexur 18:15, 11 July 2012 (BST)
- Not often, but it might make things easier for other people to get started, and it'd also mean less code duplicating the same work, which means better efficiency. We could cache the results after they're retrieved, meaning that we would keep from doing the work over and over again, and since it'd all be done prior to any other scripts, we could fix a load of inter-script issues, such as what happens if one script tries to grab data from an element that gets modified/removed by another. —Aichon— 18:24, 11 July 2012 (BST)
- Sounds complicated and a fair amount of work. =P Although, if you want to actually start this project (after these years of not doing it yet) I wouldn't mind helping. --Klexur 18:38, 11 July 2012 (BST)
- Nah, it shouldn't be much work once we get the basics functional. After that, it's just a matter of putting things we use regularly in there, rather than in our own code. And the caching stuff is simpler than it sounds, since it's basically just one if statement. —Aichon— 18:45, 11 July 2012 (BST)
- I don't use Barrista and Profile Expander is borked for me. Last time that happened, it was changes to the game. Wonder if there was some change recently other than foil hats. Hope you guys can figure it out. Profile Expander is one of my favorite scripts. ~ 19:09, 11 July 2012 (UTC)
- Did it break around the time that safehouses were added? That update affected the code around that part of the page. Also, there was another small game update right around that time that made a few slight modifications to the code and broke some of the scripts. —Aichon— 20:30, 11 July 2012 (BST)
- Yes, that's when it broke. Almost exactly two years ago. See User_talk:Haliphax#UD Profile Expander ~ 20:52, 11 July 2012 (UTC)
- Did it break around the time that safehouses were added? That update affected the code around that part of the page. Also, there was another small game update right around that time that made a few slight modifications to the code and broke some of the scripts. —Aichon— 20:30, 11 July 2012 (BST)
- I don't use Barrista and Profile Expander is borked for me. Last time that happened, it was changes to the game. Wonder if there was some change recently other than foil hats. Hope you guys can figure it out. Profile Expander is one of my favorite scripts. ~ 19:09, 11 July 2012 (UTC)
- Nah, it shouldn't be much work once we get the basics functional. After that, it's just a matter of putting things we use regularly in there, rather than in our own code. And the caching stuff is simpler than it sounds, since it's basically just one if statement. —Aichon— 18:45, 11 July 2012 (BST)
- Sounds complicated and a fair amount of work. =P Although, if you want to actually start this project (after these years of not doing it yet) I wouldn't mind helping. --Klexur 18:38, 11 July 2012 (BST)
- Not often, but it might make things easier for other people to get started, and it'd also mean less code duplicating the same work, which means better efficiency. We could cache the results after they're retrieved, meaning that we would keep from doing the work over and over again, and since it'd all be done prior to any other scripts, we could fix a load of inter-script issues, such as what happens if one script tries to grab data from an element that gets modified/removed by another. —Aichon— 18:24, 11 July 2012 (BST)
- I wasn't really planning on messing with it since I won't be using it, I was mostly curious if you were aware of any problems. The idea of making globally accessible functions sounds beneficial to any future scripts, but it makes me wonder how plausible it would be. You and I might get some immediate use out of it since we seem to be the most active developers, but how often are scripts actually made for UD? --Klexur 18:15, 11 July 2012 (BST)
UDMap
I hope I'm not a bother, but I noticed something. On line 226 or so is wiki.urbandead.com/index/ which needs to be wiki.urbandead.com/index.php/ for the links to work now. --Klexur 06:01, 19 July 2012 (BST)
- Hmm. I guess that redirect broke with the wiki update a few months back, since that used to work, I know. Nice find. Thanks for not only pointing out the issue, but also doing the legwork on the fix for me! :D —Aichon— 06:25, 19 July 2012 (BST)
Feedback
Hi, I hate bothering you (especially after all the help with the map earlier today), but I was wondering if you could give me some feedback on my profile and userpages? I've been messing around with templates, pages, lay-outs, etc for 2 days now and I'm wondering what else is possible? :) -- Johnny Twotoes 02:13, 1 August 2012 (BST)
- Truth be told, I actually suck at giving this sort of advice, since while I know the technical stuff pretty well, design is something that's MUCH harder for me (and I'd put forward that I'm not very good at design either). :P
- The only things coming to mind when I look at it are stylistic things (e.g. how rounded the corners are, how the items are spaced, what colors are used), and those are just a matter of taste, rather than something being necessarily better, and you know your personal style far better than I do, so that's an area I'd rather not tread. I haven't looked at the code yet, but it's always been my stance to get the idea of what it should do and what it should look like figured out first, then focus on how it's done. As far as what's possible...well...pretty much anything, so long as it doesn't involve interaction. Is there something in particular you've seen or have thought of that you'd like to do? You've already demonstrated that you pick things up quickly, so I'd be more than happy to help you out with anything you had in mind or have been considering. —Aichon— 06:11, 1 August 2012 (BST)
- Well, your map (which I shamelessly cannibalized :P ) looks like something that could be expanded upon, but all I really did was change values and link them to my own userpages rather than Klexurs'. Problem is that I only understand about half of what each line says, if you could explain that, I'd be very grateful :) (that's fairly technical, right? ) -- Johnny Twotoes 13:57, 1 August 2012 (BST)
- Sure. So, each line in smallmap looks roughly like this:
- Well, your map (which I shamelessly cannibalized :P ) looks like something that could be expanded upon, but all I really did was change values and link them to my own userpages rather than Klexurs'. Problem is that I only understand about half of what each line says, if you could explain that, I'd be very grateful :) (that's fairly technical, right? ) -- Johnny Twotoes 13:57, 1 August 2012 (BST)
<td style="background-color:{{User:Peralta/{{{00|bg}}}color}};border:1px solid {{User:Peralta/bg2color}};width:10%;height:10%;" title="{{if|{{{00c|}}}|{{{00c}}} is in Dakerstown|Dakerstown}}"></td>
- Basically, the td is creating a new cell in a row of a table (i.e. creating a new square in the grid). If you need help with that, I'd point you to a better resource on HTML tables. I believe you know what the style does, since it just tells the td how we're going to be styling it using CSS. The background-color:{{User:Peralta/{{{00|bg}}}color}} basically sets the background color of the grid square to User:Peralta/Xcolor, where "X" is determined by the {{{00|bg}}} part. That part is a variable (which is why it has the three curly braces around it, rather than two), and we briefly discussed how to use it already, but the gist of it is that if you provide a value for 00, it will use it (e.g. providing it with "border" would result in User:Peralta/bordercolor), while providing it with nothing would cause it to default to "bg" (i.e. User:Peralta/bgcolor). Because you're providing it with bg, you're technically being a bit redundant (i.e. you're providing it with the value it would have defaulted to anyway), but I think it makes the code more readable, so I wouldn't recommend changing it.
- The next major part is border:1px solid {{User:Peralta/bg2color}};. That just tells the grid square to have a border that's 1px wide, solid, and use the specified color. I'm guessing you already knew all of that. ;)
- After that, it's the width and height stuff, which is pretty self-explanatory (basically, the grid squares are each 10% of the overall map's height and width), then it's the title="{{if|{{{00c|}}}|{{{00c}}} is in Dakerstown|Dakerstown}}" part. The title attribute is used to specify what the text should be in the tooltip when a user mouses over it. Inside of it, we can break down that if statement a bit. It's basically saying {{if|1|2|3}}. The way an if-statement works is by checking to see if #1 exists. If it does, then it outputs #2. If it doesn't, then it outputs #3.
- In this case, the #1 says {{{00c|}}}, and, as you can see by its three curly braces, that's another variable. What it does is say that if the user provided a value for variable 00c, use it, and if they didn't, default to nothing at all (that's why it's blank after the |). If they provided something, then #2 will be used, and all #2 does is write "X is in Dakerstown", where X is the text they provided for variable 00c. If they provide nothing for 00c, then the default value of nothing will be used, resulting in #3 getting used, which simply outputs "Dakerstown". The result is that if they fill in those variables, the person looking at the map will get a custom tooltip when they mouse over those squares. I originally designed it that way so that people could see which of my characters were at which locations. The latest version of my map also made it so that those squares became links to my character pages, but that's a whole additional mess of code. ;)
- Anyway, let me know if any of that was confusing. Hopefully that's detailed enough to give you an idea of what each part does, or at the very least might give you enough of an idea that you can piece together all of it from other things you already know. If not though, feel free to ask followup questions. :) —Aichon— 17:00, 1 August 2012 (BST)
- That all makes perfect sense to me :) I'll try and mess around a bit with it and see what I can come up with. I guess the color code at the bottom (which informs people about what color means what) is just an independant piece of the puzzle, easy enough.
- I'm wondering now if I could make the color and text of certain squares depend on, for instance, the status of a building in that suburb (based on the statusreports that can be found on the wiki)? -- Johnny Twotoes 17:50, 1 August 2012 (BST)
- In theory, yes, but you'd be getting into some advanced stuff then, though the code for it actually isn't too bad. For an example of something like that in action you can look at District NW-1#Resource Buildings. The individual squares are color-coded based on the status report for the individual building, with the code doing that on the district page being, for instance, {{User:DangerReport/The Attwell Building|template=TRP Status}}.
- I'm wondering now if I could make the color and text of certain squares depend on, for instance, the status of a building in that suburb (based on the statusreports that can be found on the wiki)? -- Johnny Twotoes 17:50, 1 August 2012 (BST)
- The reason why that works is because every single DangerReport page starts off with a line that says {{{{{template|BuildingStatus}}}. Basically, if you simply include a DangerReport as a template, it will get output using the default template of Template:BuildingStatus, but if you provide a name for the variable named "template", you can tell the DangerReport to send its variables to any other template you want. Those district pages tell it to use Template:TRP Status, for instance.
- What you should be able to do is create your own template in the same vein as BuildingStatus or TRP Status, then tell it to use that one. In your case, your template might be something simple. For instance, you could do an if-statement (or a switch) that checks to see if the status of the building is ruined, and if it is, then simply output a color, similar to what you do with bgcolor and the like, and if it's not ruined, output a different color.
- For a quick example of how you might do it, I've put together this demo based on this template of mine. The third line in particular is applicable for you, since you could use it to output a color, then you could include that page as one of your colors for a particular suburb. And if you were to change the DangerReport for the building that the demo references, you'd see all of the stuff in the demo change to match. —Aichon— 18:23, 1 August 2012 (BST)
- So IF I understand it correctly, this template should return nothing but the correct rgb values in any case?
- EDIT: Ok, so I don't entirely understand how to use the above template to generate a color, as can be seen here. I tried with rgb codes and color names, so far no response. -- Johnny Twotoes 19:07, 1 August 2012 (BST)
- Fixed it for you. You had the idea exactly correct. The only problem you had was that since wiki tables use the | as a special symbol, the | you had right before the template= was confusing it, causing it to think that you were doing something with the table. The simple fix is to use HTML tables instead of wiki tables since they don't treat the | as a special symbol, even though it involves some extra code. There might be other ways around it by using Template:!, but those get unreadable in a big hurry. —Aichon— 20:03, 1 August 2012 (BST)
- I suspected as much and I'll try and stay in HTML code as much as possible from now on :) -- Johnny Twotoes 20:25, 1 August 2012 (BST)
- Update: I'm looking for the best way to apply this shamelessly raped template on a city scale map. Apart from having to edit at least 10.000 lines of code (I can be patient), what would be the best approach? Create one line of 100 working cells and copy paste the code afterwards for the other 99 lines? -- Johnny Twotoes 21:13, 1 August 2012 (BST)
- If I had to take a guess, I don't think that's possible. The problem is that wiki pages have a limit on how much template code can be included on any particular page. Including 10,000 template calls, even if they were very tiny, is extremely likely to overwhelm the wiki and result in the page "breaking". Pages that break like that will display something like "{{User:Peralta/Template1}}" instead of the template's output. You can check how close you are to reaching the "include limit" for a page by viewing the source code for the page and then searching for the word "byte". You should find a few lines in the code that specify how much has already been included and what the wiki has set as the maximum.
- Update: I'm looking for the best way to apply this shamelessly raped template on a city scale map. Apart from having to edit at least 10.000 lines of code (I can be patient), what would be the best approach? Create one line of 100 working cells and copy paste the code afterwards for the other 99 lines? -- Johnny Twotoes 21:13, 1 August 2012 (BST)
- Assuming it is possible, however, then I think it would just be a lot of typing, since you'd need to individually type in the names of all 10,000 blocks in the city, I believe. Rather than going across, however, a better way to do it might be to make templates on the suburb level, then group them together to become a city-wide one. It should mean that each piece can stand independently, which means that they'll have more widespread usefulness, and it also means that as you have more to the city-wide one, you won't have to restructure it very much, since you'll be dealing with far fewer pieces. —Aichon— 21:21, 1 August 2012 (BST)
- So one suburb at a time and then "collect" all those results in one big table? -- Johnny Twotoes 21:26, 1 August 2012 (BST)
- Yep. You'd make something like your smallmap, one for each suburb, then you'd make a largemap that would hold the 100 smallmaps. Doing some back-of-the-napkin math, however, I expect it to break the page after around 40-50 suburbs, possibly even sooner, depending on what you have in your switch statement. Also, speaking of it, while my switch only did ruined, rebuilding, and safe, you can actually use any of the other statuses as well, such as "pinata" or "in zombie hands". Adding those two would cause it to break in about 20-25 suburbs. If you added the other statuses too, it'd break even sooner. It gets hard to do things at a large scale with templates, unfortunately. —Aichon— 21:37, 1 August 2012 (BST)
- So one suburb at a time and then "collect" all those results in one big table? -- Johnny Twotoes 21:26, 1 August 2012 (BST)
- How about if I use a pyramid scheme? 1 template per suburb => 1 template per 10 suburbs => 1 template to rule them all? -- Johnny Twotoes 21:39, 1 August 2012 (BST)
- Same issue. When the page counts how many bytes it's including from templates, it counts the bytes for all the templates those templates include, and so on. Nesting them further just adds more bytes, since you're adding more layers. My suggestion to do them at a suburb level was more driven by the fact that I think it's easier and will leave you with something usable when the city idea breaks, rather than because it will prevent the city one from breaking. —Aichon— 21:42, 1 August 2012 (BST)
- How about if I use a pyramid scheme? 1 template per suburb => 1 template per 10 suburbs => 1 template to rule them all? -- Johnny Twotoes 21:39, 1 August 2012 (BST)
- And if we consider only 3 (or even two) possible statuses, the approx. 6000 empty blocks that are empty and that won't call on a template? -- Johnny Twotoes 21:44, 1 August 2012 (BST)
- They'd still take up some code, just less of it. You may be able to pull it off though. I couldn't say for sure since I don't know the average length of a block's name, and I'll also readily admit that calculating this sort of stuff has never been a strong suit of mine. You may want to consult Karek, since he understands the numbers behind page breaking much better than I do (he can probably point out where I have it wrong). Alternatively, just make a fake suburb of 40 blocks that are the same and 60 that are empty, then make a fake city out of that one suburb and see what happens. That's the easiest way to check this stuff. ;) —Aichon— 21:52, 1 August 2012 (BST)
- And if we consider only 3 (or even two) possible statuses, the approx. 6000 empty blocks that are empty and that won't call on a template? -- Johnny Twotoes 21:44, 1 August 2012 (BST)
- Well, it's a hell of a lot of work, so before I do that, I want to know if it would be in vain :p Thanks for the help and I'll ask [[User:Karek|] -- Johnny Twotoes 21:54, 1 August 2012 (BST)
- Careful, he bites. ;) —Aichon— 21:56, 1 August 2012 (BST)
- Is it just me or is it getting cramped in here? ;) -- Johnny Twotoes 22:09, 1 August 2012 (BST)
- Careful, he bites. ;) —Aichon— 21:56, 1 August 2012 (BST)
- Well, it's a hell of a lot of work, so before I do that, I want to know if it would be in vain :p Thanks for the help and I'll ask [[User:Karek|] -- Johnny Twotoes 21:54, 1 August 2012 (BST)
I tried something like this a while back and not only was it extremely time consuming to do even one burb, but doing more than even 2 burbs broke the inclusion limit. Keep in mind that building status reports have moving parts and those parts are going count every time any status report is used. here is an example of a map I made that incorporates status updates. There are also TRP status maps which like the Mall Status Map and NT Status Map which do basically this but on a more focused scale. ~ 23:56, 1 August 2012 (UTC)
- Looks like it took me about 30 minutes to make this, but I expect that it would take less time if I did a second one, since I know what I'm doing now. —Aichon— 00:26, 2 August 2012 (BST)
- That's a very basic version of what I wanted to make, yeah, although the above restrictions would probably still F things up after a couple of suburbs. -- Johnny Twotoes 00:34, 2 August 2012 (BST)
- Not the most beautiful of things I've seen so far, but 80 suburbs is a lot better than expected. Too bad there isn't a good way to increase that number :/ -- Johnny Twotoes 00:49, 2 August 2012 (BST)
- Well, it was slapped together simply as a test of breaking the page, not to look pretty. Looking pretty would just add more onto the page. I cut out some more and managed to get it up to 86 suburbs. It might be possible to push it further, but I've already pushed it pretty far. Not sure what else I could take out easily, and I've already made the code unreadable. —Aichon— 01:00, 2 August 2012 (BST)
- I prettied it up a bit by making it use all of the different colors. It'll still only get 85 suburbs though. Not sure what else I can cut, other than going and editing the official colors for this stuff (some of which can be chopped in half, but would result in slightly different shades). —Aichon— 01:05, 2 August 2012 (BST)
- You're on the right track. I think those slightly different shades are worth it tho. Is there an option to make them squares, rather than rectangles? -- Johnny Twotoes 02:59, 2 August 2012 (BST)
- You'd have to fool around with the CSS. And considering this was just a demo for the sake of seeing how far we could get before breaking the page, I'm probably not going any further with it. It was something I whipped together in a few minutes to test something. You'll have to take it the rest of the way if you're interested in it, since it would need a lot of refining, assuming you can get it to work. :P —Aichon— 03:41, 2 August 2012 (BST)
- You're on the right track. I think those slightly different shades are worth it tho. Is there an option to make them squares, rather than rectangles? -- Johnny Twotoes 02:59, 2 August 2012 (BST)
- I prettied it up a bit by making it use all of the different colors. It'll still only get 85 suburbs though. Not sure what else I can cut, other than going and editing the official colors for this stuff (some of which can be chopped in half, but would result in slightly different shades). —Aichon— 01:05, 2 August 2012 (BST)
- Well, it was slapped together simply as a test of breaking the page, not to look pretty. Looking pretty would just add more onto the page. I cut out some more and managed to get it up to 86 suburbs. It might be possible to push it further, but I've already pushed it pretty far. Not sure what else I could take out easily, and I've already made the code unreadable. —Aichon— 01:00, 2 August 2012 (BST)
- Not the most beautiful of things I've seen so far, but 80 suburbs is a lot better than expected. Too bad there isn't a good way to increase that number :/ -- Johnny Twotoes 00:49, 2 August 2012 (BST)
I'm going to go ahead and thank you Aichon for your Demo10 and Templates5. They were the missing pieces in a puzzle I've been trying to put together to simplify the updating of my character positions. My WIP can be found here and here. --Klexur 06:06, 2 August 2012 (BST)
- You could've just asked earlier. :P
Any idea what happened here? —The preceding unsigned comment was added by Peralta (talk • contribs) at an unknown time.
- I think I fixed it. Looks like a case of an extra close td tag? —Aichon— 19:17, 12 August 2012 (BST)
- Yup, thanks! Me and Charles Whipplebotum are working on filling it in :) Just wondering if it would be possible to install a counter for each status as well? Like how many buildings are safe, unknown, etc? -- Johnny Twotoes 18:14, 14 August 2012 (BST)
- I can't think of any way to count items using wikicode off the top of my head (aside from hand-coding each individual count), so I wouldn't bet on it happening. It might be able to work at the suburb level (and even then, I have my doubts), but definitely not at the city level. —Aichon— 20:06, 14 August 2012 (BST)
- Here is one way. Write a if template that assigns a 1 if a status is true and a 0 otherwise. For a given building type in a suburb, stack the templates left to right so the final output is a binary number. For example, if a suburb has 4 hospitals, you would have four status templates (tied to Danger) in a row, the output might be something like 0110. I have a series of counters (up to 10 bit) that you would send that string to get the final count for a suburb. See here for the counter templates.-MHSstaff 20:25, 14 August 2012 (BST)
- I can't think of any way to count items using wikicode off the top of my head (aside from hand-coding each individual count), so I wouldn't bet on it happening. It might be able to work at the suburb level (and even then, I have my doubts), but definitely not at the city level. —Aichon— 20:06, 14 August 2012 (BST)
- Yup, thanks! Me and Charles Whipplebotum are working on filling it in :) Just wondering if it would be possible to install a counter for each status as well? Like how many buildings are safe, unknown, etc? -- Johnny Twotoes 18:14, 14 August 2012 (BST)
Easier If Equal Then?
Since I wasted time not asking last time, I am now. Is there an easier way to make a an If Equal Then statement in equivalent to this mess: title="{{if|{{{Kempsterbank|}}}|{{switch|{{{Kempsterbank}}}|case: o=Kempsterbank|default={{{Kempsterbank}}} is in Kempsterbank}}|Kempsterbank}}" --Klexur 21:30, 4 August 2012 (BST)
- Well, you're not actually using an if-equal-then; you're using an if-then. And if you use an if-equal-then instead, I think you can reduce it to this without changing any of your behavior or other logic at all (this is dry-coded since I'm about to run out the door however, so you'll need to make sure it works): title="{{ifequal|{{{Kempsterbank|o}}}|o|Kempsterbank|{{{Kempsterbank}}} is in Kempsterbank}}". Basically, your code performs checks to see if it's blank, equal to o, or equal to something else. Mine combines your first two checks by treating a blank as an o, thus saving some code. That said, the net code may still be larger, since I believe that ifequal is a more complicated template than the if template, meaning that while it may make more readable code, it may break the inclusion limit sooner as well. Something to watch out for if you're trying to make this work at massive scales. —Aichon— 23:51, 4 August 2012 (BST)
- Maybe I'm over thinking this but the more I look at that, I'm not sure. I'm trying to code this so each suburb will check if it is set to either a name or o. If set to a name it will output Name is in Kempsterbank., but if set to either nothing or o then Kempsterbank. I'm going to try it though just to check. --Klexur 00:43, 5 August 2012 (BST)
- Seems to work fine. =] Thanks. So back to the inclusion limit. Do you think it'll break? --Klexur 00:58, 5 August 2012 (BST)
- Sorry for spamming your talk page, but I just realized I have another section reading {{if|{{{Kempsterbank|}}}|{{switch|{{{Kempsterbank}}}|case: o=o|default=c}}|x}} for determining what color to apply. I don't think the If Equal will work though. --Klexur 01:02, 5 August 2012 (BST)
- That already looks pretty short. I can't see a way to shorten it more without having to change how you have things set up. If you were willing to do that, we could cut out quite a bit of code, I think, but that'd mean having to reexamine the entire structure, and that's probably not worth it at this point. —Aichon— 02:34, 5 August 2012 (BST)
- I haven't had much time to play with this but I did remember you saying something about changing the setup to shorten code. Just what did you have in mind? I do love minimalism. =P --Klexur 01:54, 12 August 2012 (BST)
- I hadn't given it much thought, to be honest, but off the top of my head, I suspect that removing the ability to use either a blank or a "o" to mean the same thing could chop out a lot of code. After all, this is a personal template, not a general use one, so there shouldn't be as much need for failsafes and the like, since you know how to use it correctly. Stuff like that, more or less. —Aichon— 02:17, 12 August 2012 (BST)
- Unless I'm missing something(unaware of the context) the If template is just a waste of code here. Minimum you should be using Ifdef or ifndef(if just calls both and only increases your inclusion size) but even that is wasted code when you're using a switch just better word the default to fit undefined cases. --Karekmaps 2.0?! 12:46, 12 August 2012 (BST)
- Also for User:Klexur/visitedsuburbs you should be using {{Ifdef|{{{00c|}}}|{{{00c}}} is in Dakerstown|Dakerstown}} instead of {{if|{{{00c|}}}|{{{00c}}} is in Dakerstown|Dakerstown}} It's the exact same function for your purposes without the extra Ifndef call and defaults to Blank like the If does. --Karekmaps 2.0?! 12:52, 12 August 2012 (BST)
- Unless I'm missing something(unaware of the context) the If template is just a waste of code here. Minimum you should be using Ifdef or ifndef(if just calls both and only increases your inclusion size) but even that is wasted code when you're using a switch just better word the default to fit undefined cases. --Karekmaps 2.0?! 12:46, 12 August 2012 (BST)
- I hadn't given it much thought, to be honest, but off the top of my head, I suspect that removing the ability to use either a blank or a "o" to mean the same thing could chop out a lot of code. After all, this is a personal template, not a general use one, so there shouldn't be as much need for failsafes and the like, since you know how to use it correctly. Stuff like that, more or less. —Aichon— 02:17, 12 August 2012 (BST)
- I haven't had much time to play with this but I did remember you saying something about changing the setup to shorten code. Just what did you have in mind? I do love minimalism. =P --Klexur 01:54, 12 August 2012 (BST)
- That already looks pretty short. I can't see a way to shorten it more without having to change how you have things set up. If you were willing to do that, we could cut out quite a bit of code, I think, but that'd mean having to reexamine the entire structure, and that's probably not worth it at this point. —Aichon— 02:34, 5 August 2012 (BST)
How scripts make the rounds
Since you have adopted the script since, I think it would be polite to let you know that I have stolen most of the code from Urban Dead Profile Links to create Urban Dead Attack Links (a script i really needed since Profile Viewer finally broke down under the barrage of FF updates, and since Chud doesn't paste the attack URL to the URL bar like Profile Viewer did). Since Midinian gave originally permission "to alter it and redistribute it freely", I figure this falls under fair use, especially since I made the results available to every player and gave the necessary props to M in the documentation. -- Spiderzed█ 22:36, 4 August 2012 (BST)
- That sounds fine to me. By all means, continue pushing forward with that. :) —Aichon— 23:27, 4 August 2012 (BST)
- So does it replace Profile Viewer? I miss that script. Badly. ~ 03:47, 5 August 2012 (UTC)
- not bad. me likes.--User:Sexualharrison16:04, 12 August 2012
- It doesn't completely replace Profile Viewer. (I've looked at the code, but couldn't figure out which changes past FF3 caused it to finally break.) This script only replaces a single functionality: Directly generated attack URLs. The main use of them is that you can attack the same target repeatedly by just tapping F5 (or whatever your browser uses to refresh the page), once you have the URL in the URL bar. This is especially handy for PKers, as a.) it saves tedium and b.) allows you to strike and flee quickly. I have also found it very handy in my rare real-time battles. -- Spiderzed█ 19:24, 12 August 2012 (BST)
- Didn't realize it still worked in old FF versions. For me, it work one minute and did not the next. There weren't any (known) FF updates in between. I had assumed there were some game changes that were responsible. That's what borked it last time and I believe K was making changes to ?profile.cgi around that time (font change among them). I guess it could be a combination of things. From what I understand, some odd code was chosen for Profile Expander. Something about GetId() I think. ~ 20:00, 12 August 2012 (UTC)
- Profile Viewer continued to work ust fine for me under FF3 and all of its updates. It only stopped to work when Mozilla finally forced my FF3 to get a full upgrade. At that point I didn't bother to move back again, but I'm certain you'd find the script working if you forcibly went back to FF3. -- Spiderzed█ 20:48, 12 August 2012 (BST)
- Didn't realize it still worked in old FF versions. For me, it work one minute and did not the next. There weren't any (known) FF updates in between. I had assumed there were some game changes that were responsible. That's what borked it last time and I believe K was making changes to ?profile.cgi around that time (font change among them). I guess it could be a combination of things. From what I understand, some odd code was chosen for Profile Expander. Something about GetId() I think. ~ 20:00, 12 August 2012 (UTC)
- It doesn't completely replace Profile Viewer. (I've looked at the code, but couldn't figure out which changes past FF3 caused it to finally break.) This script only replaces a single functionality: Directly generated attack URLs. The main use of them is that you can attack the same target repeatedly by just tapping F5 (or whatever your browser uses to refresh the page), once you have the URL in the URL bar. This is especially handy for PKers, as a.) it saves tedium and b.) allows you to strike and flee quickly. I have also found it very handy in my rare real-time battles. -- Spiderzed█ 19:24, 12 August 2012 (BST)
- not bad. me likes.--User:Sexualharrison16:04, 12 August 2012