Aetolia Project AI

Kennai
Posts: 9
Joined: Sat Jan 30, 2010 6:11 am

Aetolia Project AI

Post by Kennai »

My character on Aetolia's name is Xiuhcoatl, and I'm looking to be the next PK king. Right now I'm running off a decent system, that I'm going to refine as time goes on to deal with all the different styles of curing. I'm relying upon a table to keep tracking afflictions, but I was wondering if there was a better way to keep track of arrays based on the names of the variables instead of the numbers they are in. I'd also like to know if there was a way to time something based on trigger input, like when someone cures two afflictions, I want a time returned of how long it's been since I afflicted them and how long it took for them to cure both of them. Anyone knowing basic AI information would be nice too.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Aetolia Project AI

Post by Vadi »

You can use stopwatches for seeing how much time elapsed since and event. That should help with watching the curing part.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Aetolia Project AI

Post by Heiko »

Mudlet also has a function that tells you the current network lag. As Mudlet's network lag analysis is fairly good (it's not just simply measuring the round trip time, but takes package size and command history into account also), it may be a way to implement timers that take your lag into account. Ramiel was keen on getting this back in the early stages of Mudlet because his lag was fairly high due to being located on the other side of the globe. Ramiel's claim to fame among other things (he also made the first windows installer) is that he built the first complete healing system with Mudlet and recorded the first official Mudlet PvP victory :) when Mudlet was still in early alpha stages.
If you want to develop a fighting system for Aetolia, I'd get into contact with Caled.

Kennai
Posts: 9
Joined: Sat Jan 30, 2010 6:11 am

Re: Aetolia Project AI

Post by Kennai »

I've read over the manual again and I've decided to start using databases to hold things such as players, and the like and I'm getting an error.
local aetolians = db:create ("living_and_undead",
{
living={
name= "",
guild="",
city="",
order ="",
race="",
statpack=""
}
},
{
undead= {
name="",
guild="",
city="",
order="",
race="",
statpack=""
}
}
)
And I am getting the error

Lua syntax error:{string "local aetolians = db:create ('living_and_un..."}:1:attempt to index global'db' (a nil value)

I've tried filling in the values, as that would return a non-null value, and a direct/paste from the manual seemed to get the same problem. Have they been phased out and should I switch over to a different form or what?

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Aetolia Project AI

Post by Vadi »

The DB package is meant to provide easier access to a database, so you don’t have to know SQL or use the luasql module to set and get at your data. However, it does require that the luasql module be compiled and included in Mudlet to function - and this all is available since Mudlet 1.0.6.
Chances are you don't have it yet. You can get it by trying out a pre-release of 1.0.6, but be warned that it's not released yet due to the known issues it contains.

User avatar
Alexander Divine
Posts: 65
Joined: Mon Dec 21, 2009 7:01 pm

Re: Aetolia Project AI

Post by Alexander Divine »

I've been learning a lot about file operations. You oughta look up io.output, etc., and just use those to keep a list of Aetolians in a text file or something.

Kennai
Posts: 9
Joined: Sat Jan 30, 2010 6:11 am

Re: Aetolia Project AI

Post by Kennai »

Little bit of a necro, but with the new mudlet I was trying to do an optimization to my curing. I have this for healing salves, I was wondering if there was anything I'm getting wrong or could optimize in it.
Edit: Fixed it so it worked, anything that would be nice would be nice.
function Salve()
local salvingCures = {
["broken arm"] = "apply mending to arms",
["broken leg"] = "apply mending to legs",
["mangled left leg"] = "apply restoration to left leg",
["mangled right leg"] = "apply restoration to right leg",
["mangled left arm"] = "apply restoration to left arm",
["mangled right arm"] = "apply restoration to right arm",
["mangled head"] = "apply restoration to head",
["mangled torso"] = "apply restoration to torso",
["broken left leg"] = "apply restoration to left leg",
["broken right leg"] = "apply restoration to right leg",
["broken left arm"] = "apply restoration to left arm",
["broken right arm"] = "apply restoration to right arm",
["broken head"] = "apply restoration to head",
["broken torso"] = "apply restoration to torso",
["crippled left leg"] = "apply mending to left leg",
["crippled right leg"] = "apply mending to right leg",
["crippled left arm"] = "apply mending to left arm",
["crippled right arm"] = "apply mending to right arm",
["crippled arm"] = "apply mending to arms",
["crippled leg"] = "apply mending to legs",
["burning"] = "apply mending",
["anorexia"] = "apply epidermal to torso",
["no caloric"] = "apply caloric",
["shivering"] = "apply caloric",
["frozen"] = "apply caloric",
["indifference"] = "apply epidermal to head",
["damaged left leg"] = "apply restoration to left leg",
["damaged right leg"] = "apply restoration to right leg",
["damaged left arm"] = "apply restoration to left arm",
["damaged right arm"] = "apply restoration to right arm",
["damaged head"] = "apply restoration to head",
["damaged torso"] = "apply restoration to torso",
["shriveled throat"] = "apply mending to head",
["selarnia"] = "apply mending",
["ablaze"] = "apply mending"
}
local salvingPriorities = {
"indifference",
"mangled head",
"anorexia",
"mangled left leg",
"mangled right leg",
"broken left leg",
"crippled left leg",
"broken right leg",
"crippled right leg",
"damaged left leg",
"damaged right leg",
"mangled left arm",
"mangled right arm",
"mangled torso",
"damaged head",
"damaged torso",
"damaged left arm",
"damaged right arm",
"broken left arm",
"crippled left arm",
"broken right arm",
"crippled right arm",
"broken arm",
"crippled arm",
"broken head",
"broken torso",
"frozen",
"no caloric",
"shivering",
"burning",
"ablaze",
"selarnia",
}
local affliction=afflictionlist
if SalveBalance and not affliction["slickness"] then
for _, aff in ipairs (salvingPriorities) do
if affliction[aff] and canSalve then
send(salvingCures[aff])
if affliction["stupidity"] then
send(salvingCures[aff])
end
canSalve=false
tempTimer( 1.2, [[canSalve = true]] )
end
end
end
end

SirKickz
Posts: 2
Joined: Sun Mar 21, 2010 7:57 am

Re: Aetolia Project AI

Post by SirKickz »

I've been trying to code my system using a database that would hold the afflictions and match them up with their cures, but the database system for mudlet has been really fighting against me.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Aetolia Project AI

Post by Vadi »

I wouldn't do that. We use a real database here in Mudlet.

User avatar
Vadi
Posts: 5050
Joined: Sat Mar 14, 2009 3:13 pm

Re: Aetolia Project AI

Post by Vadi »

By a real database, I mean that while the "db" layer shields you from knowing SQL syntax and database theory, you do not want to be accessing the database every single time, but use it as little as possible. More specifically, write to it as little as possible and in batches if you can, reading isn't bad because data is cached so reading same data later won't require waiting for the hd.

Post Reply