Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - HovSky

#1
Quote from: Gurok on Sat 18/11/2017 01:57:46
You can use Game.InputBox for this. From the manual:

Code: ags
String name = Game.InputBox("!What is your name?");


If you put an ! before the prompt, both an OK and Cancel button will be shown. Remove it to just show the OK button.

Thank you...
Continuing on last question, how can i edit this GUI. It doesn't show on project tree?



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
#2
Is it possible to create type in boxes in AGS. Lets say player comes to a door and now has to type in a password. Main thing is that the answer is not like a dialogue option, but player has to enter it from memory.
#3
Quote from: Snarky on Wed 15/11/2017 14:45:49
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....

Spoiler
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: ags
// Dialog Extension Header
import Dialog* CurrentDialog(static Dialog);
import Dialog* Finished(static Dialog);
import void StartCustom(this Dialog*);

// Dialog Extension Script
Dialog* _currentDialog;
Dialog* _finishedDialog;

Dialog* CurrentDialog(static Dialog)
{
  return _currentDialog;
}

Dialog* Finished(static Dialog)
{
  return _finishedDialog;
}

void StartCustom(this Dialog*)
{
  _currentDialog = this;
  this.Start();
}

function repeatedly_execute()
{
  // repeatedly_execute() doesn't (normally) run during dialogs,
  //so this will only set currentDialog to null once the dialog is over
  _finishedDialog = _currentDialog;
  _currentDialog = null;
}


Now in your code you can do something like:

Code: ags
function cNeighbor_Interact()
{
  dNeighbor.StartCustom();  // Start the dNeighbor dialog, making sure we track it by using .StartCustom()!
}

function repeatedly_execute()
{
  if(Dialog.Finished() != null)
  {
    // Things you want to do any time ANY dialog has finished
  }
  if(Dialog.Finished() == dNeighbor)
  {
    // Things you want to do any time the dNeighbor Dialog in particular has finished 
  }
}


(Code untested, there may be bugs)
[close]

This seems really usefull, and will test it definitely.

Quote from: Thanyx on Wed 15/11/2017 14:31:28
Hello,

I'm not sure if I understand your question correctly. But in general, if you want to add a code inside a dialog, you can just SPACE or TAB to a side and start writing.
When you tab or space in dialog section in AGS it will start writing a code.

Example:
Code: ags


@S
Ego: Hello
Guy: Hi

1@
Ego: How are you?
Guy: Im fine.
    
    cYou.Walk(120, 35)
    cYou.FaceDirection(eDirectionLeft)

Ego: I like your picture on the wall.
Guy: Yeah, I painted it.

return



Thank you for such a fast reply, everything works as i imagined :-D
#4


Hello,
how can I initialize a function after a dialog option?
Started with specific problem, but if I know it in general will help me immense.

Thank you :)
#5
oh my god. Thank you. Real life saver.
Should i delete this thread now or?
#6


Hello,

I have a problem with importing sprites. Made this walking icon in color, black footsteps empty background, white empty background, black footsteps white back,etc. nothing seems to work... i only get white background no matter what i do...

bottom right is photoshop file,
top is sprite manager
bottom left is what i get ingame...

please help
#7
Managed to solve first problem by placing dummy unit to act as an anchor for text displayed on its head, and positioned it as i want.

also made a GUI for option display, but how can I make it that that gui is only shown when options are shown (only in dialog)?
as of now, I can only make it always shown, or never shown...
#8
Quote from: Monsieur OUXX on Fri 10/11/2017 12:51:45
player.SayAt(...) (or <any character>.SayAt)
Type SayAt in your script, highlight it, and press the F1 key to get the details

global script, room script or dialog tab?
#9


Hello,
I am fairly new to using AGS and couldn't find help in the manual or online. My problem is that the dialog text seems to appear in random places. The text in picture is said by playable character, which is hidden, so I would like if i could show that text in bottom middle of the screen, or more preferable in dialog GUI.
Which brings me to another problem, how can I make dialog gui, and make it always shown? I am using roger game template, but none of presented GUIs is for dialogs.

Thank you for your time.
SMF spam blocked by CleanTalk