Author Topic: including add-ons in gamemodes  (Read 1535 times)

So I know it's possible to include add-ons inside a gamemode so that you don't have to download a billion different files just to get one gamemode to work. But I don't have any idea how to do it

Would someone mind making some sort of short tutorial or something? I figured this belonged here more than help because I'm asking for someone to make some sort of topic, maybe in modification discussion, teaching how to do this, sort of like some of the other reference topics in there.

However I don't have much scripting knowledge. I know this is most likely more than just simply packaging things right, and I would normally need some scripting knowledge to do this.
But maybe someone could at least write out the needed code and such to include a mod inside a gamemode sort of like a template, where I would fill in the blanks with the names of certain files and that sort of thing.

I want this because I'm making my own gamemode and it may end up needing quite a few files to work right, and I really don't want to have a huge list of required add-ons. Because then people just won't download it.

I think you just include the script and files in the addon's zip. :s

i think i requested this before, they said some people do it.

I think you just include the script and files in the addon's zip. :s
Wish it were that easy, but it doesn't quite work that way :/

Wish it were that easy, but it doesn't quite work that way :/

some kind of text in the gamemode.txt that activates the addon.

Wish it were that easy, but it doesn't quite work that way :/
Yes it does.
Put the files of the add-ons in the folder of your gamemode
In the server.cs of your gamemode execute all those add-ons

some kind of text in the gamemode.txt that activates the addon.
Gamemode.txt enables add-ons in your add-ons folder, not in your gamemode folder. Or at least doing it the way in the reference does.
Yes it does.
Put the files of the add-ons in the folder of your gamemode
In the server.cs of your gamemode execute all those add-ons
well that's not just putting them in the folder... And again that requires at least a little scripting knowledge, which I have zippity-doo-da of

If that is how it works though, what would I put in the server.cs? Do I just put the zip files of add-ons in the gamemode folder and then execute it with some line of code?

You would extract the contents of the zips in subfolders, I'm not sure whether zips work, try it out
And because we have a ton of add-ons in there and are lazy we would put something like this in the server.cs
Code: [Select]
%path = "add-ons/gamemode_stuff/*/server.cs";
for(%f = findfirstfile(%path); isfile(%f); %f = findnextfile(%path))
    exec(%f);

You would extract the contents of the zips in subfolders, I'm not sure whether zips work, try it out
And because we have a ton of add-ons in there and are lazy we would put something like this in the server.cs
Code: [Select]
%path = "add-ons/gamemode_stuff/*/server.cs";
for(%f = findfirstfile(%path); isfile(%f); %f = findnextfile(%path))
    exec(%f);
awesome, I'll try that. Thanks!

Didn't work :/
I replaced the asterisk with the add-on file name, and I tried both a zip file and a normal file. Then started the gamemode and checked to see if the item I enabled was there and it wasn't

Any other ideas?