Bismarck.Ascrookshanks said:
OK, I haven't used Spellcast ever, but want to.
Why is this so complicated? I want it to be simple:
I want all my gear to swap when I choose a spell from my menu of spells....is that wrong?
Otherwise, how does spellcast work?
Like I don't understand the town set, or idle set (I mean, I understand why they are used, just not how to use them).
Like, how would you tell it that you are idle?
Either way, I just want my gear to swap out when I cast a spell or use a ja or heal, end of story, no sets or other complicated stuff.
Is this possible? And if so, how would the .xml look?
THANKS!!!
Alright, first off, spellcast is incredibly easy. Seriously, it really is. The most difficult things to do are:
Getting started, this by far is the most difficult if you have no coding experience like I had.
and, experimenting with more complicated tasks.
This is how difficult spellcast is:
Code xml
<?xml version="1.0" encoding="utf-8"?>
<spellcast>
<config />
<!-- This is something you shouldn't worry about unless you want to debug your script (find out where
the logic is going wrong), show gear swaps, spell info, or some other rarely used configurations to
spellcast -->
<variables>
<!-- These are what I'd consider advanced features of your script that you shouldn't take on until
your truly ready. They aren't hard, and are incredibly powerful features for spellcast, but they can
be confusing for someone who doesn't understand spellcast -->
</variables>
<sets> <!-- This is the easiest part of your script -->
<group Name="White Mage" default="yes">
<!-- You need this line, change the group name to what ever you want -->
<set Name="Healing"> <!-- This is the name of the set -->
<main>Insert Item Name</main> <!-- List your gear here -->
<sub>Insert Item Name</sub>
<ammo>Insert Item Name</ammo>
<head>Insert Item Name</head>
<neck>Insert Item Name</neck>
<lear>Insert Item Name</lear>
<rear>Insert Item Name</rear>
<body>Insert Item Name</body>
<hands>Insert Item Name</hands>
<lring>Insert Item Name</lring>
<rring>Insert Item Name</rring>
<back>Insert Item Name</back>
<waist>Insert Item Name</waist>
<legs>Insert Item Name</legs>
<feet>Insert Item Name</feet>
</set> <!-- Don't forget to close your tags! -->
</group>
</sets>
<rules> <!-- This is where the difficult part is, but its easy -->
<if Spell="Cure V">
<!-- Checking to see if the spell your casting is Cure V, if true then it continues with these rules,
if not it skips this section -->
<equip when="precast" set="Set Name" /> <!-- You want fast cast here -->
<equip when="midcast" set="Healing" /> <!-- This is the set above that we made -->
<equip when="aftercast" set="Set Name" /> <!-- Use this to return to a set after your finished
casting, or doing w/e -->
</if> <!-- Don't forget to close the spell -->
</rules> <!-- Close the rules, we're done with the example -->
</spellcast> <!-- Finally close out your script to finalize it -->
First off, what is precast, midcast, and aftercast?
A spell consists of 3 parts: PreCast (before you start casting), MidCast (obvious, in the middle of casting), and AfterCast (after your done casting). Job Abilities and Weapon Skills consist of just PreCast and AfterCast.
As your writing up your script, you should always keep it organized. Notice I said that your writing it, this is important if you want to use spellcast. Just copying someones user script and changing the gear does nothing for you. If you run into complications with the script you wouldn't know the first thing in fixing it, and would drop it instantly to find another. I urge you to create your own.
With that said, you need some tools. You can do this in notepad if you wanted to, its not impossible, but it isn't that user friendly for newbies. It's not even user friendly for me, I find the plainness rather boring. Now, there are other programs available to you, and I'll explain.
Notepad++ - By far the most popular choice among people. It's free, powerful, colorful, and just plain cool.
That really is all you need, but if you want something a lil more powerful than that then I enjoy Microsoft Visual Studio. It's engine is more powerful than notepad++'s and it automatically closes tags for you ultimately saving you precious time when your writing huge chunks of rules. It's not free though.
Why are you asking me to write my own script again?
Because, I said so!
Na, but you'll benefit from it so much more. User scripts are great, and are in fact one of the greatest resources available to you. But they are so large and so detailed that the time it would take to start out from no knowledge and reading one of them would be 10 times as long as it would be writing your own.
The knowledge you gain writing you own is much deeper than reading what someone else has already proven. The kinks are all out, or the majority of them are. Maybe an update broke part of the code but the majority of them are all up to date. That is a flaw for you, you don't have the experience of making a mistake, finding out why its not working, and finding the solution to the problem. That is valuable knowledge for you in understanding spellcast.
Also most importantly, I believe, is that the during the time it takes you to write your script you gain more than the knowledge of how to write a spellcast script. You gain something much more valuable than that, and that is insight into your job. We all know something about our jobs, but no one knows everything about it no matter how much of an expert you think you are on the subject you can always learn something from it. This is where spellcast comes in by having you go through the logic of the job, and its tasks, you gain an understanding of the mechanics of the job. While your creating your script you'll not only be looking up rules and variables, but also different aspects of your job.
For example, a cure. Cures are very simple in theory, you cast it on the target and you cure for an amount. But what goes on between that 1 second of casting? There is so much more than you hitting the button and your character raising their hand. The game is looking for dozens of variables based on your stats, buffs, harmful status effects, equipment. But it even goes beyond your control including weather and day, even the time of the day if your gear has these requirements, that includes moon phase too on rare equipment that no one will ever use <.<! Continuing on, the game uses these variables in specific steps of the process. A cure seeks out fast cast during precast, and then cure potency, mnd, vit, healing magic, -enmity, haste, conserve mp, and other status enhancing stats during midcast. This all adds up into how much you cure for, how much mp you spend, how fast you cure, and the delay on your next cast.
Cures might be one of the more complicated simple things in the game, when you move onto melee things become vastly more simpler, and yet covers completely different rules and aspects of gear. It even removes the aspect of midcast making it much more simpler, yet more challenging at the same time in a way. You don't have 2 variables to enhance your ws's or ja's like spells do, so you only have 1 category to pull out everything you got to smash your opponent to bits. If you don't get everything on in time before the game sends over the information that you want to use this WS then your out of luck, and could be missing out on some important equipment.
Enough talking, just tell me what to do already :(
Alright, well you need to plan out your goals. What are you looking for in your spellcast? Are you a blm looking for a way to make gear swapping easier for all the elements your nuking with? Are you a bard having to juggle instruments to please your party? Are you a paladin wanting to squeeze out every bit of power you can throw out to maintain control of the situation? Are you a ninja wanting to make shadow casting easier with the use of cancel plugin? Are you a melee just wanting to enjoy a less chaotic experience of changing gear and just enjoy tearing apart the enemy ripping hate away from the tank and enjoying it?
What ever you want to do with your script, you need to plan out what you need. Lets take WHM for example: You want a script to manage your cures, resting gear, and idle gear. There is of course so many aspects of whm, I'm just keeping this short (yea right).
So lets start with cures. You want to have a fast cast set for precast. Your mid cast depends on the situation, and if your the type of whm that would have multiple curing sets. Let's keep this simple and say you have a single curing set, so this is your midcast set. Then you want to switch to your idle set which consists of refresh and -dmg taken gear.
That is 3 sets, and you know the 3 eqiup rules your going to use with your cures. Making the sets is easy enough, you should know the gear your going to use already since you use the gear in your in game macros', or you know what you want to use but you haven't yet because its inconvenient without spellcast. The more difficult part comes with the rules.
Rules are the logic that takes the sets you make, and brings them to life. If you want a set to activate when you use a cure it is very simple:
Code xml
<if Spell="Cure*">
<equip when="precast" set="Set Name" />
<equip when="midcast" set="Set Name" />
<equip when="aftercast" set="Set Name" />
</if>
Although a very simple rule, this will get the job done for what was asked. Notice the asterisk (*), that is a wildcard which means any spell that starts with Cure will qualify. It doesn't matter if its just Cure, Cure III, or Cure VI, all of them will work. You could even do Cure*|Cura* if you wished, this would cover even the Curaga spells as well as Cura and Cura II. How advanced and detailed you want to get depends on your goals.
How do you go about making the best script for yourself?
Take it slow. Yes, this is inconvenient, I know, but no matter how late you stay up working on it, how many hours you loose making it, you'll never finish it completely. Don't even try, because your setting yourself up for failure 99% of the time, unless your drive is inhuman. The thing is, you'll always be working on it. When you think your done your going to find something wrong, and when you think you got all the problems out your going to think of something else you want in there, and the cycle will never stop. After updates things will be released that need to be added into there and you have to find a way to make it work.
So my advice to you would be this: Start out by meeting the minimum requirements, that is covering all the spells/ja's/ws's that you want to cover in your script. Don't start writing the detailed rules out, just get the if statements in there, like your writing the draft. Next, start knocking out the quick fixes, and save the more detailed stuff for later.
Once you have the skeleton created, save your work and make sure there aren't any issues. You can do this by loading it in your game:
Open the console and type in "sc load Name.xml" replacing name with what your naming your spellcast. Speaking of names, you'll want to name your spellcast something like this:
Kalilla_WHM
This will allow the spellcast plugin to auto-load that script every time I change to whm, or start the game as whm, or load the plugin while on whm. You can even take that a step further:
Kalilla_WHM_SCH
Kalilla_WHM_RDM
Kalilla_WHM_BLM
If you so wished, you can even make scripts for the sub your using. That is unnecessary, but its there if you want it.
Now, you should have a script that is giving you no errors in the console window. If it is, it includes the line number of the issue. Find that line number in your script and look for the problem, it is fairly obvious what it is once you get to the line. XML is very picky when it comes to keeping your code clean, don't leave behind any periods or brackets.
Once you test your spells out, you can spam through them (spellcast is extremely fast with logic, you'll know right away when something is wrong), your ready to go onto the more detailed rules. This is a great opportunity to use the windower wiki to learn about different rules and variables that are available to you, but even better is looking at what others do with what your trying to accomplish. Remember, don't just copy something from someone's script unless you understand what it is doing.
Work in progress~