Jump to content
The Dark Mod Forums

Making Checkboxes Appear in a Readable


Ishtvan

Recommended Posts

Is there a way to make checkboxes get checked off in realtime by an external script? I would like to have a list of melee combat drills that the player has completed successfully. It doesn't have to be a frobable readable, it can just be a large GUI that the player can read from afar, like a board on the wall. I just want it to display GUI text and a check box that gets checked off.

 

I know we can have a menu gui with boxes that get checked off, but how hard is it to do with an ingame GUI with an external script telling it when to check off the boxes? Is there any guide I can read to learn how to set this up?

 

We had that one experiment with an ingame objectives list... I can't remember if that was checked off in real time or not?

Link to comment
Share on other sites

You can access GUIs by using scriptevents à la $entity1.setGuiFloat(guiHandle, 3.2). The guiHandle is an integer referring to the GUI layer (the player has multiple GUI layers), whereas regular entities should have max. 3 GUIs, starting with handle 1.

 

You can load specific GUIs by calling $entity1.createOverlay("guis/melee_trainer.gui", 1) and saving the handle. Then use that handles for the other events. In the GUI you need some if-else code in a named event, which you can call from the script as well.

 

I've never tested it with an entity other than the player, but it should work from what I remember.

Link to comment
Share on other sites

Hmm, I know nothing about guis. If I want a GUI to do this special stuff, can I still use xdata to put in the text fields next to where the checkboxes will be, or do I have to do everything from scratch?

 

I guess I should probably look at the objectives GUI if that is the case, since it is most like what I want.

Link to comment
Share on other sites

Okay, I will try that.

 

Another question: I vaguely remember that we took out the old D3 ability for the player to switch focus to an ingame GUI and point & click within that. Is that correct?

 

The application is I want to provide a list of possible melee drills/opponents, somehow let the player select one of them out of the list, and put in a check box in it if that one has been completed successfully.

 

For the selection, I'm probably just going to do a set of buttons lined up with/sticking out of the surface of the gui. I briefly entertained the idea of doing some kind of point & click selection like you could do in Doom3, but I thought we may have taken out that functionality to "focus" on ingame guis. Also, a cursor looks kind of cheesy in TDM. I then thought about doing something like showing a model of a quill pen moving around normal to the gui surface instead of a 2d cursor, but if I tried to do that, this task probaly wouldn't get done before 2011. :) So it's probably going to be frobable buttons next to / on top of a non-interactive GUI.

Link to comment
Share on other sites

Sure you're not overthinking this? Why can't the player just look at a poster on the wall and track their own progress? It would be a lot easier and quicker to set up, leaving you free for other things.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Tracking progress is the first step, but I also want to let them hit a button to jump to a particular drill or opponent. If they've already played the training map some, then had to quit without saving, I don't want to force them to go thru the 5 previous drills/opponents to get back to the one they were working on. A simple frobable button off to the side will work though.

 

Unless I'm misunderstanding you and you mean just don't put up check boxes at all? I think it would get hard for the player to remember looking at the list when there are 10 possible drills or so and you have the option to jump around in the list. A check box would be helpful.

Link to comment
Share on other sites

I just don't see the point in going to all this trouble merely so players can manually check things off on a GUI. Firstly I'm not convinced that people will actually do it. Secondly, for the rare player that does want to, just make them use paper or something. (Real-life paper, I mean!) :)

 

Having selection buttons and "currently selected" lights does 90% of what you're after with 10% of the effort. You could also set the light brightness to, say, 25% of normal when it turns "off", to indicate that it's a previously-visited state. While that doesn't allow players to manually track which drills they've actually completed (just started), it does provide an automatic approximation which should be close enough.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

I think there's been some miscommunication. I don't want them to manually check things off, I want the check marks to appear automatically to track progress, just like the brightness change you were describing.

 

The only interactivity should be clicking a frob-button to choose which drill or opponent to jump to. When I went off on a tangent about clicking things with a quill pen, that's what I meant, clicking on them to "order up" that drill. I was imagining a second check box next to teach option they would click to "fill out their order," to go play that option, but that is completely unnecessary, we can just use standard frob-buttons.

Link to comment
Share on other sites

OK, I see. In that case, I would say just use lights for that, unless you can get the checkboxes done really quickly.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

By lights you mean lights pointing at the list that turn on subsequently as you move down the list? There may be 10 or so entries, so it could get hard.

 

I think checkboxes won't be so bad because we already have the assets from the main menus. I have a check image and a box image, and greebo told me how to turn the check image on. The hard part for me is learning how to put a GUI into the game in general, sort of from scratch because as I understand it, our pre-scripted readables aren't flexible enough for this? After that, I can edit the GUI code & map script pretty easily, and it should go faster than it would take to keep talking about it. :)

Link to comment
Share on other sites

Yeah, that's what I meant (re: lights).

 

If you reckon this is the most efficient way to do it, be my guest. Happy to be proved wrong. :)

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 1 reply
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...