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

Pages: [1]
that makes a lot of sense, thank you. This is what happens when you have to rely on wiki stuff, heh. I appreciate you explaining something that rudimentary.
I gave it a spin and it seems to work perfectly so I can appropriate the GUI for other things later on. Thanks again, hopefully this can help others too.

I didn't think getting the GUI to show would've been harder for me than the actual saving and quitting code :P
thanks again.

I've been searching for at least 3 days in the forums, the wiki, and on google for a solution to this and sadly, most of the topics in the forum for it have out-of-date code, or links to things on websites that are no longer functional, or forum posts that end with replies like "fixed it- thanks!" or "search the forum, silly!" with no other details. It's been difficult scouring for a solution, and what I'm after seems much more simple than the very complex questions I'm finding, so maybe someone can help me out:

in the default game, there's a lot of game GUIs that happen when you press the F keys or ESC or Tab, or that direct to OTHER guis. I don't want to use any of those(not even an inventory. it's mostly an exploration game) and just want one simple catch-all GUI that can be triggered by pressing, say, Space or Tab or something. It would display "save" "load last save" and "quit", and that's all. That's all I want- every tutorial and script example and question and custom module I can find all have to do with an array of saves, or naming your saves, or adding screenshots, or dealing with all these different GUIs for each of these, and the code is so complex I don't know how to delete what I don't need and use it for my purposes- I just want a single extremely simple looking one. If an array of saves is all that exists, I'd be fine it re-writes the save over and over again. A great tip I found was to just appropriate code from the default "gPanel" gui, but that's only gotten me so far. Yes, I have read the Wiki, searched the forums(most examples are from the 00s at this point), and used f1, heheh

what I have so far in the global script, is very simple code wherein if I press tab, a GUI will pop up with 3 options: to save, load previous save, or quit. My goal is to eventually also use pretty much the same gui as the title screen (without 'save', of course). Hopefully this would let players load their last save when they start the game up, and save their position in the game whenever they like by toggling this "gSaveScreen" with Tab. On game load, it's set as not visible. So then...

Code: Adventure Game Studio
  1. function on_key_press(eKeyCode 9)
  2. {
  3.    gSaveScreen.Visible = true;
  4.   if ((keycode == eKeyTab) && gSaveScreen.Visible) {
  5.     // Use tab to turn the panel off.
  6.     gSaveScreen.Visible = false;
  7.     mouse.UseDefaultGraphic();
  8.   }
  9. }
  11. function guiSaveBtn_OnClick(GUIControl *control, MouseButton button)
  12. {
  13. SaveGameSlot(48);
  14. guiGameStatus.Text("Game Saved!");
  15. gSaveScreen.Visible = false;
  16. }
  19. function guiLoadBtn_OnClick(GUIControl *control, MouseButton button)
  20. {
  21.  RestoreGameSlot(48);
  22.  guiGameStatus.Text("Game Saved!");
  23.  gSaveScreen.Visible = false;
  24.  }
  26. function guiQuitBtn_OnClick(GUIControl *control, MouseButton button)
  27. {
  28.  SaveGameSlot(48);
  29.  guiGameStatus.Text("Game Saved!");
  30.  Wait(40);
  31.  QuitGame(1);
  32.  }

Running this, I get an error with the very first line, that the keycode isn't valid, and I don't know what to do there- as far as I know, this is correct. trying on_key_press "(int 9)" doesn't work, "(eKeyCode 9)" doesn't work, "(eKeyCode eKeyTab)" doesn't work. Different examples I've searched for give all of these as workable code, so I don't know which to use.
I understand "show_save_game_dialog();" exists already, but I have no idea how to relate that to opening this GUI, or if I even need to since these three actions are all I need. And just to be sure: the save state "48" doesn't mean anything, it's just a randomly chosen number.

the sheer number of threads I've been cycling between for a while now is driving me crazy and I want to get this simple thing out of the way before I go forward any more with my game- if I can't figure out how to save or load, then it's pointless to continue isn't it? I do want to finish this, though, so thank you for helping me out. If it comes down to it I would be willing to pay for direct help with this because this is a bit of a bottleneck. Sometimes the easiest things to do are the hardest for a beginner- I can't search for the answer if I don't know what the problem is, you know?


hey! this is awesome!
however I noticed a tiny issue: I gave the game I was working on a try in this new engine and while everything is working swimmingly, without changing any code whatsoever, I've noticed that when starting a dialogue with options, all the dialogue options are completely greyed out now. I can't click them at all. Before they would highlight and I could click to choose them but now they stay there, inescapable until I close the game. I can't choose any of them.

Is there new code or something with the dialogue system? I can't imagine what's changed on my end, as I opened the game directly and gave it a test and this was how it turned out. Let me know if I should ask about this elsewhere but I think the issue might be with the new version, and something to do with rendering the dialogue or finding which is active.. thank you in advance!

edit: I am using the custom options script detailed here.

edit 2: I tried an old backup and yep, exact same code as before- it worked in the last version(3.3.4), but not in the new one. Nomatter what room, or dialogue module, it just won't seem to respond to my mouse-over so I can't select a thing. Thanks again

edit 3: I think I fixed it by changing an option in General Settings! under Backwards Compatibility, you can set "old style custom dialogue options API" to true, and everything works again.

I'll leave all this diatribe here in case someone else has my problem. Sorry guys! 8-)

Khris, thank you so much! What a simple solution! I didn't think I could use one function inside the other.

It works like a charm! Thank you again! 8-)

