Path creation and editing question

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Path creation and editing question

#1 Post by kanta » Thu Dec 22, 2011 2:59 pm

Ok, so createpath is a great tool for making a waypoint file. I've made many of them. What I'm wondering is if some sort of utility can be made that will run a bot through this new waypoint file step by step. At each step making it possible to adjust the coordinates of the current waypoint with a key press.

Example:
Someone has made a goblin mine waypoint. For some reason the height of the fly path ends up being too high to make it under some door frames/corridor supports. With this proposed utility, the person could go through the waypoint file (like during the createpath run), press keypad 1 to go to the next point in the path until the problem point is reached. Once the point that needs adjustment is reached, they can move to a new position, press keypad 2 and the problem point is now replaced with the new coordinates.

If I had the coding knowhow I would do this myself, but all I can do is come up with ideas.

**EDIT**
Possibly even have an option to insert new points between the current and previous points.
Scout/Knight/Rogue 70/66/66

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Path creation and editing question

#2 Post by lisa » Thu Dec 22, 2011 8:55 pm

It is deffinately possible, I can say that for sure.

I generally just edit the WP manually, if height is to high then I reduce the Y value, if I want to add in another waypoint then I just add it in.

If you were looking at doing it yourself I'll get you started.

to read the WP information such as coords and code and such you need the _filename and then do this.

Code: Select all

	local root = xml.open(getExecutionPath() .. "/waypoints/".._filename..".xml");
	local elements = root:getElements();
	for i,v in pairs(elements) do
So within the elements table you are looking at this for the code at a waypoint

Code: Select all

local action = v:getValue();
for the coords you need this

Code: Select all

local x,z,y = v:getAttribute("x"), v:getAttribute("z"), v:getAttribute("y");
So you could do this as a test

Code: Select all

for i,v in pairs(elements) do
local action = v:getValue();
local x,z,y = v:getAttribute("x"), v:getAttribute("z"), v:getAttribute("y");
if action then print(action) end
print("X = "..x..", Z = "..z..", Y = "..y)
end
So that will print any code for the waypoint and the coords.

Well you get the idea anyway.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Path creation and editing question

#3 Post by kanta » Thu Dec 22, 2011 10:53 pm

O... M... G... I so wish I had your coding talent Lisa. The problem is that you have more ability in the *tip* of your little finger than I ever will. I think this is the point at which I begin kowtowing and chanting "I'm not worthy!" :oops:

All I can do is stare at your response and blink a lot. :?
Scout/Knight/Rogue 70/66/66

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: Path creation and editing question

#4 Post by lisa » Thu Dec 22, 2011 11:58 pm

Actually I just read that from the waypoint code, want to see example of my idea of coding =)

Code: Select all


function convertWPtodatabase(_filename, _table)
	if _table == nil then _table = true end
	if _filename == nil then print("Need to assign WP name.") end
	local root = xml.open(getExecutionPath() .. "/waypoints/".._filename..".xml");
	local elements = root:getElements();
	
	
	filename = getExecutionPath() .. "/database/".._filename..".xml";
	file, err = io.open(filename, "w+");
	if _table == true then
		file:write(_filename.." = {\n")
	else
		file:write("<".._filename..">\n")
	end
	local stopnow = 0
	
	for i,v in pairs(elements) do
		local connum = 1
		local linked = false
		local connections
		local _conn = false
		local _stop = false
		local action = v:getValue();
		local x,z,y = v:getAttribute("x"), v:getAttribute("z"), v:getAttribute("y");
		
		if _table == true then
			file:write("\t["..(i).."]={ X="..x.." , Z="..z..", Y="..y..", Links={")
		else
			file:write("\t<Point Num="..i.." X=\""..x.."\" Z=\""..z.."\" Y=\""..y.."\" >\n")
		end
		if i  ~= (stopnow + 1) then
			if _table == true then
				file:write("["..connum.."]={Num="..(i-1).."},")
				connum = connum + 1
			else
				file:write("\t\t<Link Num="..(i-1).."> </Link>\n")
			end
		end
		if action ~= nil then 
			if string.find(action, "add") then
				_conn = true
			end
			if string.find(action, "stop") then
				_stop = true
				stopnow = i
			end			
		end			
		
		if _stop ~= true then
			if _table == true then
				file:write("["..connum.."]={Num="..(i+1).."},")
				connum = connum + 1
			else
				file:write("\t\t<Link Num="..(i+1).."> </Link>\n")
			end
		end
	
		if _conn == true then
			for t,d in pairs(elements) do
				local action2 = d:getValue();
				if t ~= i and action2 == action then
					if _table == true then
						file:write("["..connum.."]=Num="..t.."},")
						connum = connum + 1
					else
						file:write("\t\t<Link Num="..t.."> </Link>\n")
						linked = true
					end
				end
				
			end
			if linked == false and _table ~= true then
				file:write("\t\t<Link Num=\"TBA "..action.."\"> </Link>\n")
			end
		end		
		if _table == true then
			file:write("}},\n")
		else
			file:write("\t</Point>\n\n")
		end
	end	
	if _table == true then
		file:write("}")
	else
		file:write("</".._filename..">\n")
	end
	file:close()	
end	
I use that to convert existing WP into a databse type file of the coords from the WP.


As to the task at hand, basically you would want to rewrite the file using new data that you input with your key presses.
At the end of the day I see that as being more work then just editing the WP manually.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Path creation and editing question

#5 Post by rock5 » Fri Dec 23, 2011 3:00 am

I usually load a file into excel and create a scatter chart to visualise the path so I can pick the right point to edit. You have to be a bit excel savy to do it though.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Path creation and editing question

#6 Post by kanta » Fri Dec 23, 2011 3:41 am

I've never used Excel in my life. :oops:

Anywhere you can point me for a tutorial or something?
Scout/Knight/Rogue 70/66/66

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: Path creation and editing question

#7 Post by rock5 » Fri Dec 23, 2011 1:16 pm

I'm tempted to do a vid myself but have never done one before. Not sure how to go about it.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

kanta
Posts: 424
Joined: Thu Nov 11, 2010 4:08 pm

Re: Path creation and editing question

#8 Post by kanta » Fri Dec 23, 2011 6:51 pm

The easiest way I can think of is FRAPS. Either that or Camtasia Studio.
Scout/Knight/Rogue 70/66/66

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests