The Cold Hard Cash Help Thread

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Re: The Cold Hard Cash Help Thread

Post by Theshooter7 »

wildweasel wrote:Yeah, I don't know if I'd be able to work with that; mouse-controlled is nice but probably very hard to work with as far as code goes.
wildweasel wrote:Well, perhaps a CS Source type of buy menu could work too, mouse-controlled may be the way to go here...the only thing would be how easy it would be to add new menu items to the list. I don't want it to be too difficult.
At current, the GUI I've made is 100% stable, and it's actually fairly easy to work with. All it takes it a little debug-running, some paper and a pencil (or pen), and patience.

FYI, I did release the source to all of the code in the thread link, so if you wanted to peek at it or something, by all means. Another thing, you don't need direct permission to use any of the code I've made, just add me somewhere in your credits is all. :)

Anyway, I guess I'll go a little into depth as to how the GUI works. It makes use of GetPlayerInput() (As I'm sure plenty of modders have speculated). All it does from there is track the player's mouse movements, and uses the sensitivity to change the coordinates of a HudMessage (Which would be the cursor. While it is constantly being displayed, it takes in a variable that is changed by mouse movement). There is also another Input Check that determines when the player clicks the mouse. When the player does so, it runs a few checks on the coordinates of the HudMessage to determine whether the player is actually highlighting a button or not, and what action to take.

This is the part that takes patience: You have to make a Debug message that will display the said coordinates of that HudMessage, and you will have to record them so you can put them into your check system. I did make a custom function that can do the check (In LoCS II, it's called 'CheckButton(MinX, MinY, MaxX, MaxY)'). You simply position the cursor at the upper-left most point of the clickable "button", jot down the coords, move it to the bottom-right most position, right those down, and then slap them in the script. You can even use #define's if you'd like. Also, the good news is this system is also 100% multiplayer compatible, with just a few carefully-done arrays (which I did have in the source).

The only step you would have to do beforehand is setting up the GUI menus (what they look like, etc. For example, in LoCS II, the skill trees are just some (poorly) drawn images I made in Photoshop, designed to fit on the screen). After that, get it to show up in game, and then do the coordinate checking. You can also use it to toggle graphics (like in CS:S, you have a preview of a weapon show up when you highlight it in the menu. In LoCS II, I used it to show Skill information).

If you need any more help with any of this, just give a holler. Hope some of this was helpful. :D
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: The Cold Hard Cash Help Thread

Post by wildweasel »

I...can't find your thread, Theshooter7.
User avatar
Zhs2
Posts: 1300
Joined: Fri Nov 07, 2008 3:29 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Maryland, USA, but probably also in someone's mod somewhere
Contact:

Re: The Cold Hard Cash Help Thread

Post by Zhs2 »

WildWeasel wrote:Well, perhaps a CS Source type of buy menu could work too, mouse-controlled may be the way to go here...the only thing would be how easy it would be to add new menu items to the list. I don't want it to be too difficult.
The only actual difficulty in all of this that I can think of is arranging the graphics on the menu itself. :) Above that, it doesn't sound very hard to go creating a global variable, and incrementing or decrementing that based upon input commands to give the semblance of scrolling though the menu (graphics like text lighting up, or a box around the selected choice, would change as you scrolled - as well as what you would buy when choices are selected, of course.) As for how it would work adding new menu choices, the system I dreamed up includes creating a large block of if statements that all display similarly in the code and display ingame depending upon the global variable above, so any example entries provided could be copied and followed exactly to create new entries (as well as updating a separate block that will 'wrap' the global variable so it doesn't continue off into infinity (or negative infinity, as the case may be.))

Mousing up and down as well as having the choice to "fine-tune" your selection on the menu with keyboard commands as well sounds like a grand idea to me. If you don't decide to give the player a temporary Timefreeze powerup while he's making a menu choice, that quick movement through the menu might be what he needs.

Keep in mind, this is all still speculation. Hopefully, though, I can get some work done on it today...

[EDIT: Hey, TheShooter7, I tried looking through your links above. Couldn't find a trace of your beta... :melancholy:]
User avatar
Nash
 
 
Posts: 17500
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: The Cold Hard Cash Help Thread

Post by Nash »

Hate to burst your bubble but I've attempted this before. The only gripe I have with using the TimeFreeze hack is that sectors still move as usual - doors, platforms and ceiling all move as usual when you have a menu opened, which ruins the effect.

It wasn't a big deal for me... because I decided, "screw it. Let the game move in real-time even when the menu is up". Makes the player more cautious when using the menu. I also made the menus translucent so the player can see stuff going on in the background.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: The Cold Hard Cash Help Thread

Post by wildweasel »

Nash wrote:Hate to burst your bubble but I've attempted this before. The only gripe I have with using the TimeFreeze hack is that sectors still move as usual - doors, platforms and ceiling all move as usual when you have a menu opened, which ruins the effect.

It wasn't a big deal for me... because I decided, "screw it. Let the game move in real-time even when the menu is up". Makes the player more cautious when using the menu. I also made the menus translucent so the player can see stuff going on in the background.
Yeah, that's a conscious design decision, since the player shouldn't just summon ammo out of thin air when he needs it...Fallout 3 and Oblivion are great examples of how not to do this, since you can heal wounds instantly from the Pip-Boy.
User avatar
Zhs2
Posts: 1300
Joined: Fri Nov 07, 2008 3:29 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Maryland, USA, but probably also in someone's mod somewhere
Contact:

Re: The Cold Hard Cash Help Thread

Post by Zhs2 »

Oh, yeah. Thanks for clearing that up, Nash! I was wondering about that. Seems the guys who made Delta Invasion did a good job of making the TimeFreeze sphere's effects convincing... :O
User avatar
Theshooter7
Posts: 456
Joined: Sun Mar 05, 2006 6:44 pm

Re: The Cold Hard Cash Help Thread

Post by Theshooter7 »

Zhs2 wrote:
WildWeasel wrote:[EDIT: Hey, TheShooter7, I tried looking through your links above. Couldn't find a trace of your beta... :melancholy:]
Try near the bottom of the page in the second link (the one that goes to SkullTag). It should be attached directly to a post.
User avatar
Zhs2
Posts: 1300
Joined: Fri Nov 07, 2008 3:29 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support
Location: Maryland, USA, but probably also in someone's mod somewhere
Contact:

Re: The Cold Hard Cash Help Thread

Post by Zhs2 »

Bump. I've actually written out a system now. Haven't tested it at all, yet, but I'll get to that in a moment. Pretty much have the skeleton down pat, and the necessary functions are written out and commented (although they're probably not the parts of the system WildWeasel is going to want to mess with...)

So, WildWeasel, should I do some examples of the case-switching-scrolling-with-the-menu with some of the normal Doom weapons, and leave you to it? Or shall we collaborate and I'll write out the necessary code for exactly what shall be in the menu and what's not? =\ Yeah, that's the reason it's untested...
Locked

Return to “Editing (Archive)”