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.

Topics - my2k

Pages: [1]
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?


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!

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. :)

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 :)

Pages: [1]