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

#1
sorry for some thread necromancy....

so I don't know if this has been addressed, this is as close as I've seen, but:
when I'm moving and the screen is smooth-scrolling, if I click on a character and dialogue begins, the dialogue scrolls along with the room- not the gui, not anything else, JUST the drawn "character.SayAt(etc);" type dialogue. I'm trying to figure out how I can have the dialogue stay along with the GUI, where the view below the dialogue box keeps moving but the dialogue box itself doesn't. I can't set GUIs' PxPos as 0, so it's not possible to keep it stationary.

if I use
  cEgo.StopMoving();
  SmoothScroll_StopScroll();

it'll have the screen slow to a stop- which is great anywhere else- but it unfortunately is a bit lengthy when waiting for dialogue to display. Ideally it'd slow to a stop as normal but that dialogue wouldn't move.

Do we know why JUST the dialogue seems to keep moving with the scrolling screen but the GUI doesn't? how can I keep that dialogue stop moving?
 

Quote from: Ali on Tue 17/03/2009 09:56:30
Nickel & Mr Matti: That looks really cool, and it ran very smoothly for me too. I like the way you've modified the numbers, and there's nothing wrong with the maths. The problem is that objects with PxPos of 0 are ignored by the script and aren't added to the array of parallax objects. It's the default value, so it's needed to create non-parallax which stay in place.

To make it work, use a PxPos of 1 in the script for the segment where you currently use 0, and use 2 where you currently use 1. Changing the corresponding numbers on the nearest two objects made it work properly for me.

Hope that helps!

Dualnames: Thanks for the tip. I always disliked Sierra Speech, but now it's personal.

*Shakes fist at Sierra style dialogue*

I'll add that note the next time I update the module. Thanks!
#2
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.
#3
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: ags

function on_key_press(eKeyCode 9) 
{
   gSaveScreen.Visible = true; 
  if ((keycode == eKeyTab) && gSaveScreen.Visible) {
    // Use tab to turn the panel off.
    gSaveScreen.Visible = false; 
    mouse.UseDefaultGraphic();
  }
}

function guiSaveBtn_OnClick(GUIControl *control, MouseButton button)
{
SaveGameSlot(48);
guiGameStatus.Text("Game Saved!");
gSaveScreen.Visible = false;
}


function guiLoadBtn_OnClick(GUIControl *control, MouseButton button)
{
 RestoreGameSlot(48);
 guiGameStatus.Text("Game Saved!");
 gSaveScreen.Visible = false;
 }

function guiQuitBtn_OnClick(GUIControl *control, MouseButton button)
{
 SaveGameSlot(48);
 guiGameStatus.Text("Game Saved!");
 Wait(40);
 QuitGame(1);
 }



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?

Thanks.
#4
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-)
#5
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-)
#6
thank you for your help everyone!

Quote from: Khris on Wed 18/01/2017 13:34:15
This should work:
Code: ags
  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)?
#7
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: ags

void DisplayDialogue(this Character*, String message, bool isprofleft, int textcolour)
{
   Dispgui.Visible = true;
  gBottomBar.Visible = true;
  gDialogue.Visible = true;
  
  TextDialogue.Text = message;
   TextDialogue.TextColor = textcolour;
  
    if (isprofleft == true)
  {
    Dispgui.SetPosition(45, 250);
  }
  else
  {
    Dispgui.SetPosition(520, 250);
   }

while (WaitMouseKey(1000)==0) {  }

 gDialogue.Visible = false;
  gBottomBar.Visible = false;
  Dispgui.Visible = false;
 
}



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

Code: ags

  btnProfileView.Animate(3, 1, 10, eRepeat);
  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: ags

while (IsButtonDown(eMouseLeft)==0);
{
}


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!
#8
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?
#9
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.
#10
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?
#11
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: ags

// room script file

function region1_WalksOff()
{
  cMadia.ChangeView(1);
}

function region1_WalksOnto()
{
  cMadia.ChangeView(8);
}


#12
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 :)
#13
Good idea. I gave that a try:

Code: ags

function region1_WalksOff()
{
  cMadia.ChangeView(1);
}

function region1_WalksOnto()
{
  cMadia.ChangeView(8);
}


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.
#14
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: ags
function region1_Standing()
{
   cMadia.LockView(8); ~~or~~ cMadia.ChangeVew(8);
}


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. :)
#15
...my 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 :)
#16
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: ags
 Dispgui.Visible = true;
  Dispgui.SetPosition(550, 250);
  btnProfileView.Animate(4, 0, 10, eRepeat);
  cMadia.SayAt(50, 550, 700, "omg will this work?! I hope it does!!");
  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 :)
#17
edit; terribly sorry for bumping an old thread. I've managed to fix my problem, sorry again...
SMF spam blocked by CleanTalk