Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.


Messages - Snarky

Pages: [1] 2 3 ... 279
1
Has the President blocked Congress from having any restrictions on people bringing guns into the Capitol?
Has the President somehow blocked members of Congress from having security/police protection (either individual or in the Capitol)?

2
I am really sorry for not reading manual throughout, but I'm short on time. Demo is due tomorrow, and after that I will focus more on manual reading and script playing :-D

Yeah, OK, but don't you think it would be quicker to look up stuff like this in the manual after all? If you'd just pressed F1 and done a search for "InputBox" (we're talking literally less than ten seconds, here), you would have seen:

Quote
static String Game.InputBox(string prompt)

Pops up a window asking the user to type in a string, with PROMPT as the text in the window. Whatever they type in will be returned from this function.

This command displays a very basic input box, mainly useful for debugging purposes. Due to the size of the window, only small strings up to about 20 characters can be typed in.

The recommended way to obtain user input is to create your own GUI with a text box on it, which allows you full customization of the look of the window.
(My emphasis)

In other words, you can't edit it. Instead you should create your own GUI with the text box, label and buttons you want (let's call it gInput, with lblInput, txtInput, btnOkInput and btnCancelInput), and set its Visibility to "Popup modal" (which means that the game blocks whenever it is visible).

Hook up the OK and Cancel button click events like this:

Code: Adventure Game Studio
  1. btnOkInput_OnClick(GUIControl *control, MouseButton button)
  2. {
  3.   gInput.Visible = false;
  4. }
  5.  
  6. btnCancelInput_OnClick(GUIControl *control, MouseButton button)
  7. {
  8.   txtInput.Text = "";    // Don't use the input entered
  9.   gInput.Visible = false;
  10. }

And finally write a function that will display the box and return the content of the text box:

Code: Adventure Game Studio
  1. String CustomInputBox(String prompt)
  2. {
  3.   lblInput.Text = prompt;
  4.   gInput.Visible = true;  // This should block until Visible is set to false
  5.   return txtInput.Text;
  6. }

Now you can just call CustomInputBox() instead of Game.InputBox().

3
Perfect, just what I was looking for. Thanks!

4
Umm, wow! Thanks – I guess my next question is how Trans100ToAlpha250() (250, WTF?) is implemented, but I'll see if I can find it in code myself. (Edit: Oh, you changed it. Thanks again!)

I should also have been more precise: I am particularly interested in how it works in DrawingSurface.DrawImage().

5
I have a question for the engine experts. In 32-bit, AGS allows you to set the transparency of various things and drawing operations as a percentage (0-100). However, 32-bit color actually uses an 8-bit alpha channel internally (0-255). Do you know how this is mapped?

For example, if I set the transparency of a GUI to 3%, am I really setting it to the closest alpha value, 8? (8/255 = 0.03137..., or about 3.14%). Is this calculated as (in AGS syntax) int alpha = FloatToInt( IntToFloat(percentage)*255.0/100.0, eRoundNearest), or some other way?

6
The Rumpus Room / Re: *Guess the Movie Title*
« on: Yesterday at 17:55 »
Almost Famous?

7
Names of exported variables and functions are recorded for some reason

Used in error messages, perhaps? Maybe I'm confusing what you see when the game crashes with the debugger and what you see when it crashes outside it, but I seem to remember that you see the name of the function where the crash happened? (And perhaps the name of the script? I actually thought you get the line number as well, though I don't understand how that can be available after compilation.)

8
Has it been made legal (or not-to-be-prosecuted, at least) to shoot politicians/members of Congress?

9
Haha, I’ve actually been an AGS user for more than 5 years, and I really like it! But I decided to go with Visionaire for this project because of the stagnant development that was a few months back. Not sure how the status is now though? Has AGS found another lead developer?

I don't know about stagnant; Crimson Wizard, Alan v. Drake and others have been plugging away at the engine pretty regularly: over the last year there have been 4 stable releases (various patches to 3.4.0), and 3.4.1 is currently at RC stage and should be made official very soon. It supports switching between window and full-screen modes on the fly, fixes two long-standing bugs in Direct3D mode, and adds an OpenGL renderer. In my book this takes care of most of the biggest problems AGS has suffered from in the last ten years (leaving platform compatibility, which is improving, and savegame compatibility across game updates, which is being considered).

10
You can't, really.

The easiest way is usually to just call the function just before you exit the dialog, like Thanyx explained. By indenting the line with a space, you can call regular AGS script functions from the dialog.

There's another way that can be useful if you have something that should happen for many/all dialogs, but it's a bit more complex, so only proceed if you really need it....

Add spoiler tag for Hidden:
You can use a flag that keeps track of whether you're in a dialog (or better, what dialog you're in). The way this works is that you have to create a wrapper function that sets the flag when you start the dialog, and always call that instead of Dialog.Start(). You can use a script module like this:

