When dedicated 2 mod isn't working

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: When dedicated 2 mod isn't working

Post by Drofder2004 » May 7th, 2010, 8:54 pm

If you are going to use the stock menus, why not use the stock functions also?

Lookinto the menu files and find the correct scriptmenuresponse call.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: When dedicated 2 mod isn't working

Post by Moustache » May 8th, 2010, 12:14 pm

I would like to use the promod live 2.04 menu.
I only want to add the extra weapon with the same camo part, and that the menu just looks the same as normal.

I can't find the scriptmenuresponse call.
Has it something to do with this ??

Code: Select all

STATS_CAMO

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: When dedicated 2 mod isn't working

Post by Drofder2004 » May 8th, 2010, 9:07 pm

self.custom_class["camo_num"]
i = 0-4 (custom classes, 1-5).

The stock stats are held in:
209
219
229
239
249

these stats are set in the .menu files, and the camo is determine by a table and using a string reference.
(See _class.gsc [lines 339-490] and any CAC .menu)

I am not familiar with the method used by promod however, as this may be different.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: When dedicated 2 mod isn't working

Post by Moustache » May 9th, 2010, 10:15 am

So it should be something like this?

Code: Select all

setweapons()
{
   self endon("disconnect");
   
   for(;;)
   {
      self waittill("menuresponse", menu, response);
      
      if(menu == "m_weapon")
         continue;

      switch(response)
      {

         case "camo_num = 209":
            self.camo = 1;
            break;
         case "camo_num = 219":
            self.camo = 2;
            break;
         case "camo_num = 229":
            self.camo = 3;
            break;
         case "camo_num = 239":
            self.camo = 4;
            break;
         case "camo_num = 249":
            self.camo = 5;
            break;
      }

      self giveWeapon("m40a3_mp", self.camo);
      self giveWeapon("remington700_mp", self.camo);

      self giveMaxammo("m40a3_mp");
      self giveMaxammo("remington700_mp");
   }
}

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: When dedicated 2 mod isn't working

Post by Drofder2004 » May 9th, 2010, 3:49 pm

No, you have compeletly muddled the code now :P
---
If you are hooking into promod, you will need to know how their classes and their camo are defined.
If you are creating your own menu, then that is a different matter altogether.

So, what are you doing, new menu or putting a mod on top of promod?
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: When dedicated 2 mod isn't working

Post by Moustache » May 9th, 2010, 4:21 pm

Drofder2004 wrote:No, you have compeletly muddled the code now :P
---
If you are hooking into promod, you will need to know how their classes and their camo are defined.
If you are creating your own menu, then that is a different matter altogether.

So, what are you doing, new menu or putting a mod on top of promod?
That is one thing I can. Screw up working scripts ;)

A mod on top of promod. So that you see the promod menu and all. That would be the best.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: When dedicated 2 mod isn't working

Post by Drofder2004 » May 9th, 2010, 6:59 pm

The only thing you can do then is add code, not menus. (Unless you had the full promod source).

So, you can simply do:

Code: Select all

setweapons()
{
   self endon("disconnect");
   
   for(;;)
   {
      self waittill("menuresponse", menu, response);
     
      if(menu == "camo")
      {
         self takeallweapons();

         self giveWeapon("m40a3_mp", int(response));
         self giveWeapon("remington700_mp", int(response));

         self giveMaxammo("m40a3_mp");
         self giveMaxammo("remington700_mp");
      }
   }
}
Then, you can bind:

/bind m scriptmenuresponse camo #
where # is a number for the camo...
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: When dedicated 2 mod isn't working

Post by Moustache » May 9th, 2010, 7:07 pm

But then it is only possible to give the player an extra weapon when he is using that bind.

And the other method you mentioned. Creating a new menu. Can you tell me how that works?

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: When dedicated 2 mod isn't working

Post by Drofder2004 » May 9th, 2010, 8:47 pm

To my knowledge you would need to have ths source code to the mod because you would be required to creat a new menu on top of the pre-existing one.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: When dedicated 2 mod isn't working

Post by Moustache » May 10th, 2010, 7:55 am

Drofder2004 wrote:To my knowledge you would need to have ths source code to the mod because you would be required to creat a new menu on top of the pre-existing one.
K.
So it's not possible.

Thank you very much for you help :mrgreen:

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: When dedicated 2 mod isn't working

Post by Moustache » May 13th, 2010, 8:38 am

Drofder2004 wrote:If you are hooking into promod, you will need to know how their classes and their camo are defined.
Someone showed me this: http://paradox-.tek-9.org/blog/cod4_tweaks_opinions_about_them-482.html?page=3

Is it possible with this codes to create the script?

Code: Select all

bind 2 "openscriptmenu -1 loadout_camo:camo_brockhaurd;CAMO;^6DESERT"
bind 3 "openscriptmenu -1 loadout_camo:camo_blackwhitemarpat;CAMO;^6DIGITAL"
bind 4 "openscriptmenu -1 loadout_camo:camo_bushdweller;CAMO;^6WOODLAND"
bind 5 "openscriptmenu -1 loadout_camo:camo_tigerblue;CAMO;^6BLUETIGER"
bind 6 "openscriptmenu -1 loadout_camo:camo_tigerred;CAMO;^6REDTIGER"
bind 7 "openscriptmenu -1 loadout_camo:camo_none;CAMO;^6NOCAMO"

::smg::
bind 5 "openscriptmenu -1 loadout_primary:ak74u;NEXT^6_^7ROUND;^6ak74u"
bind 6 "openscriptmenu -1 loadout_primary:mp5;NEXT^6_^7ROUND;^6mp5"

::sniper::
bind 5 "openscriptmenu -1 loadout_primary:m40a3;NEXT^6_^7ROUND;^6m40a3"
bind 6 "openscriptmenu -1 loadout_primary:remington700;NEXT^6_^7ROUND;^6r700"

::assault::
bind 5 "openscriptmenu -1 loadout_primary:ak47;NEXT^6_^7ROUND;^6ak47"
bind 6 "openscriptmenu -1 loadout_primary:m4;NEXT^6_^7ROUND;^6m4"

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: When dedicated 2 mod isn't working

Post by Drofder2004 » May 13th, 2010, 8:27 pm

Not exactly. If you wanted to create a menu file on top of one that already exists, you will need the source code for that menu.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Moustache
CJ Worshipper
CJ Worshipper
Posts: 476
Joined: August 18th, 2008, 9:30 am

Re: When dedicated 2 mod isn't working

Post by Moustache » May 14th, 2010, 7:12 am

Drofder2004 wrote:Not exactly. If you wanted to create a menu file on top of one that already exists, you will need the source code for that menu.
Ow, ok. So it's not going to happen.

Thanxs, again :)

Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests