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 - T800System

#1
Sorry about the quoting, it's common practice at a lot of other forums I've used but I will make sure not to do it here.

Thanks a lot for taking the time to help me, Khris. I tried that code and it does indeed work. I think I had best have another read of the manual - hopefully I won't need to script anything as tricky as this for a while though.

oh & @ Ghost: yeah, I've watched most of densming's tutorial videos and I found them to be very helpful, but really they only cover the basic features. I am trying to not get ahead of myself and just stick to the basics. I'm sure you can appreciate that when you're new to the program and you want to script something like GUI fade-ins, it can be quite daunting - and I wasn't having much luck doing it myself, even after trawling through dozens of older forum posts and the manual - so that's why I made this thread. But you have all succeeded in helping me and it is working now, so many thanks for that :)
#2
Quote from: Ghost on Wed 09/01/2013 01:00:22
Yes. Open your global script, and somewhere at the top create the OpenInventory() function. It doesn't really matter where you put it, but any function that uses OpenInventory() must be below!

Think of a function as a "building block". You want to keep them simple in order to build something larger from them. With a function that opens the inventory, you can re-use it over and over. If you later decide to add a different fading effect or use an altogether different GUI, you only need to change your code ONCE (in the function).

AGS uses event handlers for when buttons are clicked or a dialog starts. You can put any code into an event handler. So just set up your dialog GUI, create your options, set up the proper event handlers, and then call your "OpenInventory()" from there.

This is pretty basic stuff but it'll get you a long way.  (nod)

Sorry, I still don't understand :P Are you just using OpenInventory() as an example? I don't see how getting a GUI to fade in has anything to do with opening an inventory? O.o

I applaud you for taking the time to explain it to me, but could you perhaps explain it again - this time as if it was to someone with no history of scripting? :P
#3
Quote from: Ghost on Wed 09/01/2013 00:34:54
That depends. Do you want to use this code repeatedly, for example whenever the player clicks an "open inv button"? Then it would go into the global script, probably as a function of its own:

Code: ags

function OpenInventory()
{
    // code
}


This will allow you to call the function from anywhere (from other functions in GlobalScript AND from rooms AND from other script files).

Room scripts are specific to a room- so you could put it there, but then only call it in that very room- relatively useless.  ;)

I want it to come on every time the player is presented with dialog option. My dialog options are presented using a GUI, so I want them to fade in. Does this code need to be part of a function then?
#4
Quote from: Ghost on Wed 09/01/2013 00:15:03
Code: ags

gMainTitle.Transparency = 100;
int trans = gMainTitle.Transparency;
while (trans > 0)
{
	trans--;
	gMainTitle.Transparency = trans;
	Wait(1);
}

This is code from a WiP of mine, and it compiles and works perfectly- almost the same as your code.

For transparency, 0 is "fully visible" and 100 is "totally invisible", so to fade the GUI IN you must set its transparency to 100, though this doesn't explain why your code doesn't compile...

Interesting, I will try this.

This may be a stupid question, but I'm a noob to AGS and so I'm entitled to ask it :P Where am I supposed to be putting this code? In the room script file or the global script?
#5
Me again :X Sorry, but I'm having trouble with getting my GUI to fade in?

I'm using this line:

int trans = gInventory.Transparency;
while (trans < 100) {
  trans++;
  gInventory.Transparency = trans;
  Wait(1);
}

(with amended gInventory to correspond with my GUI name)

Every time I try to test it, the game won't load and says there's a compilation error. "Expected integer value after "=""

Thing is, when I put a number after the "=" it still won't work, and says that it expected a "," or ";" and not "gInventory". So, I try both a "," and a ";" - and still, no dice. It just says "unexpected gInventory" after that.

Can anyone enlighten me as to what I'm doing wrong here? Thanks :Z
#6
Quote from: Khris on Tue 08/01/2013 20:21:39
If you need to get a bit more sophisticated, you can render the dialog options GUI yourself:
http://www.adventuregamestudio.co.uk/manual/CustomDialogOptions.htm

Awesome, thank you.
#7
Aha! I was just trying this and then you replied confirming it :) And just as I saw it was working; a new question entered my head - and that was how I could specify where the text would sit in the GUI. And you have preemptively answered that with the game dialog options. Brilliant!

Thank you very much, mate!
#8
Hey, I'm having trouble trying to position my text window GUI. It's for a dialog option, which I want to position at the bottom centre of the screen. Obviously to do this I have set "Use GUI for dialog options" to 1 (which corresponds to the GUI number that I want to use) in the general settings.

In my first (and only) room script, I've got the following regarding this dialog option:

    gTestgui.SetPosition(10, 10);
    dBartender.Start();

The setposition code isn't doing anything to move the dialog options to where I want them. They're just staying centred. Could someone tell me what I'm doing wrong please?

Thank you in advance
#9
Quote from: bicilotti on Sat 05/01/2013 22:56:16
Yes it is possible, as The Oracle gracefully shows.

One invisible char (to call player.changeRoom() when needed) and you're done.

Thank you very much pal! :)
#10
Is it possible to make a game using AGS that doesn't make use of the character feature? My game is going to be a first person adventure game, where the player just has to point and click on objects to examine in environments they are confronted with, and interact with characters they meet in these environments. These characters will be part of the background image, however - they won't be sprites.

So is this possible?
SMF spam blocked by CleanTalk