General Monk Spellcast Noobery

Eorzea Time
 
 
 
Langues: JP EN FR DE
users online
Forum » Windower » Spellcast Scripting » Monk » General Monk Spellcast Noobery
General Monk Spellcast Noobery
 Fenrir.Terminus
Offline
Serveur: Fenrir
Game: FFXI
user: Terminus
Posts: 3351
By Fenrir.Terminus 2012-10-29 11:57:41
Link | Citer | R
 
Hiya! So... I'm pretty new to spellcast still, but I'm trying to understand/do my own thing as much as possible, rather than go the "someone let me copy their spellcast!" route - especially since I have a tough time understanding other people's xmls. While I do my share of copying, I'm trying to make it make sense to me, and the way I play.

Anyway... I'm having trouble with buff dependent gear. I'm moving slow and starting with monk, but this is going to apply to other jobs/abilities as well. I tried basing what I'm doing off of posts in this thread, but I couldn't seem to translate it, or anything else I've read, into something that made sense to me.

What I WAS doing turned into a mess, and I won't even bother posting it. Didn't work, anyway - I could either get impetus working, or changing back to idle gear, but not both. My next step is to try something like this:


Or to look at the full spellcast:
With the idea that I have two different three TP sets - a normal one, and two based on JAs that are active. (I can expand this on my own later.) And, can I end the spellcast there, or do I need something following it?

Does something like this work? It makes sense to me... but that doesn't really mean a whole lot.

And secondly, I'm really curious about groups and how they work. Can I just duplicate all of my set names for say, low accuracy, put them in a group, and change groups based on the situation and just otherwise operate as normal?

Sorry if the way it's formatted is... poorly - I really don't know what I'm doing. :D (Yet!) Appreciate any help.
 Ragnarok.Flippant
Offline
Serveur: Ragnarok
Game: FFXI
user: Enceladus
Posts: 660
By Ragnarok.Flippant 2012-10-30 02:44:35
Link | Citer | R
 
Since you seem genuinely interested in learning how to make this on your own, I'm going to write this all in pseudocode. It's really because I'm tired and lazy, but I also insist that might help you follow the logic better by not having to translate the code in your head.

As a disclaimer though, I've honestly only looked at two other Spellcast XMLs before, so I don't have a lot of experience with the latest and greatest special functions. There may be examples here that can be written better, but the logic behind everything should still apply.

There are a couple of main tips you may want to keep in mind. You probably already understand some of this, but just to cover the basics:

- You should use only one section of the rules to handle equipping your idle/engaged gear. In this case, you have the first rule in your XML, <if spell="autoset"> area, and the rules at the bottom for Impetus/HF/and buffnotactive etc. Stick to just one, so that when you come back to change your engaged sets, you don't have to look through all your rules for anything related to TP gear. This also goes for weaponskills, JAs, spells, triggers, etc. Keep things organized and simple!

- You should avoid redundant rules. In your first rule, you equip the set Engaged when you are engaged; and yet, you do this again as your very last rule.

- If, else, and ifelses are the backbones of your rules, so it's important to understand when and where to use them:

- An if will open a set of conditions--or you can think of them like "questions." If buffactive="Impetus" means "Is Impetus on? If so, do everything in the brackets below." Once one of the questions is answered "yes," all other questions in a series will be ignored. Once another if is read, a new set of conditions starts.

- Elseifs are best used when you need to ask more than one question in the same series of conditions. However, this question is only asked if all preceding questions answered "no," so this question is worded a little differently. Be careful about this, because maybe, like the following example, you don't necessarily need the previous answers to be "no."

On the otherhand, it's good to use elseifs when several rows of ifs are not necessary.

- Elses can be used as a fallback, or whenever it's unnecessary to ask any questions after all the other answers before it was "no."

- Order is important in your sets of conditions! Again, once a question is answered "yes," the code will immediately skip over the rest of the elseifs and elses in the set and pick up wherever it finds a new if. So make sure that answering yes to a previous question won't interfere with one of your later questions. If it does, you may either need to change the order or create a new set of conditions.

- Learn to use if, ifelses, and elses to do more than add functionality--use them to organize your sections.

- Essentially, you want as little code as possible that will still accomplish what you need to. This will make it a lot easier to go back and change/update things later on.



