For those that havent seen the ISX solution to pathfiles this should be something to envy
It works some thing like this..
You add a node (x,y,z) with a unique name and connect it to another named node, you keep doing this until you have the whole zone covered in a spiderweb of paths and named nodes (ie banker1,vendor, smith etc) then when you wish to go somewhere you simply ask innerspace nicely
NavPath zone banker1 vendor
and innerspace hands you the shortest path from banker1 to vendor in a array containing the connected nodes.
Having a xml with all the quest npc's / tradeskill containers / bankers / vendors makes the task of moving and doing multiple tradeskills way easy.
this code should be considered alpha atm Ill rework it in the morning if someone actually downloads it
*Edit*
Added SelectNearestPoint and Move/Rename
Fixed Saving of maps and *lots* of bugs.
Added point update when zoning(no need to reload after zoning)
test.iss in your Scripts folder
Code: Select all
; test.iss (filename DOES matter)
Function main()
{
declare World string global "${Zone.Name}"
declare LastPoint string global
declare SelectedPoint string global
Navigation -reset
Navigation -load "Scripts/eq/test/${World}.xml"
ui -load "Scripts/eq/test/test_ui.xml"
AddTrigger Zoned "You have entered @*@."
call UpdatePointList
do
{
ExecuteQueued
waitframe
}
while 1
}
function atexit()
{
keypress forward
ui -unload "Scripts/eq/test/test_ui.xml"
}
function AddPoint()
{
if (${Navigation.World["${World}"].LastID}<1)
{
NavPoint -set "${World}" Path_1 ${Me.X} ${Me.Y} ${Me.Z}
LastPoint:Set["${Navigation.World["${World}"].Point[${Navigation.World["${World}"].LastID}].Name}"]
UIElement[TestListBox@Movement@Test Path tabbs@Test Path]:AddItem["${Navigation.World["${World}"].Point[${Navigation.World["${World}"].LastID}].Name}"]
}
else
{
NavPoint -set "${World}" Path_${Math.Calc[${Navigation.World["${World}"].LastID}+1].Int} ${Me.X} ${Me.Y} ${Me.Z}
NavPoint -connect -bidirectional "${World}" "${LastPoint}" "${Navigation.World["${World}"].Point[${Navigation.World["${World}"].LastID}].Name}"
LastPoint:Set["${Navigation.World["${World}"].Point[${Navigation.World["${World}"].LastID}].Name}"]
UIElement[TestListBox@Movement@Test Path tabbs@Test Path]:AddItem["${Navigation.World["${World}"].Point[${Navigation.World["${World}"].LastID}].Name}"]
}
}
function AddNamedPoint()
{
InputBox "Enter the name of this point"
if (${Navigation.World["${World}"].LastID}<1)
{
NavPoint -set "${World}" "${UserInput}" ${Me.X} ${Me.Y} ${Me.Z}
UIElement[TestListBox@Movement@Test Path tabbs@Test Path]:AddItem["${Navigation.World["${World}"].Point[${Navigation.World["${World}"].LastID}].Name}"]
}
else
{
NavPoint -set "${World}" "${UserInput}" ${Me.X} ${Me.Y} ${Me.Z}
NavPoint -connect -bidirectional "${World}" "${LastPoint}" "${Navigation.World["${World}"].Point[${Navigation.World["${World}"].LastID}].Name}"
LastPoint:Set["${Navigation.World["${World}"].Point[${Navigation.World["${World}"].LastID}].Name}"]
UIElement[TestListBox@Movement@Test Path tabbs@Test Path]:AddItem["${Navigation.World["${World}"].Point[${Navigation.World["${World}"].LastID}].Name}"]
}
}
function FindNearestPoint()
{
messagebox -yesno "Set this as lastpoint? Name:${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}]} Dist:${Math.Distance[${Me.X},${Me.Y},${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}].X},${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}].Y}]}"
if ${UserInput.Equal["Yes"]}
{
LastPoint:Set["${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}]}"]
echo "${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}]} set as lastpoint."
}
return
}
function ConnectNearestPoint()
{
messagebox -yesno "Connect the lastpoint,${LastPoint} to ${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}]}?"
if ${UserInput.Equal["Yes"]}
{
navpoint -connect -bidirectional "${World}" "${LastPoint}" "${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}]}"
echo "${LastPoint} is now connected to ${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}]}"
}
}
function SaveMap()
{
Navigation.World["${World}"]:Export["${Script.CurrentDirectory}/eq/test/${World}.xml"]
}
function MovePoint()
{
messagebox -yesno "Do you wish to move ${SelectedPoint} to your coords a move of ${Math.Calc[${Me.X},${Me.Y},${Navigation.World["${World}"].Point[${SelectedPoint}].X},${Navigation.World["${World}"].Point[${SelectedPoint}].Y}]} units?"
if ${UserInput.Equal["Yes"]}
{
Navigation.World[${World}].Point["${SelectedPoint}"]:SetPosition[${Me.X},${Me.Y},${Me.Z}]
}
}
function RenamePoint()
{
InputBox "New Name?" "${SelectedPoint}"
Navigation.World["${World}"].Point["${SelectedPoint}"]:Rename["${UserInput}"]
call UpdatePointList
SelectedPoint:Set["${UserInput}"]
}
function GotoPoint(string EndPoint)
{
NavPath -reset
NavPath "${World}" "${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}]}" "${EndPoint}"
if ${NavPath.Points}>0
{
declare PathIndex int local 1
do
{
do
{
face nolook fast loc ${NavPath.Point[${PathIndex}].Y},${NavPath.Point[${PathIndex}].X}
waitframe
keypress forward hold
}
while ${Math.Distance[${Me.X},${Me.Y},${NavPath.Point[${PathIndex}].X},${NavPath.Point[${PathIndex}].Y}]}>6
PathIndex:Inc
}
while ${PathIndex}<=${NavPath.Points}
keypress forward
}
else
{
popuptext "Invalid path"
return
}
popuptext "Arrived"
return
}
function UpdatePointList()
{
UIElement[TestListBox@Movement@Test Path tabbs@Test Path]:ClearItems
declare Count int local 0
while (${Count:Inc} <= ${Navigation.World[${World}].Points})
{
UIElement[TestListBox@Movement@Test Path tabbs@Test Path]:AddItem[${Navigation.World[${World}].Point[${Count}].Name}]
}
}
function Zoned(string FullLine)
{
messagebox -yesno "Do you wish to save ${World} before loading the new Coords?"
if ${UserInput.Equal["Yes"]}
{
call SaveMap
}
World:Set["${Zone.Name}"]
call UpdatePointList
}
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<ISUI>
<Window name='Test Path'>
<Visible>1</Visible>
<X>300</X>
<Y>200</Y>
<Width>150</Width>
<Height>250</Height>
<Children>
<TabControl name='Test Path tabbs' >
<TabBorder>0</TabBorder>
<TabHeight>12</TabHeight>
<FrameBorder>10</FrameBorder>
<X>0</X>
<Y>0</Y>
<Width>100%</Width>
<Height>100%</Height>
<Tabs>
<Tab name='Creation'>
<commandbutton name='Add Point'>
<X>10</X>
<Y>5</Y>
<Width>130</Width>
<Height>20</Height>
<Text>Add Point</Text>
<Command>Script[test]:QueueCommand[Call AddPoint]</Command>
</commandbutton>
<commandbutton name='Add Named Point'>
<X>10</X>
<Y>30</Y>
<Width>130</Width>
<Height>20</Height>
<Text>Add Named Point</Text>
<Command>Script[test]:QueueCommand[Call AddNamedPoint]</Command>
</commandbutton>
<commandbutton name='Set last point'>
<X>10</X>
<Y>55</Y>
<Width>130</Width>
<Height>20</Height>
<Text>set last point</Text>
<Command>Script[test]:QueueCommand[Call FindNearestPoint]</Command>
</commandbutton>
<commandbutton name='connect to nearest point'>
<X>10</X>
<Y>80</Y>
<Width>130</Width>
<Height>20</Height>
<Text>conn2nearest point</Text>
<Command>Script[test]:QueueCommand[Call ConnectNearestPoint]</Command>
</commandbutton>
<commandbutton name='Select nearest point'>
<X>10</X>
<Y>105</Y>
<Width>130</Width>
<Height>20</Height>
<Text>Select nearest point</Text>
<OnLeftClick>
SelectedPoint:Set[${Navigation.World["${World}"].NearestPoint[${Me.X},${Me.Y},${Me.Z}]}]
echo "${SelectedPoint} selected and it's ${Math.Calc[${Me.X},${Me.Y},${Navigation.World["${World}"].Point[${SelectedPoint}].X},${Navigation.World["${World}"].Point[${SelectedPoint}].Y}]} units away."
</OnLeftClick>
</commandbutton>
<commandbutton name='Move selected point'>
<X>10</X>
<Y>130</Y>
<Width>130</Width>
<Height>20</Height>
<Text>Move selected point</Text>
<Command>Script[test]:QueueCommand[Call MovePoint]</Command>
</commandbutton>
<commandbutton name='Rename selected point'>
<X>10</X>
<Y>155</Y>
<Width>130</Width>
<Height>20</Height>
<Text>Rename selected point</Text>
<Command>Script[test]:QueueCommand[Call RenamePoint]</Command>
</commandbutton>
<commandbutton name='Save'>
<X>10</X>
<Y>180</Y>
<Width>130</Width>
<Height>20</Height>
<Text>Save Map</Text>
<Command>Script[test]:QueueCommand[Call SaveMap]</Command>
</commandbutton>
</Tab>
<Tab name='Movement'>
<listbox name='TestListBox'>
<X>5</X>
<Y>5</Y>
<Width>130</Width>
<Height>210</Height>
<SelectMultiple>1</SelectMultiple>
<Sort>Text</Sort>
<Texture filename='Listbox.png'/>
<OnDoubleLeftClick>
Script[test]:QueueCommand[call GotoPoint "${UIElement[TestListBox@Movement@Test Path tabbs@Test Path].SelectedItem}"]
</OnDoubleLeftClick>
</listbox>
</Tab>
</Tabs>
</TabControl>
</Children>
</Window>
</ISUI>



