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 - Wolfgang Abenteuer

#41
It should work.  I just tested something like that and it worked for me.  Maybe instead of declaring the string in the repeatedly_execute part of the script you should declare it at the beginning of the script instead?  Also make sure that your label font colour isn't the same as the GUI background colour.  Otherwise, it should work just the way you have it.

~Wolfgang
#42
Just take it a step further, then.  Make more than one dialogue topic, (not option, but topic), and have one run the next.  Say, you have the two dialogue topics set up as such:

Topic 1:

@S
return
@1 //Hello
run-script 1
@2 //Goodbye
charid: See ya 'round!
stop

Then topic 2 would look like this:

@S
return
@1 //Yes
charid: Well, you sure don't look like it.
stop
@2 //No
run-script 2

You could even make a third topic:

@S
return
@1 //New York
charid: Go Yanks!
stop
@2 //Boston
charid: Go Sox!
stop
@3 //Minnesota
charid: Go Twins!
stop

In the global script (which you're going to have to dig into eventually to get this to work right ;) ), add on to what I posted above with something like this:

function dialog_request(int dialog) {
 if (dialog == 1) { //say Hello
   DisplaySpeech(CHARID, "Greetings!");
   Wait(40);
   ChangeCharacterView(CHARID,1);
   DisplaySpeech(CHARID, "You're not from around here, are you?");
   RunDialog(2);
 }
 if (dialog == 2) { //say No
   DisplaySpeech(CHARID, "Didn't think so.  So where are you from?");
   RunDialog(3);
 }
}

Sorry if that's a bit confusing, but once you get the hang of it it's a piece of cake!  Basically, if you ever want to do any "normal" functions in a dialogue, just use dialog_request and type it out like you would any normal script.  The RunDialog(#) will run the topic number specified, so in this case, if the player clicked "No" when the guy asks if you're from around here, it would display the speech listed, then run the next dialogue (dialogue topic 3 in this example).  This can be carried out as far as you want, just using RunDialog to bring up the next topic.

Edit:  Of course, if you're not planning on adding any other sort of things in between two given dialogue topics, such as character view changes or other complex things, you can just use the dialogue script command goto-dialog x, where X is the number of the dialogue topic you want to go to.  In my example above, the "run-script 2" could have just been replaced with:

charid: Didn't think so.  So where are you from?
goto-dialog 3

but you probably already know that much.  Just didn't want to make it seem like I was over-complicating it for you! ;)

~Wolfgang
#43
You can do virtually anything you want within a dialogue option.  Just use the run script command for the option and put everything in the dialog_request section of the global script.  Like:

@S
return
@1
run script 1

//global script

function dialog_request(int dialog) {
 if (dialog == 1) {
   DisplaySpeech(CHARID, "Greetings!");
   Wait(40);
   ChangeCharacterView(CHARID,1);
   DisplaySpeech(CHARID, "You're not from around here, are you?");
 }
}

That would make him say something, then change the view to another pose, then say something else, etc.  This can be done using any number of dialogue options, really.  It's all up to you!

~Wolfgang
#44
Just do it like a normal "if" statement, like:

if (keycode == 32) {
Display("You just pressed the Spacebar.");
}

Then go into your game and press the spacebar and that message will show up.  To find the keycode that corresponds to the different keys, go to the AGS help file and search for "on_key_press".

~Wolfgang
#45
Be sure you've checked the "Object is initially visible" button in the room editor, or if it's not initially visible, check the code that you use to turn it on.  Also be sure that its baseline is set properly and it's not behind any walk-behind areas.

~Wolfgang
#46
function dialog_request(int blah) {
if (blah==0) {
}
else if (blah==1) {
AddInventory(1);
if (GetGlobalinit(4)==1) {
SetDialogOption(4,5,1);
}

That will turn on dialogue option 5 on topic 4.  The "1" at the end turns it on.  Pass a "0" instead if you want to turn an option off and a "2" to turn an option off forever (even a "1" won't turn it back on).

~Wolfgang
#47
I believe the newest version of AGS has a dialogue function Add-inv X that will handle that for you.  For example:

@1
man: Here, have a cookie!
Add-inv 3 //Item number of the cookie
return

Edit:  Brain fart.  Add-inv was always there.  Lose-inv is the new addition. :P  So, yeah, the code above should work.

~Wolfgang
#48
Advanced Technical Forum / Re:GUI problems
Thu 07/08/2003 04:09:43
...Alright...now it's not doing it.  Urgh...I'm absolutely positive it used to do it to me, but for some reason it's not doing it now!  Well, time for the men in white coats to take me away, I guess! :p  Sorry about the hassle, guys!

~Wolfgang
#49
Advanced Technical Forum / Re:GUI problems
Wed 06/08/2003 22:52:05
if (interface == 4) {
if (button == 0) {
GUIOff(4);
GUIOff(3);

}
}

That's because that code turns off both GUIs.  The problem only arises when one is turned off and another one is turned on immediately thereafter.  IIRC it works if you turn off a GUI and display a message at the same time as well.  Like:

GUIOff(3);
Display("Hello there.");

I think I did something like that once and it had the same problem, but don't quote me on that.

~Wolfgang
#50
Advanced Technical Forum / Re:GUI problems
Wed 06/08/2003 20:02:33
Correct.  A code as such:

GUIOff(3);
GUIOn(4);

will turn on GUI 4, make it interactive, and overlay it on top of the graphic for GUI 3, and make GUI 3 un-interactive.  The graphic for GUI 3 won't clear from the screen until something else happens, that makes the screen refresh (again, just a guess at that part).  In fact, it may be possible by making a handful of GUIs whose only purpose is turning on other GUIs, and seeing if you can "stack" GUI graphics as such.  Like have a button on GUI 3:

GUIOff(3);
GUIOn(4);

then make one on GUI 4:

GUIOff(4);
GUIOn(5);

etc. and have each consecutive GUI be either a smaller size or popup in a different location than the preceding one.  I don't know if that would work as I've never tried it, but it would illustrate the point if it does.

~Wolfgang
#51
Advanced Technical Forum / Re:GUI problems
Wed 06/08/2003 19:19:59
It turns off the next time you interact with the "new" GUI, either by pressing a button or turning it off also (basically, anytime something happens that forces the screen to refresh itself).  I'm guessing that when the new GUI turns on immediately after the old one is turned off, since there's no pause inbetween, the screen does not redraw in that amount of time.  Note that the old GUI isn't interactive at all, so any buttons on it that may still be visible are no longer clickable, etc. which means that the game code has turned off the GUI, but it just shows the graphic so the monitor still thinks it's there (at least, in part). Putting the Wait(1); in there allows the screen time enough to redraw itself (without the old GUI on it) before putting up the new GUI.  That's just a guess, though.

~Wolfgang
#52
Advanced Technical Forum / Re:GUI problems
Wed 06/08/2003 07:25:39
Hmm, that should work.  Like MachineElf said, make sure these are all in the interface_click function.

Code: ags

function interface_click(int interface, int button);
if (interface == 3) {
  if (button == 0) {
    GUIOn(4);
  }
  if (button == 1) {
    GUIOff(3);
  }
}


And make sure both the buttons are set to "Run Script" as left-click (like you do for button 0), and make sure the GUI itself is set to clickable (there's a tickbox on the top of the GUI options tab for each GUI).  Aside from that, it should work.  I have something similar to that in mine and it works just fine.  *shrugs*

Edit:  And, no, you shouldn't have to write anything after the GUIOff(3); to go back to the main screen.  I'm curious, though...why do you have a couple of things as (...) there?  Those are the width/height, and font/text colour for the button.  Maybe you need to specify a width and height for the button (or did you just not include the values in your post)?

~Wolfgang
#53
Advanced Technical Forum / Re:GUI problems
Tue 05/08/2003 23:50:43
Ah, I see what you mean.  The reason I had to add the Wait(1); was because the two different GUIs were either different sizes or I had them popup at different locations, so the new one would overlap the old one without covering it completely and you'd be able to see the uncovered part of the old GUI under the new one.  The Wait(1); command I put in there allowed enough time for the screen to clear the old GUI before putting the new one up.  Obviously, if the new GUI completely covers the old one then the Wait(); is not necessary.

Sorry about the confusion! ;D

~Wolfgang
#54
Advanced Technical Forum / Re:GUI problems
Tue 05/08/2003 22:07:44
Actually, in my experience, if I don't put a Wait(1); between the GUIOff() and GUIOn() lines, it'll "turn off" the first GUI, but won't actually clear it from the screen before it turns on the second GUI.  Functionally, it's fine, but aesthetically it's kind of bad.  I guess the script runs faster than the screen refresh rate for me.  *shrugs*

~Wolfgang
#55
Advanced Technical Forum / Re:GUI problems
Tue 05/08/2003 20:25:47
Be sure that you go to the GUI settings and 1) make the GUI clickable and 2) be sure that each button is set up to "Run Script", otherwise it won't do anything when they're clicked on.

BTW if you're making a GUI turn on another GUI, you my want to have it first turn off the current GUI and pass a Wait(); command, otherwise the new GUI will overlay the old one and it may look kind of messy.  That's just an asethetic suggestion, though.

~Wolfgang
#56
You could try something like this:

@S
return
@1
character: blahblahblah
run-script 1

function dialog_request(int value) {
if (value == 1) {
NewRoomEx(2,160,100);
}
}

Or is that how you already have it?

~Wolfgang
#57
Options or topics?  You've already run up against the option limit, so I'm guessing you're referring to topics instead.  2.55 has a limit of 200 and 2.56 has/will have a limit of 500.

~Wolfgang
#58
When you bring up an inventory window GUI, it pauses the game.

if (IsGamePaused() == 1) {
// Game is paused, so do nothing (ie. don't allow mouse click)
}

This line tells the game not to accept any mouse clicks while the game is paused.  Try moving your inventory interaction inside of those brackets instead, like such:

if (IsGamePaused() == 1) {
 if ((button == LEFTINV && game.inv_activated == 1)) {
 RunDialog(7);
 }
}

~Wolfgang
#59
Try this:

// dialog script file
@S // dialog startup entry point
return
@1 // option 1
run-script 5
stop
@2 // option 2
run-script 6
stop
@3 // option 3
run-script 7
stop

Then, in your function dialog_request:

if (parameter == 5) {
RestoreGameDialog ();
}
if (parameter == 6) {
SaveGameDialog ();
}
if (parameter == 7) {
QuitGame(1);
}

That last part should go right above the last "}" in your function dialog_request code.

~Wolfgang
#60
To be able to do more elabourate events within a dialogue, you need to create a script.  Create the following function at the end of your global script:

function dialog_request(int value) {
}

That allows you to do something more advanced in the dialogue scripts than just talking.  Now, when you have a dialogue option that you want to do something special on (like teleporting to another room), you'll have to set up the dialog with a run-script command.  Your dialogue topic script should look something like this:

@S
@1
character: "What is happening to me?"
run-script 1

What that does is when the player selects dialogue option #1 from this particular topic, the person named "character" (the character's name is what you set it up as in the "Characters" folder) will say the line, "What is happening to me?", and then it will run script #1.  Script #1 is the script that is defined in the function dialog_request you set up earlier.  It should now look like this:

function dialog_request(int value) {
if (value == 1) {
NewRoom(2);
}
}

Note that the integer "value" is set at 1, which is the same number you entered in the "run-script" command in the dialogue script.  If you type "run-script 2" instead, then you would need to change the statement in the function to "if (value == 2) {", and so forth.  The NewRoom(2) will place the character in room 2.

Obviously, all of these numbers are changeable, so if you wanted them to go to, say, room 10, you would type NewRoom(10); instead.  The important thing to note here is that the run-script value and the function dialog_request value must match for it to work.  If they are different numbers then AGS won't know what to look for.

~Wolfgang
SMF spam blocked by CleanTalk