Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Custom Modding and GSC Support

Опубликовано:

If you haven't made mods before, this topic isn't for you. Any stupid replies will make me mad.

 

IW4M, as of r22, has an awesome feature. That feature, is loading custom gsc files.

 

In the past, you always had to overwrite another gsc file in order for your script to load, and in most cases, you overwrote _rank.gsc. (you murderer)

This worked good enough, until big mods started using the same file (again, _rank.gsc :| ), which lead to only one mod being loaded, and causing massive compatibility issues, also causing the need to merge mods.

 

IW4M fixes this. Now you can write your scripts without using any other file as a base. All you need to do is to put your custom script inside the scripts folder, for example, in an IWD:

f1b00f.png

 

Or in the raw folder:

45709d.png

If the raw folder doesn't exist, just create it.

 

As always, putting the IWD inside the 'mods' folder which is what aIW had will work too.

 

An example script to set you off:

#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
init()
{
level thread onPlayerConnect();
}

onPlayerConnect()
{
for(;
{
	level waittill( "connected", player);
	player thread onPlayerSpawned();
	player thread onJoinedTeam();
}
}

onJoinedTeam()
{
self endon("disconnect");

for(;
{
	self waittill( "joined_team" );
	//player joined team code here
}
}

onPlayerSpawned()
{
self endon("disconnect");

for(;
{
	self waittill("spawned_player");
	//player spawned code here
}
}

 

Note: init() must be defined. It is the function which IW4M will call on load.

 

Some example console printing of what should happen:

Loading script scripts/awesome.gsc...
Script scripts/awesome.gsc loaded successfully.
Loading script handle scripts/awesome::init()...
Script handle scripts/awesome::init() loaded successfully.
Loading script scripts/sniperz.gsc...
Script scripts/sniperz.gsc loaded successfully.
Loading script handle scripts/sniperz::init()...
Script handle scripts/sniperz::init() loaded successfully.

Featured Replies

Опубликовано:

I have an anti-noob mod called iw_99.iwd

I really need it to work but doesn't work if I put it on the Main folder

I haven't tried this revision yet and will do later, but if I put it in the mods folder, will it load?

I need this mod to prevent people using tubes and other annoying things

I can post it here if you wish

Опубликовано:
I have an anti-noob mod called iw_99.iwd

I really need it to work but doesn't work if I put it on the Main folder

I haven't tried this revision yet and will do later, but if I put it in the mods folder, will it load?

I need this mod to prevent people using tubes and other annoying things

I can post it here if you wish

If you made it, it should be easy to convert it to this format.

Опубликовано:
Unfortunately I didn't and don't know who did

 

I am sure we will have Mods section where we will be able to share new mods and old ones converted to the new format as well.

This would be cool

I'm going to need help with this mod, know anyone who can help?

Опубликовано:
Seems pretty useful for those who don't know how to merge mods.

 

Is it possible to add gametypes with the method?

 

It was always possible to add custom gametypes in aIW.

 

That for sure, I did it already. I was just asking myself, if you could add a gametype like this without overriding any files like _rank.gsc.

Опубликовано:
Seems pretty useful for those who don't know how to merge mods.

 

Is it possible to add gametypes with the method?

 

It was always possible to add custom gametypes in aIW.

 

That for sure, I did it already. I was just asking myself, if you could add a gametype like this without overriding any files like _rank.gsc.

But you can already do it by putting a file in the gametypes folder, not overwriting anything..

Опубликовано:
Seems pretty useful for those who don't know how to merge mods.

 

Is it possible to add gametypes with the method?

 

It was always possible to add custom gametypes in aIW.

 

That for sure, I did it already. I was just asking myself, if you could add a gametype like this without overriding any files like _rank.gsc.

But you can already do it by putting a file in the gametypes folder, not overwriting anything..

 

Ohh...

I do not need to override the gametypes.txt, good to know. :lol:

Okay thanks, this helped me pretty much..

Опубликовано:

Well if any 'gsc coders' were smart they would have done what I did. Just call the thread in _load.gsc.

 

For instance:

thread yourcustomfolder\thread::init(); 

(or whatever thread you want to start)

 

That way you only modify one file, and you don't create issues.

 

Of course this feature is nice, but not a huge change for me.

 

Also, you could always just make a raw folder in /mods on dedicated servers. There was no need to create a zip/iwd file.

Опубликовано:
*facepalm at me*

Nice. Is there a possibility to add download support for .iwi files and menu files etc? Then we can make mouse menu's and disable a lot more stuff and be far more creative.

That would be too prone to infective mods. (and coming from you...)

Well if any 'gsc coders' were smart they would have done what I did. Just call the thread in _load.gsc.

 

For instance:

thread yourcustomfolder\thread::init(); 

(or whatever thread you want to start)

 

That way you only modify one file, and you don't create issues.

 

Of course this feature is nice, but not a huge change for me.

You still overwrite a file, making only one mod work at a time, so you would still need to merge.

Опубликовано:

Wow, I've seen a LOT of modding communities for different games struggle with mod compatibility. This is the first time ever that I've seen the ability to seamlessly merge mods one on top of the other.

 

VERY nice feature. I guess I'll redownload my Steam copy of MW2 and give 4D1 a try now that I know modding is so easy there. I've just been locked in with playing Zombies and my Specialist mod back on aIW through LAN/Direct IP with my friends =P

 

I'll definitely give this a whirl now though :P

Опубликовано:
Wow, I've seen a LOT of modding communities for different games struggle with mod compatibility. This is the first time ever that I've seen the ability to seamlessly merge mods one on top of the other.

 

VERY nice feature. I guess I'll redownload my Steam copy of MW2 and give 4D1 a try now that I know modding is so easy there. I've just been locked in with playing Zombies and my Specialist mod back on aIW through LAN/Direct IP with my friends =P

 

I'll definitely give this a whirl now though :P

 

Well thanks for the support. We as a community would gratefully appreciate if you could tell some of your steam friends :D

 

As the main reason we here is because Steam mw2 sucks :D which we all know.

 

Enjoy your stay.

Опубликовано:
I have multiple .gsc files in this mod i'm trying to merge.Do I put all of them in the scripts folder? I can't seem to get the two mods to run at the same time.

As long as they all have entry points, they should work. If the file doesn't have an entry point, then it probably won't work. Currently, I don't think you can reference other files that don't have any entry points..

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.