thank you for your help everyone!

This should work:
Code: Adventure Game Studio
  1.   while (!mouse.IsButtonDown(eMouseLeft)) Wait(1);

I gave this a try and it works, but only for the first message. if I have multiple dialogues one after another, if I click to advance, it just just skips all other dialogues and terminates.

could it be a problem with the other part of the code, that defines what the dialogue is(last part of my main post)?

Hi there.

I have a custom-ish dialogue script, cobbled together with the gracious help of threads on here!
Basically it displays a profile picture gui that you can position with a boolean, a background gui, and a text until a player clicks the mouse to advance it on to the next dialogue line.

Code: Adventure Game Studio
  1. void DisplayDialogue(this Character*, String message, bool isprofleft, int textcolour)
  2. {
  3.    Dispgui.Visible = true;
  4.   gBottomBar.Visible = true;
  5.   gDialogue.Visible = true;
  7.   TextDialogue.Text = message;
  8.    TextDialogue.TextColor = textcolour;
  10.     if (isprofleft == true)
  11.   {
  12.     Dispgui.SetPosition(45, 250);
  13.   }
  14.   else
  15.   {
  16.     Dispgui.SetPosition(520, 250);
  17.    }
  19. while (WaitMouseKey(1000)==0) {  }
  21.  gDialogue.Visible = false;
  22.   gBottomBar.Visible = false;
  23.   Dispgui.Visible = false;
  25. }

and, as said, it waits until you click the mouse to go to the next dialogue, which in-situ looks like this:

Code: Adventure Game Studio
  1.   btnProfileView.Animate(3, 1, 10, eRepeat);
  2.   cEGO.DisplayDialogue("this is test dialogue!", true, 62772);

however, since it's WaitMouseKey it registers keypresses as well, including useful ones like PrtScn and such. I want it to only advance forward when you click the mouse.

If I set anything to wait for a mouse click, it automatically skips right to the last line of dialogue, or it just pops up and then closes immediately, such as:

Code: Adventure Game Studio
  1. while (IsButtonDown(eMouseLeft)==0);
  2. {
  3. }

gives me an error, and I don't know if I can declare anything outside of this function to bring INTO it, since it's the first one in globalscript.asc, and since it gets imported into all other scripts. There's on_mouse_click as well but that doesn't work within this either. I'm sure there has to be some kind of extremely simple thing that I can't find, and I've looked for hours now...

my question is this: I've tried a ton of different ways and none of them seem to work, is there a simple piece of code that would simply halt the script until you click?

thanks for taking the time to read, I appreciate it!

That's interesting, I never saw any options for that kind of movement before the module existed. I didn't mention it because I didn't think it was relevant(and I hadn't remembered). Sorry for assuming.

Since I've never seen the eight directional movement mentioned once in the manuals or documentation, how do you implement it by itself?

hi there. I realized that I'm using a script module from here on the AGS forums, to provide a character with 8-directional movement. They mention the glitch in there and I have to set it to a separate view or the animation will freeze as I've experienced. I figured that out and it worked but, it works poorly with keyboard controls and still doesn't work very well. The original thread is YEARS old so I doubt there's little help I can ask for, there.

I guess I'm at an impasse and I don't know how to proceed. I'll have to find another way or just completely cut out vines and ladders completely.

Thanks for the help, sorry it didn't work out.

edit: oops it was a typo that caused the first problem

