User talk:Flame2512

From War Thunder Wiki
Revision as of 23:08, 13 May 2019 by AN_TRN_26 (talk | contribs) (Edits.)
Jump to: navigation, search

Hello, i wanted to ask you about radar resolution keybinding. It would seem that there is "change radar scope scale" hotkey for ground vehicles in settings, but it doesn't seem to work on chieftain marksman at all. Although vehicle itself changes resolution by itself from 12 to 10 km whenever i try to track something, and it also seems to make spotting easier in sniper mode (works only in sniper mode), since it changes resolution to 10k briefly, and actually catches things, that it normally misses. Do you know anything interesting about either of those things? I feel like this is a leftover from workaround for Vulcan and SIDAM, but maybe there is a way to change radar's range manually somehow? Seems useful against planes with small signature, or something along those lines. --bangerland (talk) 18:28, 23 April 2019 (UTC)

The chieftain marksman only has one range setting fixed at 12 km (some other SPAA have multiple, i.e. M247 has 10 km, 20 km and 40 km), so the radar range scale key has no effect as there is no other range scale to switch to. As for the other bit, the Marksman uses a combined tracking and search radar, with the radar capable of scanning out to 12 km and tracking out to 10 km. From what I can tell, what is happening is that when the lock key is pressed the radar briefly stops scanning and does a sweep in tracking mode. As once the radar is in tracking mode it's maximum range is only 10 km, so the radar display updates to show this. If no track is established the radar drops back into scanning mode with a max range of 12 km and the indicator range updates. If a lock is established you will notice the the radar stays in tracking mode (antenna not spinning and instead pointing directly at the locked target) and the max range remains at 10 km on the display (both in first and third person) until the track is lost, at which point the radar enters scanning mode with a max range of 12 km. When a lock is established the range display drops down the 10 km in both third and first person, but if it is not the momentary drop in range is only noticeable in first person, not sure why this is. --Flame2512 (talk) 19:41, 23 April 2019 (UTC)
Well, the reason why i even brough this up is, whenever marksman temporarily drops resolution to 10 km (IE just uses it's tracking radar) it scans for planes better. I even checked in test drive - it can't catch Mig 15 bis as it flies by, even when i force search radar to follow the turret, but when i specifically go into sniper mode and look at it, then press lock-on, bam, it locks on and even tracks it for a bit (though often it just does weird jiggle and breaks lock-on instantly). Do other radars lock on better when their search range is reduced like so? I kind of feel weird about all of this, since ingame i barely can lock on on things 4km away, and max range is 10km, lol. Should plane be like TU-4 on it's regular space bombing altitude for this to work? :D --bangerland (talk) 22:08, 23 April 2019 (UTC)

TTX table question

Flame2512, I believe you were working on these tables at one time if so, I have a question for you regarding one I am working on. Here is the code/table:

Item own.png
I-16 type 5
test text
Item own.png
test text

I am having issues with the Tree-Unit template boxes, for some reason when they are positioned at the right side (ttx-value spot) of the table, the background grey color does not fully fill out behind the image and name of the aircraft (like it does in the aircraft trees). If the Tree-Unit box is moved to the ttx-name position, it does render the entire background, but centres the image in the table instead of shifting it all the way to the left. I would like the Tree-Unit to be on the right side of the table with the background all grey, not just the 1/6th it currently shows. I can pick apart the current coding, but I don't understand all of the different parameters to make this happen. If you have time to take a look and potentially find a solution, I would appreciate it. Thanks! AN_TRN_26 (talk) 21:50, 11 May 2019 (UTC)

Image seems to resize to text, so applying "bold" style to it fixed the image somehow. Though image is now "above" the text, because it is bigger --bangerland (talk) 00:15, 12 May 2019 (UTC)
That does fix the background, however, I wonder if there is a way to do that without bolding the text, getting the Tree-Unit template seated to the right (not center) and get the "test-text" to be centred on the left of the box. AN_TRN_26 (talk) 00:27, 12 May 2019 (UTC)
As i see engine treats the "images" as part of text, so you may want to look into the command that summons it there, to make it treat it as image somehow, so you can apply "image" formatting commands instead (like, "wrap around text", or "right". Even when you mess around in "visual" mode it just moves them a string up or down,so you can never really center them (as they are relative to eachother). I also don't see there any text editing types in "help" menu that are typical to "office word" or whatever, so i cannot really help you in any way with that. sorry. --bangerland (talk) 00:47, 12 May 2019 (UTC)
Welcome to the weird world of CSS (TL:DR at the bottom). As a quick intro if you haven't heard of CSS: CSS is a language which tells the browser how to correctly display a webpage; ttx-value is a CSS class which contains a list of instructions (in this case: align everything to the right, use non-bold text, etc., etc.). For some reason the Tree-Unit template does not play nice with the ttx-value class, you can prove that by somewhere sticking a tree unit template into a span, it will work, if you then add the ttx-value class to the span it breaks. And while we're at it, what bangerland did does bold the text, but not for the reason you would think. When bangerland applied wikitext formatting inside the class attribute all he actually did was change the class name from ttx-value to '''ttx-value''' there is no CSS class with that name, so it has the same effect as the class attribute not being there at all (indeed you test this this by deleting it on the one I left). As there is no ttx-value class assigned to it anymore it looses the instructions such as "align to the right" so appears in the wrong place. As for the bold text that appears because the template (and everything else in the table) are inside a div with the ttx class assigned, which states all text inside the div should be bold (among many other things), the ttx-value class tells the text to not be bold to counter this.
So how do we fix this? We know that the ttx-value class breaks the background on the Tree-Unit template, and as bangerland demonstrated removing that class fixes the background but causes other issues. You can apply CSS instructions without using classes, by using the style attribute, so the solution I found was to just right align the template to the right and set the text to not bold using in-line CSS instructions rather than using the class. As it happens the class does a few other things, but we can get the desired effect without including them. Interestingly you can apply all the instructions from the ttx-value class using in-line CSS just fine, this is likely some oddity of CSS to do with what order the rules get applied in depending on how you specify them (the wiki has a lot of CSS going on, so something is probably conflicting somewhere). I haven't included the other information from the ttx-value class as in-line CSS because it gets messy and we can achieve the desired effect without it. Keep on using the ttx-value method for everything other than this application though as it is best practice to do so, and my method here may have unexpected side effects if used for anything other than making the tree-unit template work.
TL:DR CSS was being weird, I fixed one of the templates so you can easily see what I changed compared to the other one in order to do so, it works for the purpose of making the template work but carry on using the normal method for everything else. --Flame2512 (talk) 08:29, 12 May 2019 (UTC)
Wasn't aware of this, since i'm unfamiliar with commands for wiki or websites in general. So it is possible to apply certain style manually to this instead of ordering it to treat it in certain way (hence, class)? At least that's what i gather from this. I wouldn't figure out real reason behind this anyhow, because when i specifically applied random symbols and numbers to class name to specifically break it, it didn't affect it. All is well that ends well, i guess. --bangerland (talk) 11:03, 12 May 2019 (UTC)
Mediawiki lets you insert HTML code to build your pages, as a result you can use the style attribute inside the HTML tag to apply CSS to the contents of that tag. This site is pretty good for learning HTML and CSS. I would advise against using too much inline css though because it will make the page code get messy quick.
The wiki has what is known as an external style sheet (well it has a couple but that's beside the point). The stylesheet contains a list of classes, with each class containing CSS code, when you assign the class to a html element it tells your browser to format it according to the code in that class. For instance the ttx-value class says to align all items and text to the right, says to use normal text (not bold), sets up a 5 pixel margin on the left edge and specifies a max length before a new line is started.
This is a good intro to the basic concept of CSS, on the left is the HTML code and on the right is the website. In the heading tag (the line starting "<h1") there is a style attribute and inside the quotes is CSS code. The HTML code tells the browser this is a heading while the CSS code tells the browser you should display the text as blue with a 30 pixel margin. You can change the colour specified in the CSS to "red" for example, and if you click the run button you will see the web page updates and the text is now red. That works fine for basic websites but if you want say nearly every heading to be red and have a whole bunch of other formatting you would write your HTML code in a class and then assign that class to each heading. When the browser sees a heading with a class assigned to it, it looks at the code in the class and treats it as if it was in the style attribute. That way you don't have to type out the same code over and over again and it keeps the code looking much neater. This is of course only a very simple explanation of what is going on.
That is an awesome explanation, finally someone pinpoints to me a language that is being used and why it's doing what it's doing. I have 0% CSS experience (I've looked at it, just never pursued it) so I guess that is why I didn't recognize it, time to learn! The information you provided makes more sense now on how/why the Specs|card code page works the way it does. I could look at that stuff and get an idea of what it's doing, but now that I know its CSS, I can actually learn CSS and understand exactely what it's doing. I have used w3schools for Java and Python, but not for CSS yet. Definitely would like to learn to balance the code on the pages to get the effect desired without having something it be messy and unruly! Awesome, thanks again for the explanation! AN_TRN_26 (talk) 22:14, 12 May 2019 (UTC)
CSS is a fairly simple concept but it can get a bit weird at times (as we've seen). There are some complex rules to do with which CSS take precedence. In that table we have the Tree-Unit template which consists of about 3 different components each with CSS attached, that is then inside a table line which has its own CSS (the "ttx-value" class), which is turn inside a table with its own CSS (the "ttx" class), so you end up with a load of different CSS rules for the browser to work out what to do with and what order to apply them in; presumably a few rules were interacting in ways which were unintended (whoever wrote the code for the wiki intended for the ttx class to only be used for vehicle stat cards and the tree-unit template to be used on tech trees so would have no reason to see what happens if you stick on inside the other). You can google the CSS order of precedence, but generally inline CSS is nearly at the top so you can overrule classes and stuff, and sort of say "ignore the other stuff, do this". Like I say best to only use inline CSS where necessary though and stick to using Gaijin's classes where possible; no one wants wiki pages full of: <div style="width: 300px;float: right;margin-left: 10px;margin-bottom: 15px;border: solid 1px #B0BEC5;background: #EEEEEE;color: #323246;font-weight: bold;line-height: 1.4em;"> (as an example that is what <div class="ttx"> would look like if you wrote it using inline CSS instead of calling a class, all that code is in the wiki's stylesheet and is loaded by the browser when you call the ttx class).
I found the CSS page here on the wiki which breaks down each of the classes (I believe that is what they are called) and can see what the parameter each one is calling for. That helps me understand better what is going on and what the limits of each one are for. Definitely not going to add any without first letting the wiki developers first take a look at it, however for now for what I need everything is there! Definitely will be looking at the order of precedence and such to see what else I can glean and use. AN_TRN_26 (talk) 23:08, 13 May 2019 (UTC)