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

Members Online

»
3 Active | 15 Guests
Online:

LATEST FORUM THREADS

»
help pls
CoD2 Scripting
Rainbow HELP....
CoD4 MP 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, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Restricted Access
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 06:13 am
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 06:49 am
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 07:10 am
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 07:54 am
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 08:29 am
@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 08:44 am
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 09:01 am
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 09:04 am
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 09:08 am
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 09:12 am
Then you probably fucked something up when you set the scriptmainmenu in your gametype file...
Share |
Restricted Access Restricted Access
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Why console gaming is dying
Quote:Consider this: Dedicated gaming sales — including living-room consoles...
Devs: Games are being dumb...
Click 'read more' to view the contents of this post.
Loadout
Gun Crafting to the Max. edited on Sep. 25, 2012 06:57 pm by Morp...
Introducing the Source Fil...
Surprised this wasn't made a long time ago. Sounds like a nice little feature.
Introducing the Source Fil...
The Source Filmmaker (SFM) is the movie-making tool built and used by us he...

Partners & Friends

»