also, if I'm reading this code right, it means that the player will have no control when they're on the vines or ladders, it'll all be automated. That takes away a large part of the game, is there any other way? Does anyone have any idea why the view changing isn't working to begin with?

yes, it should, but it doesn't seem to be.

As for those others, since LockView doesn't work either, can you tell me how to implement Animate? I've got that working elsewhere for one-time animations and I have no idea how to implement it here. I'm not much of a coder so I need help directly, that way.

edit: saw your edit, here is the whole room's code. Nothing more than what I originally pasted. It's a pretty simple room so far.

Code: Adventure Game Studio
  1. // room script file
  3. function region1_WalksOff()
  4. {
  5.   cMadia.ChangeView(1);
  6. }
  8. function region1_WalksOnto()
  9. {
  10.   cMadia.ChangeView(8);
  11. }

I checked the view, yes, it is the right number and yes all the frames are there. There are a few weird hiccups that I don't think are explained just by the views being wrong.

If there are other ways to carry it out, can you think of an alternative I can use since this doesn't seem to work? Thank you :)

Good idea. I gave that a try:

Code: Adventure Game Studio
  1. function region1_WalksOff()
  2. {
  3.   cMadia.ChangeView(1);
  4. }
  6. function region1_WalksOnto()
  7. {
  8.   cMadia.ChangeView(8);
  9. }

but the views don't change. The first time entering that region the character is really slow, but changing direction or moving will get it going normally again... but, again, with the normal walking view. Which is the proper code I'm supposed to use? I've tried this with ChangeView, LockView, and just View and nothing works.

hi everyone, I've posted here before and got some great help, so after ages of searching for a solution and trying as many as I could find, none of them were really quite what I needed, and the solution must be simpler than I think.

I have a character who is to climb some vines. They walk normally until they're on the region(1) which is the vines, and I'd like to switch their view (1) to the view I have for "climbing" animation for that character, (8). I've used this code:

Code: Adventure Game Studio
  1. function region1_Standing()
  2. {
  3.    cMadia.LockView(8); ~~or~~ cMadia.ChangeVew(8);
  4. }

that's supplied in the properties of that region but the second the character DOES switch to that view, but there's no animating while they move, and they move extremely slowly. Once I let up, if I move again, the view switches back to the normal walking view but again, no animation. How can get the view to animate, as it should, and how can I change how fast they move, if it doesn't simply reassign the normal walking view and keep all the rest of the settings? Here's a gif of what's occurring.

obviously, as they touch the ladder and vines, they should be in that view.

I've tried defining that "ladder and vines" area as a walkable area, however if I define the AreaSpecificView as that climbing view, it never sticks; it'll work when I first enter that walkable area but then never again once I stop for a second or if I change direction. I need it to stay on that view! The view has all the same frames as the normal walking view, so that shouldn't be a problem. Here's a gif of what's occurring:

I wouldn't mind reassigning the character's X and Y coordinate for this region/area, as well as how quickly they move, but I can tackle that later.

thanks everyone, your help would be amazing. If I need to clarify or add more info please let me know. :)

14 god, I can't believe it was that easy. Thank you very much, it worked great. Hopefully if anyone in the future has this issue they can search and find this thread :)

So after pouring endlessly over the forum archives and the manuals for the game, I think I finally need to admit I need help. Thank you all in advance for at least taking a peek.

I'm using a simple GUI(Dispgui) to display a view, and then positioning it alongside dialogue. Inside the GUI is a button(btnProfileView) with the exact same size, positioned at 0,0 and when the dialogue is called, the proper "profile view" is assigned to the button, allowing for a simple portrait animation view to be shown alongside said dialogue.
my code is this for each line of dialogue(huge, I know, but oh well):
Code: Adventure Game Studio
  1.  Dispgui.Visible = true;
  2.   Dispgui.SetPosition(550, 250);
  3.   btnProfileView.Animate(4, 0, 10, eRepeat);
  4.   cMadia.SayAt(50, 550, 700, "omg will this work?! I hope it does!!");
  5.   Dispgui.Visible = false;

Though it animates fine and works well every other way and looked lovely, when it is displayed it has this strange property of being semi-transparent with this strange half-tone pattern! What the:

I've checked the properties for the GUI and the button inside it and they seem to be right:

can you see what it is that might be wrong? Thank you so, so much in advance :)

edit; terribly sorry for bumping an old thread. I've managed to fix my problem, sorry again...

Pages: [1]