Ability List to ${melee1} or the like.

ACiDXiAN

Active Member
Hello, I am trying to get some issues resolved and am kind of at a roadblock or sorts.

What I am tryign to do is use somethign similiar to Kbots pull down to select abilities to use (aka melee is the example here). I have the load an save cofig working properly, the pull downs work and all is good howeve this is where I have a problem.

I cannot seem to get the config file which uses the anInter to save and load the names to I guess alias all the melee attacks to a ${melee1}, ${melee2} etc format. I am tryign to di this for a few reason, as it gives me a little more control over what attack sequence is mainly.

Now if i could get say melee1 to melee6 to work it woudl be great but using even kbot code and lookign throgh that it looks as if it uses one abilitity over and over without switching from it so it will go through the list once sort of and then endlessly use one abilty over and over until the mob is dead.

What the overa all wold be is:

Read config xml from MeleeAttacks, put then in a ${melee1, 2, etc} format, then call and loop the mele script which would be similiar to the loop melee in vgshaman.

Sorry if this sounds all confusing and i realize not many peopel still do stuff for VG, but thats why I am tryign to do this, I think I have exhausted all my option on the leanr your self and am just a little stuck.

Thank you.

PS Sorry for the typos and horrible spelling my arm brace makes it hard to type in any legible manner
 

Zandros

Script Author: VGA
I am not sure this is what you are looking for but may be of some use.

Code:
j:Set[0]
for (i:Set[1] ; ${i}<=${Me.Ability} ; i:Inc)
{
	if ${Me.Ability[${i}].IsOffensive} && ${Me.Ability[${i}].Type.Equal[Combat Art]}
	{
		j:Inc
		${Melee[j]}:Set${Me.Ability[${i}].Name}
	}
}
if ${j}>0
{
	for (i:Set[1] ; ${i}<=${j} ; i:Inc)
	{
		echo "Melee[${i}] = ${Melee[${i}]"
	}
}
else
{
	echo "No Melee abilities"
}
On the side note, this may sound wierd, did you ever thought about creating a variable that will track your progress of last know ability used within ${Melee[x]}?

Something like this:

Code:
;call DebugIt "D. Check to see if we have Melee attacks"

variable iterator anIter

setConfig.FindSet[MeleeAttacks]:GetSettingIterator[anIter]
anIter:First

if !${anIter:First(exists)}
	return FALSE

;get next anIter right after last ability used
for (i:Set[${anIter.Key}] ; ${i}<=${LastMeleeAttack} ; i:Inc)
{
	anIter:Next
}

while ( ${anIter.Key(exists)} )
{
	;call DebugIt "D. AttackSub ${anIter.Key}, rdy ${Me.Ability[${anIter.Key}].IsReady}"
	call CheckAbilCost "${anIter.Key}"
	if ${Return} && ${Me.Ability[${anIter.Key}].IsReady}
	{
		call DebugIt " -- D. Using Melee attack: ${Me.Ability[${anIter.Key}]}"
		Face ${Me.Target.X} ${Me.Target.Y}
		Me.Ability[${anIter.Key}]:Use
		attackUsed:Set[TRUE]
		LastAtackUsed:Set[${anIter.Key}]
		call MeCasting
		wait 3
		break
	}
	anIter:Next
}

;reset this back to 0 so that it could reloop to the 1st anIter
LastAttackUsed:Set[0]
Purely experimental and I hope it gives you an idea how to tackle your problem. Also, this is an idea and I have no idea if it will work or not.
 

ACiDXiAN

Active Member
I think the first example will do exactly what I was lookign for, probably not as fancy as some of the ideas initially for a 2 boxer follwoing malee/healer/whatever but the control over the melee attacks is what I was looking for and with some fiddling I think I can get it to work, once its done I will look at the second one and see if it willl be more efficient etc..

I will post any progress or potential hair pulling out symptoms here! :)


okay some progress, some *oh my maybe this isnt gonna work* thoughts.

Code:
/*
	Vanguard Abilities
*/

variable string OutputFile = ${Script.CurrentDirectory}/Abilities_${Me.FName}.xml
variable int i
variable int j

function main()
{
	echo [VGA] Finding and Exporting all abilities to Abilities_${Me.FName}.xml
	redirect "${OutputFile}" echo "function ConfiguredAbilities()"
	redirect -append "${OutputFile}" echo "{"
	{

/* Melee */
		j:Set[0]
		for (i:Set[1] ; ${i}<=${Me.Ability} ; i:Inc)
		{
			if ${Me.Ability[${i}].IsOffensive} && ${Me.Ability[${i}].Type.Equal[Combat Art]}
			{
				j:Inc
				redirect -append "${OutputFile}" echo Melee[${j}]:Set["${Me.Ability[${i}].Name}"]
			}
		}
		
		if ${j}>0
		{
			for (i:Set[1] ; ${i}<=${j} ; i:Inc)
			{
				echo "Melee[${i}] = ${Melee[${i}]"
			}
		}
		
		else
		{
			echo "No abilities found..."
		}
		
		redirect -append "${OutputFile}" echo "}"
		
	}	

}
output looks like this:

Code:
function ConfiguredAbilities()
{
Melee[1]:Set["Auto Attack"]
Melee[2]:Set["Strike of Skamadiz I"]
Melee[3]:Set["Hammer of Krigus I"]
Melee[4]:Set["Hammer of Krigus II"]
Melee[5]:Set["Hammer of Krigus III"]
Melee[6]:Set["Hammer of Krigus IV"]
Melee[7]:Set["Bite of Nag-Suul I"]
Melee[8]:Set["Sundering Claw I"]
Melee[9]:Set["Gnashing Bite I"]
Melee[10]:Set["Bite of Nag-Suul II"]
Melee[11]:Set["Bite of Nag-Suul III"]
Melee[12]:Set["Gnashing Bite II"]
Melee[13]:Set["Strike of Skamadiz II"]
Melee[14]:Set["Strike of Skamadiz III"]
Melee[15]:Set["Strike of Skamadiz IV"]
Melee[16]:Set["Strike of Skamadiz V"]
Melee[17]:Set["Sundering Claw II"]
Melee[18]:Set["Sundering Claw III"]
Melee[19]:Set["Fist of the Earth I"]
Melee[20]:Set["Fist of the Earth II"]
Melee[21]:Set["Fist of the Earth III"]
Melee[22]:Set["Fist of the Earth IV"]
}
Okay got it working as I would like, had to adjust a few things that were missing, now I can get all the other stuff in. Coupel of questions though, if you run it you will see it outputs NULLMelee to the console yet the xml output is as you see, fine. The second issue I have is how do I get only the highest spell/melee to be listed. I know they have levels on them now at what level you get them would this be possible to do or am I goignt o have to have a bunch of extra stuff calculating everything.

I am thinking somehtign with : int LevelGranted woudl be the key but to be honest I am a little lost on what exaclty I am goign to do to look. It seems most spells are within 6 levels of each other for upgrades so for exampl Blade of winter I is level 2, verion II is 8, 3 is 14 etc.. any clues on how this coudl be handled perhaps?
Thank you Zandross for the help I appreciate it and look forward to possibly getting some more stuf workign for VG, it does seem to be growing population wise a little.
 
Last edited:
Top Bottom