Community Forum

So frustrating as a newbie

Forum Overview >> Scripting

CategoryScripting
Created31.05.2023 17:31


Barry Ryerson (bazthehat) 31.05.2023 17:31
I really want to get stuck into modding, but the learning curve is impossibly steep.

I'm trying to do what should be a really simple first "Hello World" mod, one that displays text. Nothing else. Could be after a keypress, could be just immediately on startup, but it's eluding me entirely.

Something as simple as:

HelloWorldBlinky = {};


function HellowWorldBlinky:draw()

g_currentMission:showBlinkingWarning("Hello World!")
end

addModEventListener(HelloWorldBlinky);



I've set up the modDesc.xml and FS22 sees the mod as installed and I've selected it, yet on loading nothing happens. More annoyingly, Remote Debugger is telling me that it doesn't recognise the globals g_currentMission or addModEventListener.

According to the tutorial page on this site, code along the lines of

if sym == Input.KEY.Escape and isDown then
(do stuff here)
end

should trigger something on the escape key being pressed, yet it does nothing.

I'm sure there are some basic steps I'm missing here, but that's the whole point - I've literally spent hours trying to reverse engineer existing mods and hunt for clues online and I still can't get something as simple as this to work.

Please, any help on just how to start the world's simplest mod would be gratefully appreciated.

M_k Mcd4 (MKMcD) 02.06.2023 20:05
Take a look at https://github.com/w33zl/FS22_WeezlsModLib
This should help you get started

Barry Ryerson (bazthehat) 02.06.2023 21:54
Thanks, I really appreciate that. Will look into it and see what I can learn.

David Zadnik (DzInLa) 03.06.2023 06:47
One way to learn is find a GIANTS mod that does something close to what you want to do.

Then make a copy of the MOD to edit, and make small changes to see how it works in-game.

Every GIANTS update, I make a copy of the "Farming Simulator 22/DATA" folder on my D: drive.(I rename DATA to include the update date so I can compare changes from the previous update)

<feel free to correct me if I am giving bad advice>

Barry Ryerson (bazthehat) 03.06.2023 07:01
Thanks David. I've been trying that, I'm just finding it utterly bewildering as a newbie.

I found possibly the simplest mod out there, one that changes the price of diesel. And the first line of that had me looking at FSBaseMission.loadmap, to which there seems to be no information anywhere on the internet as to how to use it. So, how did that mod developer know how to use it? What else can it do, and why use that instead of any other loadmap function?

That's what I find so infurating, the lack of comprehensive information. To be fair, I've learned more about playng FS22 from YouTube than I have from its tutorials or documentation, and I kinda hoped the same would be true for modding. There's a metric ton of info on using Giants Editor and Blender, but lua? Absolute tumbleweed.

David Zadnik (DzInLa) 04.06.2023 05:27
Check this video out: "FS22 Search all xml files for specific code." https://youtu.be/vk0WBf8WreQ

Bert Bkp (Bkp666) 14.02.2024 22:21
Hey, have you made any progress?
I too wanted to learn more about modding, scripting specifically, and I downloaded the Giants Studio App (or Remote Debugger) and I'm having the same problem with it as you do, it says it doesn't recognize globals like g_currentMission, g_currentMod, Utils, etc.

54reddog 08.03.2024 12:53
The remote debugger is utter garbage


Note: Log in to post. Create a new account here.