Crop duster mod

Your forum for all discussions around Modding.
zippyo
Posts: 72
Joined: Mon Jan 13, 2020 4:38 pm

Re: Crop duster mod

Post by zippyo »

Patton_M47 wrote: Tue Mar 03, 2020 2:06 am wait is there flight in fs19 now?
sadly no
Chainsaw_Sally wrote: Tue Mar 03, 2020 1:45 am I think I caught on YouTube that someone has the FS17 Kamov Ka-26 working in an FS19 map, I'll see if I can chase that up and get in touch with them.
i have the Kamov happily running ready for pesticide in FS19 along with my PZL but only on ground. The levitation would be one of the final hurdles. because u can only reasonably pretend flying i think as the scrip stands now its suited for rotary wing. fixed wing looks awkward with no roll and vertical lift. but as i fly it in FS17 as well it feels quite amazing for helicopters (based on real even if faded memories)

zip
User avatar
Patton_M47
Posts: 921
Joined: Sun Jan 12, 2020 11:33 pm

Re: Crop duster mod

Post by Patton_M47 »

are you going to release it on modhub?
I do FS19 old school mods and FS19 military mods for PC let me know if you want anything done
I don't have any form of social media nor discord FYI
Ban time total: 7 days
AKA Oberfeldwebel Patton
zippyo
Posts: 72
Joined: Mon Jan 13, 2020 4:38 pm

Re: Crop duster mod

Post by zippyo »

Loving the enthusiasm general but if u read through the firs page its clear there is nothing to release ... hence the discussion. If anything the script could get a healthy dose of update from the people of the modding community to get it functional in FS19. Then the script remains in public domain for all to use. Something like simpleIC global script. maybe we should touch base with him, seems he's quite home in LUA 5+

zip
User avatar
Patton_M47
Posts: 921
Joined: Sun Jan 12, 2020 11:33 pm

Re: Crop duster mod

Post by Patton_M47 »

okay thanks
I do FS19 old school mods and FS19 military mods for PC let me know if you want anything done
I don't have any form of social media nor discord FYI
Ban time total: 7 days
AKA Oberfeldwebel Patton
zippyo
Posts: 72
Joined: Mon Jan 13, 2020 4:38 pm

Re: Crop duster mod

Post by zippyo »

during the loading process the engine will throw these errors
2020-03-05 09:21 Error: Vehicle type 'Ka26.ka26' has unknown specialization 'Ka26.LevitatorSprayer'!
2020-03-05 09:21 Error: Vehicle type 'Ka26.ka26' has unknown specialization 'Ka26.Levitator_Ka26'!

Then digging down in the magical world (or perhaps voodoo) of tables ad infinitum I see that the engine does fetch a lot of the levitation functions from the lua. with my vague understanding in hand I'd say thats promising....

2020-03-05 09:56 .LevitatorSprayer :: table: 0x02b4be37f040
2020-03-05 09:56 . activateFlightMode :: function: 0x02b4be433f90
2020-03-05 09:56 . _COPYRIGHT :: Copyright (C) 2017 Eisbearg
2020-03-05 09:56 . readStream :: function: 0x02b4be406a58
2020-03-05 09:56 . updateMovement :: function: 0x02b4be4011f8
2020-03-05 09:56 . delete :: function: 0x02b4be437278
2020-03-05 09:56 . draw :: function: 0x02b4be41fc30
2020-03-05 09:56 . prerequisitesPresent :: function: 0x02b4be437448
2020-03-05 09:56 . updateTick :: function: 0x02b4be420e68
2020-03-05 09:56 . toggleLevitatorSprayer :: function: 0x02b4be406b40
2020-03-05 09:56 . update :: function: 0x02b4be42a910
2020-03-05 09:56 . getTailForce :: function: 0x02b4be4012e0
2020-03-05 09:56 . getAltitude :: function: 0x02b4be4013c8
2020-03-05 09:56 . _VERSION :: 1.0.0
2020-03-05 09:56 . mouseEvent :: function: 0x02b4be433d88
2020-03-05 09:56 . _DESCRIPTION :: Specialization that will levitate vehicles
2020-03-05 09:56 . writeUpdateStream :: function: 0x02b4be421070
2020-03-05 09:56 . readUpdateStream :: function: 0x02b4be42a828
2020-03-05 09:56 . writeStream :: function: 0x02b4be406970
2020-03-05 09:56 . load :: function: 0x02b4be437360
2020-03-05 09:56 . keyEvent :: function: 0x02b4be437190
2020-03-05 09:56 . getMorldDirectionDegree3 :: function: 0x02b4be402330
2020-03-05 09:56 . _NAME :: LevitatorSprayer
2020-03-05 09:56 . getMorldDirectionDegree2 :: function: 0x02b4be402538
2020-03-05 09:56 . getMorldDirectionDegree :: function: 0x02b4be403770
2020-03-05 09:56 . deactivateFlightMode :: function: 0x02b4be432d58
.
my few cents...
so the functions in the script are valid but the specializations would have to be registered anew?
been looking at modelleicher's simpleIC implementation which registers the spec in a separate lua.
I thought modelling animating texturing mapmaking would be the end of the road but I feel like I'm standing at the foot of Mt. Everest right now looking up not even seeing the top.

