Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: A few suggestions: Default activities and Escape to break off unintended actions  (Read 971 times)

Mazur

  • Bay Watcher
  • Mad as a March Hatter.
    • View Profile

I've seen setting default assignments being bandied about, and I was wondering what the status of that potential option is.

On the assign activities sceen I'd add two more keys: X - Set Default mode (toggle0  and Y - Activate default assigments
If you press X once, any character letter would toggle setting that characters default activity to whatever they have now: a second time it would reset that to a special activity NO_DEFAULT_ASSIGNMENT, which would make it insensitive to the Y key.

Pressing X a second time would return to normal activity assignment.

Pressing Y would assign all characters that do NOT have NO_DEFAULT_ASSIGNMENT or are  tending to injuries their default activity.

I'd make some indication with the listed assignments to indicate  the status of a characters deafult assignment, if their currnet assigment is their default assignment, print in yellow, if their current ass. isn't print in orange.  If they don;t have a default, the current colour.

[Edit 20-08: Forget about the colour comment, that'd break the current colouring system, it's have to be some kind of (D) added, IF you wanted to make it being set visible.]

I think this would be the easiest to implement, and I'd do it myself today if I knew OO programming.


A second idea: make the Escape key break off and return to the previous page from whereever tyou ended up:
I am not a good typist, and my finger macros regularly go awry, so i keep getting into the set slogan thingy unintentionally,  and then I can't back out of it.


And now a question: I've been trying to set an avatar in my profile, with this image:
But each time I press Save, the page returns reporting having succesfully saved my profile, but reset to No Avatar.  Any idea what might go wrong?  And how I can fix it?

Once more: thanks for a brilliant game, everyone.

Mazur.
« Last Edit: August 20, 2013, 04:02:33 am by Mazur »
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki

The avatar thing is simple. These forums require the avatar to have a URL beginning "http://", and yours begins "https://". Remove the offending "s" so it starts "http://". Here is the image with the URL that works for a profile image:

Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Mazur

  • Bay Watcher
  • Mad as a March Hatter.
    • View Profile

The avatar thing is simple. These forums require the avatar to have a URL beginning "http://", and yours begins "https://". Remove the offending "s" so it starts "http://". Here is the image with the URL that works for a profile image:



Ah, that simple.  If this avatar is somehow unacceptable or too annoying in some way, please tell me, and I shall use the other one.

Thanks a bundle.

[Edit: Bugger that, it was annoying me.]

Mazur
« Last Edit: August 19, 2013, 06:34:06 am by Mazur »
Logged

Liberal Elitist

  • Bay Watcher
  • I'm more liberal than you are!
    • View Profile
    • The Liberal Crime Squad wiki

Ah, that simple.  If this avatar is somehow unacceptable or too annoying in some way, please tell me, and I shall use the other one.

Thanks a bundle.

[Edit: Bugger that, it was annoying me.]

Mazur

I'm not a moderator of these forums or anything like that, I don't have any authority here. So you don't need to ask me for permission to do anything on these forums, I'm just a regular user on these forums like you.

I found out about the https:// thing not working for avatar links because I recently changed my avatar and was trying to change it to an https:// link and had the exact same problem until I figured out that changing it to an http:// link got it working as an avatar on these forums. That's all.

Oh yeah, and I don't quite follow your feature request, could you try and explain it in more detail, it's a bit confusing. You want some new thing added to the user interface to set the default action for each member of the LCS, so that after getting back from a raid, they do their default activity, or you can have them temporarily do something else like an interrogation, but then go back to their default activity. And the default activity would be customizable by some kinda option. Is that what you're requesting?

Oh and being able to press Escape to get out of setting the slogan or to cancel other things would be a good idea, yes. I'm not exactly sure how to implement that, though. For instance, I think that when you do the thing to enter the slogan, the program calls a function for entering in a line of text, which probably has exclusive access to the keyboard, and I think it might be part of some standard C++ library and not really be customizable, so adding the feature of being able to press Escape to cancel, well there are key codes and such and it's rather complicated figuring out how all that stuff works.

To be honest, I mostly focus my programming efforts on the parts of the code I am able to understand really well, where I can spot bugs and make improvements. But the areas you're talking about aren't exactly my area of expertise in C++ programming. I mostly focus on how the game processes data, its algorithms, which functions call which other functions, what the variables do, the logic of the code. But input and output, I don't understand that as well. It's different in every programming language, after all. I have actually done more Java than C++ programming. Luckily the syntax of both languages is very very very similar. The main difference is how you declare a class and create objects of that class, the Object-Oriented part of the language. Java is quite more sophisticated when it comes to Object-Oriented stuff like classes. However, the downside is that Java programs are much slower than C++ programs, and require you to have Java runtime installed to run them, plus Java doesn't do as good a job as C++ at integrating with the operating system's APIs. C++ by its nature is prone to programs that have memory leaks, null pointer exceptions, etc. Java does not have these problems, but it is slower and its garbage collector, which takes care of all that stuff, takes up huge amounts of overhead, and you especially notice this in launch times, how soon after you click on a program's icon is the program up and running. Much faster with C++.
Logged
The Liberal Crime Squad wiki is your friend.

Quote from: Lielac
Edit: Figured it out via a little bit of trial and error and oH MY GOD WHAT IS THIS MUSIC WHAT IS THIS MUSIC WHAT THE HECK IS IT SPACEBALLS MUSIC? WHATEVER IT IS IT IS MAGICAL

