Author |
Topic: Not being able to open a weaponmenu |
|
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 |
|
|
|
IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
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. |
|
|
|
Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
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. |
|
|
|
maxxis95 |
General Member Since: Aug 28, 2012 Posts: 55 Last: Sep 17, 2012 [view latest posts] |
|
|
|
|
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 |
|
|
|
Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
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. |
|
|
|
|
|
Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
|
|
|
IzNoGoD |
General Member Since: Nov 29, 2008 Posts: 694 Last: Nov 10, 2012 [view latest posts] |
|
|
|