Now, specifically, to answer your question. Your rules will "work," but not well, and it will be annoying to change later on. First, you probably want to remove the rules you put for Impetus and HF at the bottom, and rewrite the first rule to incorporate them like this:
Code
if spell="autoset"
   if status="idle"
       equip idle
   elseif status="engaged"
      if buffactive="HF"
         equip HF
      elseif buffactive="Impetus"
         equip Impetus
      else
         equip Engaged


As for groups, they're fairly simple, but I don't use them and I'm not sure when they are ideal to use (for different weapons?), so my explanation would probably sound more technical than helpful to you without a logical example. For my jobs, I've always stuck to using variable toggles instead. Variable toggles help to simplify your rules for what sets to equip. For example, I may create a variable called "impStatus," and create a rule to toggle this variable into the above code:
Code
if spell="autoset"
   if buffactive="Impetus"
      set $impStatus impUp
   else
      set $impStatus impDown 
   if status="idle"
       equip idle
   elseif status="engaged"
      if buffactive="HF"
         equip HF
      elseif buffactive="Impetus"
         equip Impetus
      else
         equip Engaged


However, although this variable is nice to have, we aren't using it for anything... But what if we simplify your code a little bit by naming your default TP set "Engaged-impDown" and your Impetus TP set "Engaged-impUp" and using this variable in the rules of your code:
Code
if spell="autoset"
   if buffactive="Impetus"
      set $impStatus impUp
   else
      set $impStatus impDown 
   if status="idle"
       equip idle
   elseif status="engaged"
      if buffactive="HF"
         equip HF
      else
         equip Engaged-$impStatus


You can use this for a variety of things like low/high accuracy, low/high haste situations, etc. If you wanted to add accuracy as a variable, and even Hundred Fists (what if you HF something with high evasion), your rule might look like this:
Code
if spell="autoset"
   if buffactive="Impetus"
      set $impStatus impUp
   else
      set $impStatus impDown
   if buffactive="Hundred Fists"
      set $HF HFUp
   else
      set $HF HFDown   
   if status="idle"
       equip idle
   elseif status="engaged"
       equip Engaged-$impStatus-$myAcc-$HF


But how would you decide the value for the variable myAcc? You can declare your var myAcc as highAcc by default, then add a trigger that will toggle it whenever you use it. You can use this trigger by typing /ja "Trigger1" <me> in game. This code would go outside of <if spell="autoset">; I would put it directly after, but before <if type="JobAbility">.
Code
elseif spell="Trigger*"
   if spell="Trigger1"
      if $myAcc == lowAcc
         set $myAcc highAcc
      else
         set $myAcc lowAcc
   if spell="Trigger2"
      control another variable here!


But remember to make a set for every possible situation! Otherwise, you'll get an error if the XML can't find the set it wants to load. If you want a set for every possible combination of the above, you'd end up with a lot of sets, probably more than you need/want:

set Engaged-impOn-lowAcc-HFOff
set Engaged-impOff-lowAcc-HFOff
set Engaged-impOn-highAcc-HFOff
set Engaged-impOff-highAcc-HFOff
set Engaged-impOn-lowAcc-HFOn
set Engaged-impOff-lowAcc-HFOn
set Engaged-impOn-highAcc-HFOn
set Engaged-impOff-highAcc-HFOn

But maybe you don't care whether Impetus is on or off during Hundred Fists. So instead you can use wildcard (*) to simplify these. Wildcard simply means that anything can go there, as long as the rest of the string matches:

set Engaged-impOn-lowAcc-HFOff
set Engaged-impOff-lowAcc-HFOff
set Engaged-impOn-highAcc-HFOff
set Engaged-impOff-highAcc-HFOff
set Engaged-*-lowAcc-HFOn (replaces both set Engaged-impOn-lowAcc-HFOn and set Engaged-impOff-lowAcc-HFOn)
set Engaged-*-highAcc-HFOn (replaces both set Engaged-impOn-highAcc-HFOn and set Engaged-impOff-highAcc-HFOn)

The great part is you can use these toggles for your WS sets too!
Code
elseif type="weaponskill"
   if spell="Victory Smite"
      equip set VS-$impStatus-$myAcc


(And then remember to make all the possible VS-$impStatus-$myAcc sets.)

I think that covers everything you seemed to need for now, and hopefully I successfully taught you at least one thing out of this.

It's time for me to stop procrastinating work now @___________@~
[+]
 Fenrir.Terminus
