Basic Refining/Finishing (for scripters)

Amadeus

The Maestro
Staff member
This is a very basic "run down" on how isxvg handles the area of crafting known as refining and finishing. This is early in the development of ISXVG, so I cannot say how/if any of this might change as time goes on; however, I can say that there will be more things added to it.

Before I begin, please note that this does not include "Assembly" recipes, that will be addressed at a later time. Also, the crafting system in Vanguard is fairly complex, so if you try scripting it and/or using a crafting script before you've gotten a few levels and finished all the in game 'tutorials' on crafting/assembly, then you will never understand what's going on.


I. Terminology
  1. Recipe = What you're crafting
  2. Refining = the process of refining or finishing
  3. Assembly = the process of assembly
  4. Stage = The stage in which you are currently in while crafting. There are typically 4 stages per recipe.
  5. Section = Same as 'Stage'
  6. Step = The 'steps' used while crafting to move to the next 'Stage'. There are typically 5+ steps in a recipe.
  7. Action = The actual action taken that is taken when you select the appropriate 'Step' and are then prompted with the 'Action' choices.
  8. Complication = The negative reaction that sometimes occurs while crafting. It is typically accompanied by one more 'Corrections' that can be used to fix the problem.
  9. Correction = Actions that can be taken to rectify a particular 'Complication'
II. Events
Right now there is one event that should fire after each 'action' is completed during crafting. It is up to the scripter to 'hook' into that event and find out what information is useful to him/her.
VG_onCraftingAlert(string Text, string AlertID)

III. Recipes
Recipe information can be accessed via the 'Recipe' TLO. It is important to note that ONLY the recipe ID and the recipe name are available to you until you "set" a recipe while at a crafting station. So, if you need the rest of the information, you'll need to go to a crafting station, target it, 'begin' the refining process, then 'set' the recipe ...then cancel everything out. Then, you'll have all of the datatype members available to you.

IV. Refining

Here is a sample 'flow chart' of how one might script the automation of crafting a "Chipped Balsalt Wedges" work order recipe. You can be a lot more fancy about checking 'availableactions' and so forth and choose what you think is best. But, for this example, I'm just going to go the quickest way possible and choose the first available action in each step.
  1. Target Crafting Station
  2. Refining:Begin
  3. Refining:SetRecipe[${Recipe[Refining,"Cart Wheel"].ID}]
  4. Refining:DoSetup
  5. Refining:Start
  6. Check ${Refining.Stage.StepCount} and see how many steps are available for this 'Stage' of the recipe. Usually a recipe will have 2 steps for at least one of the stages in the recipe.
  7. If there is just one step available (or if you want to use the first one) then you would check to see how many actions are available to be used with that 'Step' using ${Refining.Stage.Step[1].AvailActionsCount}.
  8. The first 'Stage' of this recipe has 1 'Step' and that 'Step' has 2 'Actions' associated with it. Those can be accessed via ${Refining.Stage.Step[1].AvailAction[1]} and ${Refining.Stage.Step[1].AvailAction[2]}. Since I am using the supplies given to me by the taskmaster, I will use the 1st action with this command: Refining.Stage.Step[1].AvailAction[1]:Use
  9. Check your event hook ...it should tell you if your action was a success and/or if the recipe is complete. If it was a success, you should check to see if the recipe has changed "Stages" using ${Refining.Stage.Index}. If the recipe is complete, then you would do something like "Loot:LootAll" to accept the final product from the 'loot' window. After each 'Step' (ie, event hook response) you would also want to check for complications ..which I will outline below in step #11.
  10. If you've changed stages, then you'd just repeat back to Step #6.
  11. Another thing you would want to check every 'turn' of the crafting process is whether or not there are any 'Complications'. To do this, you would check ${Refining.ComplicationsCount}. If that's greater than zero, then you would want to check ${Refining.CorrectionsCount} to see how many corrections are available to you (and their names and stats, etc) and then see how many actions are available to use for that correction with ${Refining.Correction[#].AvailActionsCount}. Then, you could use the action you wish with Refining.Correction[#].AvailAction[#]:Use
  12. Finally, some other Members and Methods that might be useful:
  • ${Refining.ActionPointsUsed}
  • ${Refining.OrigActionPointsAvail}
  • ${Refining.CurrentRecipe.ProgressBarPct} -- This is the percent complete for the current STAGE. This is useful information for determining which action you want to use (ie, the action that builds Quality or the action that progresses your progress bar.)
  • ${Refining.Quality} -- this is a number between 0 and 1000. Each 250 points increases your letter grade from D to A)
  • Refining:Cancel
  • Refining:End

Again, this is just a very basic walkthrough and does not use any of the fancy features that isxvg can provide to the creative scripter. I just wanted to do a quick 'walkthrough' so that the advanced scripters out there had an idea of how everything fits together. I think if you look through this posting as well as look carefully through the patch notes/wiki in regards to the datatypes related to crafting, it will make complete sense and you should be able to create some pretty intelligent crafting scripts.
 

Amadeus

The Maestro
Staff member
I also want to point out that you can get information about all of the "steps" in a refining recipe at the beginning of the process if that affects how the logic of your script would work.

For example, once you've set the recipe at the crafting station, you would be able to check ${Refining.CurrentRecipe.StepCount} and then iterate through them using ${Refining.CurrentRecipe.Step[#]}. Doing that you could see all 5 of the steps available for "Cart Wheel" at the beginning and even iterate through all of the available actions for each step as well using ${Refining.CurrentRecipe.Step[#].AvailActionsCount} and ${Refining.CurrentRecipe.Step[#].AvailAction[#]}
 

Amadeus

The Maestro
Staff member
Update. Initial posting works for version 20070120c and later.

Also, I wanted to point out that you can almost go completely through a recipe using something like:
'Refining.Stage.Step[1].AvailAction[1]:Use' if you're in a hurry ...lol

And then just 'Refining.Correction[1].AvailAction[1]:Use' when you hit a complication ..haha.

Crude...but you could probably come up with about 4 or 5 hotkeys using things I put in my initial "walkthrough" that would make crafting trivial without even using a bot!



ALSO, while I'm here ..I should point out that I have not, as yet, put in the code dealing with the "items" required by "Corrections" ...so, you'll have to wait for that. For now, just make sure you have a few stacks of everything on you, and you should be fine :)
 
Top Bottom