Cheers
zip
Last edited by zippyo on Sat Mar 14, 2020 6:47 am, edited 1 time in total.
Chainsaw_Sally
Posts: 19
Joined: Sun Mar 01, 2020 9:04 pm

Re: Crop duster mod

Post by Chainsaw_Sally »

Interesting, we definitely need someone to get the levitation script up and running in FS19. I feel I would be more useful at getting some realistic movement into the aircraft, bank/roll/pitch, secondary control effects, working on performance data etc. Being so new to FS modding, the inner workings of how flight was possible in FS are still very much voodoo to me.
Chainsaw_Sally
Posts: 19
Joined: Sun Mar 01, 2020 9:04 pm

Re: Crop duster mod

Post by Chainsaw_Sally »

Just to keep everyone in the loop, someone posted up a crop duster was needed in FS19 on Reddit. Been contributing with some of my ideas and brainstorming with others, so as not to repeat it all here, this is a link to the thread: https://www.reddit.com/r/farmingsimulat ... _the_game/
Chainsaw_Sally
Posts: 19
Joined: Sun Mar 01, 2020 9:04 pm

Re: Crop duster mod

Post by Chainsaw_Sally »

zip, trying to catch up a bit. Are the errors an indication that custom specialization folders are missing or the paths are wrong, or formatted wrong? From my reading there are specializations that are in the game that can be called, or one can create a custom specialization. From the naming above these would seem to be custom specializations.
zippyo
Posts: 72
Joined: Mon Jan 13, 2020 4:38 pm

Re: Crop duster mod

Post by zippyo »

LevitatorSprayer would be the specialization, and the script defines and controls its functions

the first good sign after starting with a fresh fs19 spec skeleton.lua:

2020-03-07 10:52 ### chT ### BEGIN ### Table: g_specializationManager
2020-03-07 10:52 .specializations :: table: 0x021dfb73e9b8
.
. Ka26.LevitatorSprayer :: table: 0x021d8069f198
and in that table:
2020-03-07 10:27 ### chT ### BEGIN ### Table: Ka26.LevitatorSprayer
2020-03-07 10:27 .activateFlightMode :: function: 0x021d80541fb8
2020-03-07 10:27 .getMorldDirectionDegree3 :: function: 0x021d80478650
2020-03-07 10:27 .readStream :: function: 0x021d804baaf0
2020-03-07 10:27 .updateMovement :: function: 0x021d80476e00
2020-03-07 10:27 .registerEventListeners :: function: 0x021d8061bc48
2020-03-07 10:27 .delete :: function: 0x021d806133f0
2020-03-07 10:27 .getAltitude :: function: 0x021d80478568
2020-03-07 10:27 .onUpdateTick :: function: 0x021d804c87e0
2020-03-07 10:27 .toggleLevitatorSprayer :: function: 0x021d804c25d0
2020-03-07 10:27 .getTailForce :: function: 0x021d80478480
2020-03-07 10:27 .getMorldDirectionDegree2 :: function: 0x021d80478738
2020-03-07 10:27 .modDirectory :: C:/Users/Admin/Documents/My Games/FarmingSimulator2019/mods/Ka26/
2020-03-07 10:27 .mouseEvent :: function: 0x021d80577ec8
2020-03-07 10:27 .getMorldDirectionDegree :: function: 0x021d8047a070
2020-03-07 10:27 .onDraw :: function: 0x021d804c3910
2020-03-07 10:27 .onPostLoad :: function: 0x021d80541de8
2020-03-07 10:27 .writeStream :: function: 0x021d8049ae48
2020-03-07 10:27 .saveToXMLFile :: function: 0x021d804c8610
2020-03-07 10:27 .keyEvent :: function: 0x021d80553988
2020-03-07 10:27 .prerequisitesPresent :: function: 0x021d80662840
2020-03-07 10:27 .deactivateFlightMode :: function: 0x021d80541ed0
2020-03-07 10:27 .onUpdate :: function: 0x021d805046f8
2020-03-07 10:27 .title :: FS19 LEV
2020-03-07 10:27 .onLoad :: function: 0x021d806135f8
2020-03-07 10:27 ### chT ### END ### Table: Ka26.LevitatorSprayer