Offline
Serveur: Fenrir
Game: FFXI
user: Terminus
Posts: 3351
By Fenrir.Terminus 2012-10-31 10:46:23
Link | Citer | R
 
Whoa...

Really, thank you! I didn't expect (and wouldn't have asked if I did) that much effort!

I'm reading through this at work and it seems like something I can follow along with, but I'm going to want to play with spellcast at the same time, too.

The one thing that really stuck out was the redundancy I have/had - that's how I got it to "work." But maybe that was just a result of other problems.

But DEFINITELY all the gear dependent stuff is cleared up - I never realized it stopped running as a condition was met. (Which is why I just started inserting crap over and over again all over the place!) That by itself is going to move me quite a bit closer to understanding all I want to.

Again, really... wow - thank you so much!

Edit: After playing around, two things happened. 1. Everything works! and 2. I cut out something like 60 lines from the xml. Hooray!
 Asura.Izilder
Offline
Serveur: Asura
Game: FFXI
user: Izildur
Posts: 670
By Asura.Izilder 2012-10-31 11:35:28
Link | Citer | R
 
whats the best way to handle Melee Gaiters +2 for locking them in for TP (Engaged) set, when counter stance is up?
 Shiva.Kolossuss
Offline
Serveur: Shiva
Game: FFXI
Posts: 107
By Shiva.Kolossuss 2012-10-31 12:14:25
Link | Citer | R
 
I've come to understand XML better through various tips/tricks given to me by friends, readying other XML/SC threads, reading over every good XML I can, and editing/playing around with my own job XML sheets. But Flippant's detailed explanation makes me look at certain aspects with a whole new clarity.

Thank you, Flippant, for taking the time to answer Terminus' questions in a way that few care to do. It's people like you that really help others understand things.

Bookmarking thread.
[+]
 Cerberus.Mindi
Offline
Serveur: Cerberus
Game: FFXI
user: Mindi
Posts: 602
By Cerberus.Mindi 2012-10-31 13:34:33
Link | Citer | R
 
is there a way to make SC write a line in chat to tell me where all my variables are at that moment?
 Bismarck.Kelhor
Administrator
Offline
Serveur: Bismarck
Game: FFXI
user: Rooks
Posts: 509
By Bismarck.Kelhor 2012-10-31 13:40:14
Link | Citer | R
 
Cerberus.Mindi said: »
is there a way to make SC write a line in chat to tell me where all my variables are at that moment?
Code
<addtochat color = "204">$VAR</addtochat>


Color can be whatever you like, obviously ;)
 Ragnarok.Sekundes
Offline
Serveur: Ragnarok
Game: FFXI
user: Sekundes
Posts: 4197
By Ragnarok.Sekundes 2012-10-31 13:43:22
Link | Citer | R
 
You can also simply type the $var in to the chat log and it'll resolve to it's current value(var being the name of whatever variable you are curious about, if your variable's name is TP then just type $TP and it'll do it). Useful for testing and just in case you want to do a quick check without changing any XML.
 Cerberus.Mindi
Offline
Serveur: Cerberus
Game: FFXI
user: Mindi
Posts: 602
By Cerberus.Mindi 2012-10-31 13:48:34
Link | Citer | R
 
ok thx^^ so i should name the variables something more... with names lol, atm i only have 0 and 1 lol
necroskull Necro Bump Detected! [381 days between previous and next post]
Offline
Posts: 233
By innit 2013-11-16 18:29:52
Link | Citer | R
 
Hello

I have this rule below, but it doesn't ever equip the TPHF or TPHFImp sets when hundred fists is up. Can anyone help please?
Code
<if Status="Engaged">
	<if BuffActive="Hundred Fists">
		<if BuffActive="Impetus">
			<action type="equip" when="engaged|aftercast" set="TPHFImp"/>
		</if>
		<else>
			<action type="equip" when="engaged|aftercast" set="TPHF"/>
		</else>
	</if>
	<else>
		<if BuffActive="Impetus">
			<action type="equip" when="engaged|aftercast" set="TPImp"/>
		</if>
		<else>
			<action type="equip" when="engaged|aftercast" set="TP"/>
		</else>
	</else>
</if>
<else>
	<action type="equip" when="idle|aftercast" set="IDLE"/>
</else>


Also this rule for hundred fists:
Code
<if spell="Hundred Fists">
	<equip when="precast">
		<legs>Melee hose +2</legs>
	</equip>
</if>