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

Members Online

»
0 Active | 63 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Not being able to open a weaponmenu
z0d
General Member
Since: Apr 29, 2012
Posts: 33
Last: May 8, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 01:13 pm
lo

so heres my problem - i made my own ingame menu which is called ingamer and because of that menu, players aren't able to open a weaponmenu by a shortcut (keyboard button). i really must keep ingamer menu so changing it to ingame ain't a solution.

Code:

/openscriptmenu ingame changeweapon
- is a command which opens a weaponmenu

and that line is only used in options_multi.menu - http://pastebin.com/e2rWSSpk

i tried changing
Code:

openscriptmenu ingame changeweapon


with

Code:

openscriptmenu ingame changeweapon


but it didnt work. does anybody has an idea how to fix this?

edited on Sep. 15, 2012 06:17 am by z0d
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 01:49 pm
z0d writes...
Quote:
lo

so heres my problem - i made my own ingame menu which is called ingamer and because of that menu, players aren't able to open a weaponmenu by a shortcut (keyboard button). i really must keep ingamer menu so changing it to ingame ain't a solution.

Code:

/openscriptmenu ingame changeweapon
- is a command which opens a weaponmenu

and that line is only used in options_multi.menu - http://pastebin.com/e2rWSSpk

i tried changing
Code:

openscriptmenu ingame changeweapon


with

Code:

openscriptmenu ingame changeweapon


but it didnt work. does anybody has an idea how to fix this?

edited on Sep. 15, 2012 06:17 am by z0d


Your change didnt change poo-poo.

Look in the _menus.gsc (stock) or in whatever mod you are running to see what happens when such a "changeweapon" scriptmenuresponse occurs.

Debug with iprintlns etc to find the exact cause. Probably you changed something that shouldnt have been changed, or changed something but forgot to change it in other places.
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 02:10 pm
I don't see how your custom menu has anything to do with not being able to open a weapon menu if you type "changeweapon". The menu response for that has nothing to do with ingamer.menu. Unless, the problem is that ingamer is not closing after "changeweapon" has been sent. Just a guess. Is that what's happening? Is ingamer staying open?

Also, looking at your custom menu, it is a bit of a mess. I appreciate it is a first attempt, but it contains lots of errors, and to be frank, I can't see the menu even compiling properly and opening (usually when you screw up a menu item, the menu wont even compile - it is just an invisible menu). It needs some serious attention if it is ever going to work. For one thing, it contains no scriptmenu reponses in the menu itemDefs (under action{ } ). If you don't have a stated scriptmenu response, the game will have nothing to response to, and nothing will happen.

All menu responses are handled in maps\mp\gametypes\_menus.gsc. Even if you don't create custom ones for the game to respond to, you need to keep ones already defined in _menus.gsc in order for the appropriate action to take place. Every time you click a button on a menu, it sends a response to the game, and is picked up by _menus.gsc, which is waiting for each click you make. If there is no stated response sent, the game can't respond to your request because, obviously, you didn't make one.
Share |
maxxis95
General Member
Since: Aug 28, 2012
Posts: 55
Last: Sep 17, 2012
[view latest posts]
Level 3
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 02:54 pm
i had similar problem with my menus and yeah, probably you didnt close it... (somewhere)
Share |
z0d
General Member
Since: Apr 29, 2012
Posts: 33
Last: May 8, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 03:29 pm
@IzNoGoD - i actually made a mistake.

I repleaced

Code:
openscriptmenu ingame changeweapon


with

Code:
openscriptmenu ingamer changeweapon


also I have added iprintln to find a cause and it seems everything works fine

@Tally - i closed ingame(r) where ever it supposed to be closed (weapon menus and ingamer menu).

I havent done any changes to ingamer menu. only reason why i made is to prevent players to press esc if they dont have mod downlaoded so basically i havent made any single change to a ingamer menu. and weapon menu is based on orginal weapon menu.

here's _menus.gsc:

http://pastebin.com/UheGY9Bg

ingamer.menu:

http://pastebin.com/bHwsBgyS

and one of my (modified) weapon menus:

http://pastebin.com/45nKxg7z

EDIT:

I also added modified serverinfor_sd.menu to prevent players to open a main menu

serverinfor_sd.menu:
http://pastebin.com/wPbZMvu3
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 03:44 pm
This is what I did for a test:

1. copied your ingamer.menu from the pastebucker link you provided and created a custom menu named "ingamer" to replace the stock ingame.menu;

2. Changed the menu definitions in _menus.gsc;

3. Went in game to test it - droped down console and typed:

/openScriptmenu ingamer changeweapon

4. The allies weapon menu poped up no problem.

Video proof of it working:



I can't see what the problem is. It works.
Share |
z0d
General Member
Since: Apr 29, 2012
Posts: 33
Last: May 8, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 04:01 pm
also theres a ingame.txt file aswell (if that changes anything)
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 04:04 pm
Read my last post. I just edited it.

Basically, there is nothing wrong. Everything works. You must be doing something wrong. Precisely what, I have no idea.
Share |
z0d
General Member
Since: Apr 29, 2012
Posts: 33
Last: May 8, 2013
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 04:08 pm
well, it opens for me aswell when im opening it via console but when im trying to reach it pressing x (keyboard shortcut button), it just doesnt work.
Share |
IzNoGoD
General Member
Since: Nov 29, 2008
Posts: 694
Last: Nov 10, 2012
[view latest posts]
Level 6
Category: CoD2 Scripting
Posted: Saturday, Sep. 15, 2012 04:12 pm
Then you probably fucked something up when you set the scriptmainmenu in your gametype file...
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 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

»