I fired up the remote debugger and it makes getting stuff out of the engine far easier to access. but as of now the script fires all over the place i guess because of the re classing of a heap of stuff from fs17 to fs19

im gonna need help with why

function LevitatorSprayer:onLoad(savegame)
self.isSelectable = true;
self.toggleLevitatorSprayer = SpecializationUtil.callSpecializationsFunction("toggleLevitatorSprayer");
self.LevitatorSprayer = {};
-- local spec = self.spec_levitatorSprayer;
local name = getXMLString(self.xmlFile, "vehicle.storeData.name");
if name == nil then name = getXMLString(self.xmlFile, "vehicle.storeData.name.en"); end;
if name == nil then name = getXMLString(self.xmlFile, "vehicle.storeData.name.de"); end;
if name == nil then name = getXMLString(self.xmlFile, "vehicle.storeData.name.es"); end;
if name == nil then name = getXMLString(self.xmlFile, "vehicle.storeData.name.fr"); end;
if name == nil then name = getXMLString(self.xmlFile, "vehicle.storeData.name.pt"); end;
if name == nil then name = getXMLString(self.xmlFile, "vehicle.storeData.name.ru"); end;
if name == nil then name = "UnknownVehicle"; end;

self.LevitatorSprayer.id = LevitatorSprayer._NAME;
self.LevitatorSprayer.name = name;
self.LevitatorSprayer.move = false;
self.LevitatorSprayer.active = false;
self.LevitatorSprayer.downForce = 0;
self.LevitatorSprayer.yForce = 0;
self.LevitatorSprayer.pitch = 0;
self.LevitatorSprayer.sendPitch = 0;
self.LevitatorSprayer.startTimer = 0;
self.levitatorSprayerFlag = self:getNextDirtyFlag();

self.lastDigitalSide = 0;
self.yLV = 0;
self.workAreaPositions = {};
for k,c in pairs (self.workAreas) do <=========================ON THIS LINE table nil PLEASE lemme know why or how to fix
local xs,ys,zs = getWorldTranslation(workArea.start);
local xw,yw,zw = getWorldTranslation(workArea.width);
local xh,yh,zh = getWorldTranslation(workArea.height);
local cap = {};
cap.start = {xs,ys,zs};
cap.width = {xw,yw,zw};
cap.height = {xh,yh,zh};
table.insert(self.workAreaPositions, cap);
end;

cheers

zip
Chainsaw_Sally
Posts: 19
Joined: Sun Mar 01, 2020 9:04 pm

Re: Crop duster mod

Post by Chainsaw_Sally »

Any progress zip? I've done my reading on modding in FS. Now on a LUA refresh, after that I can start to dig into the FS19 engine a bit more (why do I do these things?? :0) )

Was wondering what you want ideally for the models to do?

