Forums » Community Projects
Seeking tutor for writing plugin
Hello VO folks,
I have an idea for a plugin that I want to make myself, but I have no experience whatsoever in writing plugins - or any programming experience for that matter... I think that with a little help from the community I could learn enough to make the plugin that I want. Here's the plugin idea:
AAToggle
-Toggles Auto-Aim within a set distance from the target (distance can be set by user, default set to 300m)
-Function to toggle on/off AAToggle for while not in combat
If anyone could help me with this project I would really appreciate it. Ideally we could skype and make it together so I could learn from word-of-mouth about making plugins. I imagine that this specific plugin wouldn't be too hard to write so I think it is a good one to make for a beginner.
PM me in game or respond here on the forums. Safe flights and long nights!
-[TRI]Neon Black
Lieutenant, Trident Arms Syndicate
I have an idea for a plugin that I want to make myself, but I have no experience whatsoever in writing plugins - or any programming experience for that matter... I think that with a little help from the community I could learn enough to make the plugin that I want. Here's the plugin idea:
AAToggle
-Toggles Auto-Aim within a set distance from the target (distance can be set by user, default set to 300m)
-Function to toggle on/off AAToggle for while not in combat
If anyone could help me with this project I would really appreciate it. Ideally we could skype and make it together so I could learn from word-of-mouth about making plugins. I imagine that this specific plugin wouldn't be too hard to write so I think it is a good one to make for a beginner.
PM me in game or respond here on the forums. Safe flights and long nights!
-[TRI]Neon Black
Lieutenant, Trident Arms Syndicate
Lua 5.1 Reference Manual
Lua Tutorials
VO API Reference
GetTargetDistance()
Game.GetCVar("autoaim")
Game.SetCVar("autoaim", ("1"|"0"))
Timer()
Lua Tutorials
VO API Reference
GetTargetDistance()
Game.GetCVar("autoaim")
Game.SetCVar("autoaim", ("1"|"0"))
Timer()
Or, you could just use the plugin that already exists that does this. Not sure where it is or what it's called, but it definitely exists.
Best way to learn how to design plugins is just jump straight in there, read the API, and have a little knowledge of how C works.
Several people have said that same thing "just jump right in" and with the links draugath posted I certainly have a good place to start.
Thanks!
Thanks!
I've used a plugin that does this in the past, but I don't currently have it. In my experience, it's a bit like having automatic versus manual transmission in a car.
Drazed wrote one a long time ago that does what you're looking to do. I think it's called ToggleFire, but I can't find a copy of it.
Oh you mean this.
declare("scatterfire",{})
scatterfire.update = {}
scatterfire.on = {}
scatterfire.off = {}
scatterfire.state = 0
scatterfire.run = 0
scatterfire.value = 0
scatterfire.lower = gkini.ReadInt("scatterfire", "lower", "150")
scatterfire.upper = gkini.ReadInt("scatterfire", "upper", "400")
scatterfire.timer = Timer()
function scatterfire.update()
if scatterfire.run == 1 then
if scatterfire.state == 1 then
local mydistance = GetTargetDistance()
if mydistance == nil then mydistance = 0 end
if (scatterfire.value == 0 and scatterfire.upper > mydistance) or mydistance < scatterfire.lower then
gkinterface.GKProcessCommand("set autoaim 1")
scatterfire.value = 1
else
gkinterface.GKProcessCommand("set autoaim 0")
scatterfire.value = 0
end
end
scatterfire.timer:SetTimeout(200, function() scatterfire.update() end)
end
end
function scatterfire.on:OnEvent(eventname, ...)
scatterfire.state = 1
end
function scatterfire.off:OnEvent(eventname, ...)
scatterfire.state = 0
end
function scatterfire.toggle(data, args)
if args then
if tonumber(args[1]) ~= nil then
scatterfire.lower = tonumber(args[1])
end
if tonumber(args[2]) ~= nil then
scatterfire.upper = tonumber(args[2])
end
print("\127FFFFFFAA on below: "..scatterfire.lower.."\nAA off above: "..scatterfire.upper.."\127o")
else
if scatterfire.run == 0 then
scatterfire.state = 1
scatterfire.run = 1
scatterfire.update()
print("scatter on")
else
scatterfire.state = 0
scatterfire.run = 0
print("scatter off")
end
end
gkini.WriteInt("scatterfire", "lower", scatterfire.lower)
gkini.WriteInt("scatterfire", "upper", scatterfire.upper)
end
RegisterUserCommand("scatter", scatterfire.toggle)
RegisterEvent(scatterfire.on, "LEAVING_STATION")
RegisterEvent(scatterfire.off, "ENTERING_STATION")
Yeah, I have all of the plugins. While this might give you an excellent idea of how to make it, its pretty crap in combat which is why I don't care if everyone has it.
declare("scatterfire",{})
scatterfire.update = {}
scatterfire.on = {}
scatterfire.off = {}
scatterfire.state = 0
scatterfire.run = 0
scatterfire.value = 0
scatterfire.lower = gkini.ReadInt("scatterfire", "lower", "150")
scatterfire.upper = gkini.ReadInt("scatterfire", "upper", "400")
scatterfire.timer = Timer()
function scatterfire.update()
if scatterfire.run == 1 then
if scatterfire.state == 1 then
local mydistance = GetTargetDistance()
if mydistance == nil then mydistance = 0 end
if (scatterfire.value == 0 and scatterfire.upper > mydistance) or mydistance < scatterfire.lower then
gkinterface.GKProcessCommand("set autoaim 1")
scatterfire.value = 1
else
gkinterface.GKProcessCommand("set autoaim 0")
scatterfire.value = 0
end
end
scatterfire.timer:SetTimeout(200, function() scatterfire.update() end)
end
end
function scatterfire.on:OnEvent(eventname, ...)
scatterfire.state = 1
end
function scatterfire.off:OnEvent(eventname, ...)
scatterfire.state = 0
end
function scatterfire.toggle(data, args)
if args then
if tonumber(args[1]) ~= nil then
scatterfire.lower = tonumber(args[1])
end
if tonumber(args[2]) ~= nil then
scatterfire.upper = tonumber(args[2])
end
print("\127FFFFFFAA on below: "..scatterfire.lower.."\nAA off above: "..scatterfire.upper.."\127o")
else
if scatterfire.run == 0 then
scatterfire.state = 1
scatterfire.run = 1
scatterfire.update()
print("scatter on")
else
scatterfire.state = 0
scatterfire.run = 0
print("scatter off")
end
end
gkini.WriteInt("scatterfire", "lower", scatterfire.lower)
gkini.WriteInt("scatterfire", "upper", scatterfire.upper)
end
RegisterUserCommand("scatter", scatterfire.toggle)
RegisterEvent(scatterfire.on, "LEAVING_STATION")
RegisterEvent(scatterfire.off, "ENTERING_STATION")
Yeah, I have all of the plugins. While this might give you an excellent idea of how to make it, its pretty crap in combat which is why I don't care if everyone has it.
Thanks TRS,
This is pretty much what I was looking for, although the constant AA toggle notification is beyond annoying, and I'm confused about the mid-range alternating de/activation - it seems unnecessary to me. What parameters do I need to change to alter the distance for AA-toggle? And, is is possible to prevent the plugin from raping my chat-window with de/activation messages?
Appreciative of all the help,
-Neon Black
This is pretty much what I was looking for, although the constant AA toggle notification is beyond annoying, and I'm confused about the mid-range alternating de/activation - it seems unnecessary to me. What parameters do I need to change to alter the distance for AA-toggle? And, is is possible to prevent the plugin from raping my chat-window with de/activation messages?
Appreciative of all the help,
-Neon Black
Comment out some lines and see what happens.