Mazur

  • Bay Watcher
  • Mad as a March Hatter.
    • View Profile

Ah, that simple.  If this avatar is somehow unacceptable or too annoying in some way, please tell me, and I shall use the other one.

Thanks a bundle.

[Edit: Bugger that, it was annoying me.]

Mazur

I'm not a moderator of these forums or anything like that, I don't have any authority here. So you don't need to ask me for permission to do anything on these forums, I'm just a regular user on these forums like you.

I found out about the https:// thing not working for avatar links because I recently changed my avatar and was trying to change it to an https:// link and had the exact same problem until I figured out that changing it to an http:// link got it working as an avatar on these forums. That's all.

Oh yeah, and I don't quite follow your feature request, could you try and explain it in more detail, it's a bit confusing. You want some new thing added to the user interface to set the default action for each member of the LCS, so that after getting back from a raid, they do their default activity, or you can have them temporarily do something else like an interrogation, but then go back to their default activity. And the default activity would be customizable by some kinda option. Is that what you're requesting?

Sort of: the actual default action would be just what you have just set through the normal interface, then when you get back to the activate screen that lists the squad, you'd press [X] to toggle the "Set default activity" mode, then you press the letters for those persons whose current activity you want to be their default, until you've done all those you want to, press [X] again and you're back to normal "Assign activity" mode of the game as it is now.
Nyx has been playing with something along those lines, I think, but that version used separate screens for setting default activities, which I think requires copying all the "Assign activity" code, since "Making clothes" was not yet implemented; the way I just described is much simpler and requires only someplace to store the default activities and a function to copy the current activity to that, beside the minor interface addiction of X and Y.

Then if you come back from all the raids you just press [A], then [Y], and everyone who was had theirs defined are assigned their default activity.
That way you only set them for the raiders, for instance, and not for "office staff" like programmers, who'll keep laying low or hacking as you have them with regard to their current heat. And, as I said, I'd exclude changing those "Tending to injuries" as well.

Hm, since that is an activity you only need when there are wounded, and that's automatically set when you get home, one could use "Tending to injuries" to mean "No defailt activity set" if defining a separate pseudo-activity would not be preferred.

Oh and being able to press Escape to get out of setting the slogan or to cancel other things would be a good idea, yes. I'm not exactly sure how to implement that, though. For instance, I think that when you do the thing to enter the slogan, the program calls a function for entering in a line of text, which probably has exclusive access to the keyboard, and I think it might be part of some standard C++ library and not really be customizable, so adding the feature of being able to press Escape to cancel, well there are key codes and such and it's rather complicated figuring out how all that stuff works.

Yes, that might be tricky, but I can't help thinking that it must be possible somehow.  I'll look into it myself, maybe it's already possible, if I only find out how.  ;-)

To be honest, I mostly focus my programming efforts on the parts of the code I am able to understand really well, where I can spot bugs and make improvements. But the areas you're talking about aren't exactly my area of expertise in C++ programming. I mostly focus on how the game processes data, its algorithms, which functions call which other functions, what the variables do, the logic of the code. But input and output, I don't understand that as well. It's different in every programming language, after all. I have actually done more Java than C++ programming. Luckily the syntax of both languages is very very very similar. The main difference is how you declare a class and create objects of that class, the Object-Oriented part of the language. Java is quite more sophisticated when it comes to Object-Oriented stuff like classes. However, the downside is that Java programs are much slower than C++ programs, and require you to have Java runtime installed to run them, plus Java doesn't do as good a job as C++ at integrating with the operating system's APIs. C++ by its nature is prone to programs that have memory leaks, null pointer exceptions, etc. Java does not have these problems, but it is slower and its garbage collector, which takes care of all that stuff, takes up huge amounts of overhead, and you especially notice this in launch times, how soon after you click on a program's icon is the program up and running. Much faster with C++.

My own area of expertise used to be plain old K&R C, though most of my experience actually lies in shell scripts and basic Perl.  I was a systems programmer in a previous life, until they did not want me anymore.  I stupidly neglected to learn OO programming when I was much younger, at its beginning.
Logged

Mazur

  • Bay Watcher
  • Mad as a March Hatter.
    • View Profile

Since I saw you mention the problem about entering a new slogan by mistake elsewhere, I'll write what I found out about it here and now.

It is like you said, a library function that gets called.  There are two ways to get out of this: CTRL-C (which sends a SIGINT) and CTRL-\ (which sends a SIGQUIT).  Both, however, currently immediately terminate LCS.  One could do two things here: replace the library function by reading single characters at a time, until ENTER or RETURN is encountered and end the loop without saving the newly read line if ESCAPE is read.  The other way would be to use a signal handler to catch SIGINT and continue after the enter_name function, again without saving the new line (easiest way is setting a bool variable to "do save" just before the "enter_name" and setting it to "don't save" in the signal handler before returning, I reckon).

I also had a go at modifying basemode/activity.cpp according to my notion, only to discover there has not as yet been defined a way to compare temppool[p]->defaultactivity != ACTIVITY_HEAL or
temppool[p]->defaultactivity == ACTIVITY_HEAL.

Since I do not know C++ I'm not too keen as yet to try and alter the appropriate definition to include those.  So that may take a few days more.
« Last Edit: August 28, 2013, 01:25:30 pm by Mazur »
Logged