{"action":"created","issue":{"url":"https://api.github.com/repos/Courseplay/courseplay/issues/1542","repository_url":"https://api.github.com/repos/Courseplay/courseplay","labels_url":"https://api.github.com/repos/Courseplay/courseplay/issues/1542/labels{/name}","comments_url":"https://api.github.com/repos/Courseplay/courseplay/issues/1542/comments","events_url":"https://api.github.com/repos/Courseplay/courseplay/issues/1542/events","html_url":"https://github.com/Courseplay/courseplay/issues/1542","id":196528417,"number":1542,"title":"CoursePlay Script Functions","user":{"login":"tjb8907","id":5883859,"avatar_url":"https://avatars.githubusercontent.com/u/5883859?v=3","gravatar_id":"","url":"https://api.github.com/users/tjb8907","html_url":"https://github.com/tjb8907","followers_url":"https://api.github.com/users/tjb8907/followers","following_url":"https://api.github.com/users/tjb8907/following{/other_user}","gists_url":"https://api.github.com/users/tjb8907/gists{/gist_id}","starred_url":"https://api.github.com/users/tjb8907/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjb8907/subscriptions","organizations_url":"https://api.github.com/users/tjb8907/orgs","repos_url":"https://api.github.com/users/tjb8907/repos","events_url":"https://api.github.com/users/tjb8907/events{/privacy}","received_events_url":"https://api.github.com/users/tjb8907/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-19T21:45:14Z","updated_at":"2016-12-20T09:23:56Z","closed_at":null,"body":"Hey Guys, \r\n\r\nIf you have a minute to help me out...I have a mod that I'm working on to add a few functions of my own to your great mod :). \r\n\r\nI had it working in FS15, but I'm having troubles with it in 17. \r\n It has a couple functions, 1. I can load courses with a hotkey. I have a small HUD for my mod that shows the current vehicle type and field number, and when I push Ctrl + KP_0 It will load that course (I save all my courses in the right format, such as 3.Combine), so If the combine is in field 3, it will load 3.Combine).  The second feature is it assigns a hotkey to toggle the stopAtEnd option in CP. \r\n\r\nMy problem is I can't get my mod to run any CP functions. I don't know if its Giants that changed how things work or not, but I have figured out how to access some of the Giants functions from a mod. I just can't get the CP functions to work. Here is a little snippet of my code that I used before.\r\n\r\n`courseplay:clearCurrentLoadedCourse(self)`\r\n\r\nbut when it runs I get this because it can't reference \"courseplay\"\r\n\r\n`C:/Users/Tom/Documents/My Games/FarmingSimulator2017/mods/ZZZ_zcpAutoLoad/cpAutoLoad.lua:69: attempt to index global 'courseplay' (a nil value)`\r\n\r\nso after playing around, I tried this instead:\r\n\r\n`self:clearCurrentLoadedCourse(self)`\r\n\r\nand get:\r\n\r\n`attempt to call method 'clearCurrentLoadedCourse' (a nil value)`\r\n\r\nI'm studying other mods to try to figure this out on my own, but if you guys are willing to give me a pointer it would be appreciated! I am hoping to develop this into a Add-on for CP. I found it really helpful in managing many vehicles when I used it in FS15.\r\n\r\nThanks for any help you may provide! I can share more of my script if necessary!\r\n"},"comment":{"url":"https://api.github.com/repos/Courseplay/courseplay/issues/comments/268194691","html_url":"https://github.com/Courseplay/courseplay/issues/1542#issuecomment-268194691","issue_url":"https://api.github.com/repos/Courseplay/courseplay/issues/1542","id":268194691,"user":{"login":"tjb8907","id":5883859,"avatar_url":"https://avatars.githubusercontent.com/u/5883859?v=3","gravatar_id":"","url":"https://api.github.com/users/tjb8907","html_url":"https://github.com/tjb8907","followers_url":"https://api.github.com/users/tjb8907/followers","following_url":"https://api.github.com/users/tjb8907/following{/other_user}","gists_url":"https://api.github.com/users/tjb8907/gists{/gist_id}","starred_url":"https://api.github.com/users/tjb8907/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjb8907/subscriptions","organizations_url":"https://api.github.com/users/tjb8907/orgs","repos_url":"https://api.github.com/users/tjb8907/repos","events_url":"https://api.github.com/users/tjb8907/events{/privacy}","received_events_url":"https://api.github.com/users/tjb8907/received_events","type":"User","site_admin":false},"created_at":"2016-12-20T09:23:56Z","updated_at":"2016-12-20T09:23:56Z","body":"Already have it loading after courseplay, but that wouldn't matter anyway I don't think, and the only time I try to call courseplay functions is in the keyEvent function of my mod. "}}
{"actor":{"display_login":"tjb8907"}}