Code: Adventure Game Studio
  1. // Dialog Extension Header
  2. import Dialog* CurrentDialog(static Dialog);
  3. import Dialog* Finished(static Dialog);
  4. import void StartCustom(this Dialog*);
  5.  
  6. // Dialog Extension Script
  7. Dialog* _currentDialog;
  8. Dialog* _finishedDialog;
  9.  
  10. Dialog* CurrentDialog(static Dialog)
  11. {
  12.   return _currentDialog;
  13. }
  14.  
  15. Dialog* Finished(static Dialog)
  16. {
  17.   return _finishedDialog;
  18. }
  19.  
  20. void StartCustom(this Dialog*)
  21. {
  22.   _currentDialog = this;
  23.   this.Start();
  24. }
  25.  
  26. function repeatedly_execute()
  27. {
  28.   // repeatedly_execute() doesn't (normally) run during dialogs,
  29.   //so this will only set currentDialog to null once the dialog is over
  30.   _finishedDialog = _currentDialog;
  31.   _currentDialog = null;
  32. }

Now in your code you can do something like:

Code: Adventure Game Studio
  1. function cNeighbor_Interact()
  2. {
  3.   dNeighbor.StartCustom();  // Start the dNeighbor dialog, making sure we track it by using .StartCustom()!
  4. }
  5.  
  6. function repeatedly_execute()
  7. {
  8.   if(Dialog.Finished() != null)
  9.   {
  10.     // Things you want to do any time ANY dialog has finished
  11.   }
  12.   if(Dialog.Finished() == dNeighbor)
  13.   {
  14.     // Things you want to do any time the dNeighbor Dialog in particular has finished
  15.   }
  16. }

(Code untested, there may be bugs)

12
Are politicians at higher risk because they are more unpopular than before?
Are politicians at higher risk because there's a reduced disincentive against shooting them? (E.g. less chance of punishment/being killed?)
Are politicians at higher risk because the incentive to shoot them has increased? (E.g. a bounty on members of Congress, or a rule that says if you kill a Congressman you get his seat)
Do politicians fear being shot by partisans of the opposing political party (Democrats by Republicans, Republicans by Democrats)?
Do politicians fear being shot by other politicians?

13
There's a brilliant module by SSH that takes care of that work for you, Cassiebsg: MultiTextBox! Just import it and it works quite automatically, by what I assume must be dark magic. (You have to make one small change since the number of GUIs is now unlimited, but other than that it works great. I'd nominate it, along with Tween, as one of the must-have AGS modules.)

Anyway, I don't think that's the problem Slasher is having, although I don't really understand what actually is.

14
In C++ it is done with "..." in parameter list, which means "any number of parameters of unknown types".
AGS can't do that. Also AGS does not have a way to translate unknown number of parameters to formatted string.

E: Ahaha, actually AGS CAN do that:
Code: Adventure Game Studio
  1. function aa(int x, ...)
Dunno how that will work though. And I don't see a way to GET those params when in the function.

Just reviving this thread to check that there isn't an update to this. It's still not possible to actually access these indeterminate parameters in AGS, right?

(Keywords for thread search: variadic function, params array, varargs, variable arguments)

15
Beginners' Technical Questions / Re: inverted icon???
« on: 13 Nov 2017, 22:31 »
Should i delete this thread now or?

No. We leave the threads up so that if someone else has the same problem and searches for it, they'll be able to find the answer.

16
The Rumpus Room / Re: Happy Birthday Thread!
« on: 13 Nov 2017, 20:31 »
Thanks, good folk!

17
General Discussion / Re: Trumpmageddon
« on: 13 Nov 2017, 08:58 »
Surprisingly, the qualities that make for an effective internet troll don't necessarily make a good president. Who'd've thunk?

18
Are politicians' fears well founded?
Has the objective danger of gun violence aimed at politicians objectively increased?
(If so) is the increase in violence ideologically based?

19
That's three pull downs that most players will not understand. So I don't think it's convenient.

This situation has no solution without separate scaling setting for windowed mode.

Good design makes things as simple as possible, and no simpler. The best thing would be to be able to resize windowed mode on the fly, but as long as that's not possible, yeah, we do need separate settings.

20
One thing that's starting to bug me about Discovery is that it's so dark. (Dimly lit, I mean.) Early on there was an excuse in that the captain's eyes couldn't handle bright lights, but that doesn't seem to be an issue any more, yet the whole ship is still on dimmer. There's a not-so-fine line between moody and just underlit.

Quote
If you enjoy it, good for you, but I hope it's canceled soon.

I can understand why you don't like it and why folks don't like Discovery. But I wouldn't wish cancellation on either as there are people who enjoy one or the other or even both.

Usually I'm happy to just ignore a show and be happy for the people who enjoy it. But I found The Orville so wretched that I was hoping it would fail utterly, to serve as an example and warning that there are limits to the sort of crap you can put on TV. No such luck, though – it's been renewed.

You have to learn to not be so critical and just enjoy something for what it is.

That's the interesting thing: no, you don't.

Pages: [1] 2 3 ... 279