Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 6 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: custom in-game quick menu
uprize
General Member
Since: Jan 13, 2008
Posts: 24
Last: Oct 23, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Friday, Sep. 19, 2008 02:16 pm
I am working on a small mod for my server which will include some punishments and other random things for the admins.
At the moment I am doing everything through the console using my custom dvars, but it gets quite time consuming.

I have seen a few mods with custom quick menus (you know the menu where you can say things to your team "move it" etc.) and I wanna change this menu for my mod to control all commands through there.
Is there a tutorial or example out there I can refer to? I tried searching but didnt come up with anything useful.

Cheers
Share |
xholyx
General Member
Since: Oct 17, 2007
Posts: 116
Last: Sep 7, 2010
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Friday, Sep. 19, 2008 05:00 pm
there isnt a tutorial for menu scripting, but i could give u some tips


it works like this:

in the .menu file u search for
CHOICE_BUTTON( ...... )
between this lines u see for example first numbers
the numbers indicate in which order they have to be placed

1 = top
2 = under top
3 = under 2
etc.

then u see ; and then a "" between this u can see for example text
this will indicate the button text, after that u see again ;
and with a command , one of these commands can be : Scriptmenuresponse "1";

this will send a response to the engine called 1

if u look up in _menu.gsc u will see a part like this
Code:

if(menu == game["menu_name"])
  switch(response)
         {
         case "1":
         self iprintlnbold("Response = 1");
         break
         }


game["menu_name"] , this will be defined your menu name ( mainly will be :#define CHOICE_GROUP "blabla" )
and in your .gsc it will be game["menu_name"] = "blabla";.

also u see now response , this will execute the script command IF that response is send out ( so if the button is pushed)

if response is send out, then it will say a text Response = 1.
i hope this is a bit clear.

also try to look in the quickcommands.menu , this will explain how u can work with Execkey.
Execkey is not with mouse but u can active a button to send out response .
example:
execKey "3" { close self; scriptmenuresponse "1"; }

this will close the menu self and send out response 1 when pushing button 3.

i hope this will make clear how to ;), if u need an example of some of menu scripts just PM me for some sources
Share |
ukdjaj
General Member
Since: Jun 1, 2008
Posts: 2726
Last: Nov 15, 2020
[view latest posts]
Level 9
Category: CoD4 Scripting
Posted: Friday, Sep. 19, 2008 05:08 pm
Well i have forgot how to do it but i know this to change the "text" of what they say then go in to your main folder or "raw" as it is on cod4 and in that look in thelocalized_english_iw and in one of them their should be should be a mpui.str or menu.str or some other .str's look in them don't look in the singleplayer map names though waste of time, or if u want to change what they say then in another localized_english_iw file there should be sound/voiceovers/uk and theres different ones in there i know this isn't very detailed but i have forget how do it

thanks ukdjaj[thumbs_up]
Share |
uprize
General Member
Since: Jan 13, 2008
Posts: 24
Last: Oct 23, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Sep. 20, 2008 12:50 am
i looked thru the scripts last night, I have a slight idea but I am still quite confused. It would be great if someone had some examples for me to check out
Share |
uprize
General Member
Since: Jan 13, 2008
Posts: 24
Last: Oct 23, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Sep. 20, 2008 02:05 am
i have figured most of it out. I have made my changes to the menu and put them in the right folders, but when I compile my mod the changes dont seem to be there? Can someone explain how to compile the menus into the mod properly plz?
Share |
uprize
General Member
Since: Jan 13, 2008
Posts: 24
Last: Oct 23, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Saturday, Sep. 20, 2008 04:05 am
ok i got it to work with a lot of playing around and testing.
I have a question.

Is it possible to display player names in the quick menu?
I want to run a loop to count all the players and then display there names in the menu. Is this possible??? (it appears menu files dont allows arrays+loops)
Share |
xholyx
General Member
Since: Oct 17, 2007
Posts: 116
Last: Sep 7, 2010
[view latest posts]
Level 4
Category: CoD4 Scripting
Posted: Monday, Sep. 22, 2008 01:40 pm
bigredron writes...
Quote:
ok i got it to work with a lot of playing around and testing.
I have a question.

Is it possible to display player names in the quick menu?
I want to run a loop to count all the players and then display there names in the menu. Is this possible??? (it appears menu files dont allows arrays+loops)


yes, but u have to do set a new dvar first in the .gsc
like :
playername = getdvar("name");
playernamedvar = setdvar("nameplayerone",playername);

then go to menu and type at text : @dvarString "nameplayerone"
Share |
uprize
General Member
Since: Jan 13, 2008
Posts: 24
Last: Oct 23, 2008
[view latest posts]
Level 1
Category: CoD4 Scripting
Posted: Monday, Sep. 29, 2008 09:06 am
xholyx writes...
Quote:
bigredron writes...
Quote:
ok i got it to work with a lot of playing around and testing.
I have a question.

Is it possible to display player names in the quick menu?
I want to run a loop to count all the players and then display there names in the menu. Is this possible??? (it appears menu files dont allows arrays+loops)


yes, but u have to do set a new dvar first in the .gsc
like :
playername = getdvar("name");
playernamedvar = setdvar("nameplayerone",playername);

then go to menu and type at text : @dvarString "nameplayerone"



hey xholyx can you check your pms? I need an example if you have one.
Cheers
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»