FFXIAH.com

Language: JP EN DE FR
New Items
2023-11-19
users online
GearSwap Tutorial Pt6

GearSwap Tutorial (v0.1)


PART 6



Asking the Right Questions


How do I ... ?


This is the question that comes up for "everything else" -- that is, you've been given all the tools you need, and a pile of lumber, but you still have no clue how to turn that pile of lumber into a chair, or a patio, or a fence, or whatever else you need.

So people ask, "How do I make it do /this/?", and someone answers, and maybe it works, and then they ask again for the next item on their list, and the cycle repeats. They're given instructions on what to do, but not why to do it, or how to figure out how to answer the question themselves.


So this is a lesson on "How do I figure out how to do ... ?"

The first step is to realize that once you've written out the question, you pretty much already have the answer. Consider:

How to I get it to equip Tantra Cyclas while Impetus is up?

First, instead of asking it as a question, just write out what you want to happen:

When Impetus is active, I want my TP set to include the Tantra Cyclas.

Rephrase it a little bit to match the programming language:

If Impetus is up (how do I know? the buff is active (ie: buffactive['Impetus'] is true), or I just used the JA), equip Tantra Cyclas when I equip my TP set.

Then all you need to do is figure out the points where you equip your TP set, and add this rule:
Code
if buffactive['Impetus'] then
    equip({body="Tantra Cyclas +2"})
end


If you simply read the code, it's literally just doing exactly what you originally asked.

Q: How to I get it to equip Tantra Cyclas while Impetus is up?

A: If Impetus is up, you equip Tantra Cyclas.

That is how simple the answer to most questions is.

The only complication comes from an implicit part of the question that wasn't explicitly said: that you want to equip that gear for TP purposes while you're meleeing. Thus the above code snippet isn't complete because it assumes that the other part of the question (Where do I put this in my code file?) is already answered, since it wasn't explicitly asked.


So the next lesson you need to learn is: How do I express the entirety of what I want to ask? This is because the original question is a lie.

Incomplete question (lie):
How to I get it to equip Tantra Cyclas while Impetus is up?

Complete, actual question:
How to I get it to equip Tantra Cyclas in my TP set when I'm engaged, while Impetus is up?


Note that in my first explanation I already dealt with changing the question to the more complete form in the first rewrite.

The general process is still the same though. You just also need to keep in mind some supplementary questions, such as, "When do I equip my TP set?", and "How do I know if I'm engaged?"

Note that this depends a fair bit on your own code file, as that provides the context for answering some of the supplementary questions. If you ask someone a question like that, and they don't know when or where you equip your TP set (because they don't have your code file for reference), it's impossible to provide a complete answer. One would have to assume that the original script writer (you) at least understands enough to deal with those unknown elements.

The main reason that answers fail is because you didn't account for some other aspect of what was going on, or what you wanted to consider, in your original question. For example, not including what you want to happen while Hundred Fists is active, or while you have an MDT set on because you were being targetted by a nuke, etc. In other words, you're back to where your original question is a lie.

If something doesn't work the way you expected, go back to the original question and make sure it really is complete.

Also realize that the question, "How do I equip Tantra Cyclas for Victory Smite while Impetus is up?" is a completely separate question, even though it looks almost the same. Learn how to ask each individual question on its own, even when they're similar. It makes answering each one very simple as well.



Finally, there is no single 'correct' answer, although there usually is a 'best' answer (or rather, a set of answers that are better than most other sets of answers). In math, 2 + 2 = 4, but so does 1 + 3, and 4 + 0, and 6 + (-2), and 1 + 1 + 1 + 1. And programming is just math.

All of the above explanations are not designed to give you the 'best' answer, but just a simple answer (though generally, the simple answers tend to be among the best). To get the best answer, you have to understand a great deal more about a great many things, none of which are particularly relevant for most people. Learn how you can improve your answer when you can, but don't stress out over it, as long as it's correct and complete.



Navigation
Part 1 - Basic Sets and Events
Part 2 - Conditionals and Testing
Part 3 - More on Conditionals
Part 4 - Tables
Part 5 - Abstractions
Part 6 - Asking the Right Questions
Part 7 - Library Tools
Author: Motenten
Date Created: 2014-04-25 23:13:28
Date Last Modified: 2014-05-08 17:14:22
Updates: 4
Bytes: 5410