RE: Setting course/speed with lua script?
Posted: Wed Aug 16, 2017 3:43 pm
If you add units with lua, you have to add waypoints via lua also, if not there is no need to do it.
Here is the code if you want tho add it with LUA.
I have added this code as an example for tank1. You can try it out. One thing to note is that I have added two waypoint's on purpose, so that you can see how to add two or more waypoint's,
course={{latitude='17.0565979083558', longitude='-89.2178220232281'} is waypoint 1
and {latitude='17.0572042889711', longitude='-89.1964406652192'}} is waypoint 2.
every next waypoint you want to add should be in curly brackets {}, with latitude="" and longitude="".
Latitude and longitude, can be in two formats:
1st: N17.35.25 Just point your mouse on the map where your waypoint sholud be and write it down from the information panel.
2nd: 17.0565979083558 in decimals
Second is easier to get, just point your mouse to the place on the map where your waypoint should be then press CTRL+X , this command will copy latitude and longitude. Then you can paste this inside brackets as a waypoint.
NOTE: (when you paste the lat/long data in the LUA, you should change the semicolon to full stop), because CTRL+X copies lat/long data with semicolon. When you paste it it should look like this latitude='17,0572042889711', longitude='-89,1964406652192', when you change it it should look like this latitude='17.0572042889711', longitude='-89.1964406652192'
If you have any more questions feel free to ask.
Here is the code if you want tho add it with LUA.
Code: Select all
ScenEdit_SetUnit({side="Guatemala", unitname="tank1",course={{latitude='17.0565979083558', longitude='-89.2178220232281'},{latitude='17.0572042889711', longitude='-89.1964406652192'}}, manualSpeed="9"})I have added this code as an example for tank1. You can try it out. One thing to note is that I have added two waypoint's on purpose, so that you can see how to add two or more waypoint's,
course={{latitude='17.0565979083558', longitude='-89.2178220232281'} is waypoint 1
and {latitude='17.0572042889711', longitude='-89.1964406652192'}} is waypoint 2.
every next waypoint you want to add should be in curly brackets {}, with latitude="" and longitude="".
Latitude and longitude, can be in two formats:
1st: N17.35.25 Just point your mouse on the map where your waypoint sholud be and write it down from the information panel.
2nd: 17.0565979083558 in decimals
Second is easier to get, just point your mouse to the place on the map where your waypoint should be then press CTRL+X , this command will copy latitude and longitude. Then you can paste this inside brackets as a waypoint.
NOTE: (when you paste the lat/long data in the LUA, you should change the semicolon to full stop), because CTRL+X copies lat/long data with semicolon. When you paste it it should look like this latitude='17,0572042889711', longitude='-89,1964406652192', when you change it it should look like this latitude='17.0572042889711', longitude='-89.1964406652192'
If you have any more questions feel free to ask.