Reading around community posts, a large proportion would be happy with a duster they could call up to spray a field (rather than flying it themselves). This could all be done with splines, perhaps a system like courseplay where new fields could be added by the player. I think but have not checked that is how the duster worked in FS17, but it was built directly into a mod map. I think I would like to see a mod working with the vanilla in game maps, even though they are small to have an aircraft flying around in, as well as larger mod maps.

I would still like to see something actually flyable. Well more than that, a complete aerial ag business where it is possible to add new fields to spray by manually adding them to a GPS system. A ground base with an airstrip and filling station etc.

So my concept goes like this, there is a functional GPS system available to the aircraft. The plane has a GPS light bar for field work and navigation to a given field if flown manually. New GPS data could be added either in flight (recce new field) or by the player on the ground (no manual flight required).

What do you think? It all seems doable one way or another.
zippyo
Posts: 72
Joined: Mon Jan 13, 2020 4:38 pm

Re: Crop duster mod

Post by zippyo »

Hey there

Been buried in the debugger the mod now loads with the script fine and the spec is live on the Kamov. Still few items to tidy up in scripting differences from old FS17 but I'm really set on getting it up and running within short time. Since I'm not a programmer or scripter but more of a practical kinda guy (the debugger is a must have get it if you haven't), it will take some mental muscle

As for the models ... not very important for now ... the script looks for workAreas params in xml and thats it
add to any model as long as u set up source lua in modesc and add the spec.......NOT a global realization as u describe tho
based on my take the helicopter is first now because levitating is not flying and it looks acceptable on it, with planes it'll be a whole new rewrite of at least the updateMovement function and thensome.

the lightbar connected to the GPS would all have to be scratch made scripts ... as u can see only up to you as myself, how deep down the rabbit hole you go.Irrelevant of model u could test your GPS/Lightbar script on a pickup or tractor before levitation to get it sorted first.
Nevertheless I like all ideas a lot hope u see the enormous depth of it all
Made an 8x8 km map and I think it would be an ideal test bed for the Kamov.
Hoping it goes beyond us all but small steps first

Cheers

zip
zippyo
Posts: 72
Joined: Mon Jan 13, 2020 4:38 pm

Re: Crop duster mod

Post by zippyo »

Progress is SWEET the Kamov became airborne in FS19 for the first time (for me anyways) today and is surely put a smile on my grumpy mug.
Still some ways to get translation working the way I'd like but still it FLIES!
The mouse presses are read by scrpit ok and it will Climb and Descend which is a welcome new tidbit in the Farming arsenal. It drives and steers on ground but for now forward velocity is gained on ground only and in the air this momentum decays to 0 so I still got a bit to gobble up into my poor brain
Can't believe some far more capable scripters have not tore this script to its bits by now... there is so much possible

A Big CHEERS to all (my beer supply suffers tremendously)

zip
zippyo
Posts: 72
Joined: Mon Jan 13, 2020 4:38 pm

Re: Crop duster mod

Post by zippyo »

Too drunk to fall asleep i could not leave it alone......
Happy to announce the flying part is sorted to the point of taxi takeoff hover climb descend and now controlled flight. No roll only yaw for the turns is awful but it has pitch forward and backward attitude during translation so maybe i can hack something up for that as well later. more and more its evident that this script was never meant to be attached to fixed wing...

BUT HEY IT FINALLY BRINGS FLYING BACK TO Farming Simulator!!!!

well its 2am I'm off to think up more ways to violate my brain

cheers

zip
Image
Chainsaw_Sally
Posts: 19
Joined: Sun Mar 01, 2020 9:04 pm

Re: Crop duster mod

Post by Chainsaw_Sally »

This is great news zip! Getting the planes flying how they should is where I can really contribute. Having the levitator script up and running in FS19 will be a enormous help. Though I understand it was never meant for fixed wing, it is going to be much easier to develop a fixed wing script from scratch, with some sort of reference (even if it is just knowing the shortcomings), than with nothing at all.
Chainsaw_Sally
Posts: 19
Joined: Sun Mar 01, 2020 9:04 pm

Re: Crop duster mod

Post by Chainsaw_Sally »

Zip can you anyone else confirm that FS19 is still on LUA 5.1 not a later version? Will be setting up my LUA environment today and going back to school :0)
Post Reply