All AGS Versions Depository?

Started by Indra Anagram, Thu 11/08/2022 22:01:50

Previous topic - Next topic

AndreasBlack

Please share the working AGS source on google drive or dropbox. I'm a bit interested too!  (nod)

Indra Anagram

Hey AndreasBlack!

Quote from: AndreasBlack on Mon 15/08/2022 22:24:48
Please share the working AGS source on google drive or dropbox. I'm a bit interested too!  (nod)

Here is the original Platformerius archive by 2ma2 made in AGS v.2.5.1. - https://www.dropbox.com/s/60oznzea6r00ee4/platformerius-the-ninja-incident.zip?dl=0

And this is the same game re-compiled in AGS v.3.5.1 - https://www.dropbox.com/s/59064rnbgc6is3e/platformerius.zip?dl=0

Did the old man and woman abuse Gingerbread Man?

Indra Anagram

#22
Hey Crimson Wizard!

Quote from: Crimson Wizard on Mon 15/08/2022 21:32:56
That is correct. You may notice that arrow keys still work in game regardless of the system language.

I've changed the key value from 83 to 32 in line 218 of the global script:

Code: ags
  if ((character[ESTAR].room == -1) && (keycode==32))  if (stars > 0) {PlaySound(2);stars--;anim(EGO,4);} else DisplaySpeechBackground(EGO,"Dammit, no more stars!"); //throwing stars!


Now the character throws stars when Spacebar is pressed. And I reassigned taking snapshots from A to Tab.

However I reassigned key value for the sword from 68 (D) to 16 (Shift), and this doesn't work. Probably, the thing is in the animation or the code section above that deals with cutting. I am not that skilled to figure out the reason on my own.

How do I make sword swinging work when Shift is pressed?

Thank you!
Did the old man and woman abuse Gingerbread Man?

Crimson Wizard

#23
Quote from: Indra Anagram on Tue 16/08/2022 08:11:15
However I reassigned key value for the sword from 68 (D) to 16 (Shift), and this doesn't work. Probably, the thing is in the animation or the code section above that deals with cutting. I am not that skilled to figure out the reason on my own.

How do I make sword swinging work when Shift is pressed?

Before 3.6.0 and the "new key handling" mode the modifier keys did not work in on_key_press. The only way to test them was IsKeyPressed when used in repeatedly_execute* kind of functions.

Related articles in the manual:
https://adventuregamestudio.github.io/ags-manual/Globalfunctions_Event.html#on_key_press
https://adventuregamestudio.github.io/ags-manual/RepExec.html

Indra Anagram

Hey Crimson Wizard!

Quote from: Crimson Wizard on Tue 16/08/2022 11:19:01

Before 3.6.0 and the "new key handling" mode the modifier keys did not work in on_key_press. The only way to test them was IsKeyPressed when used in repeatedly_execute* kind of functions.

I don't understand this. I added to the global script:

Code: ags
function repeatedly_execute() { 

if (IsKeyPressed(eKeyD))
  {
    cEgo.LockView(1);
    cEgo.Animate(6, eForwards);
    cEgo.UnlockView();
  }
}


to replace this:

Code: ags
if (keycode==68) {PlaySound(6);anim(EGO,0);}


and nothing happened - pressing D causes the character do nothing.

Also I wanted the key button for the sword be left Shift, not D. I tried to insert IsKeyPressed(eKeyModShiftLeft) and IsKeyPressed(eKeyShiftLeft), but the Editor considers this as an error and doesn't identify eKeyModShiftLeft or eKeyShiftLeft at all  :~(

What am I doing wrong?

Thank you!
Did the old man and woman abuse Gingerbread Man?

Crimson Wizard

#25
Quote from: Indra Anagram on Tue 16/08/2022 16:22:39
Also I wanted the key button for the sword be left Shift, not D. I tried to insert IsKeyPressed(eKeyModShiftLeft) and IsKeyPressed(eKeyShiftLeft), but the Editor considers this as an error and doesn't identify eKeyModShiftLeft or eKeyShiftLeft at all  :~(

These constants were only added in 3.6.0. In previous versions you would have to use numbers for mod keys:
https://adventuregamestudio.github.io/ags-manual/Keycodes.html

Left shift is 403, and so on.

Indra Anagram

Crimson Wizard,

Quote from: Crimson Wizard on Tue 16/08/2022 16:33:57
Left shift is 403, and so on.

This does not seem to change anything: I wanted pressing Shift cause animation view 1, loop 6 happen:

Code: ags
if (IsKeyPressed(403))
  {
      cEgo.LockView(1);
      cEgo.Animate(6, 0, eOnce, eNoBlock);
      cEgo.UnlockView();
  }


Nothing happens when I press Shift in game.

:(

Thank you for your advice!
Did the old man and woman abuse Gingerbread Man?

Indra Anagram

Hey Crimson Wizard,

Quote from: Crimson Wizard on Tue 16/08/2022 16:33:57
In previous versions you would have to use numbers for mod keys:

Does the piece of code from my previous message here make any sense? Currently the global script looks this way - https://www.dropbox.com/s/xgvott4wyimesjw/Global%20script.asc?dl=0

The piece of code in question starts in line 105. Although I put it inside function repeatedly_execute like you said, Shift is not assigned to sword swinging whatsoever.

What could the reason be? I tried to figure that out on my own, but the character ignores this control key.

Thank you!
Did the old man and woman abuse Gingerbread Man?

Crimson Wizard

#28
Quote from: Indra Anagram on Wed 17/08/2022 16:24:48
The piece of code in question starts in line 105. Although I put it inside function repeatedly_execute like you said, Shift is not assigned to sword swinging whatsoever.

Have you tried another key that worked before? If it does not work too, then this means that the code itself is not doing what is intended.

The best way to test if certain condition works (like, key press in this case) is to place a Display command under it. Like

Code: ags

  if (IsKeyPressed(403))
  {
      Display("hello");
  }


If the message does not appear, that will mean that the key code does not work. If the message appears, that will mean that the animation logic is not correct.


EDIT: following code works if I insert it into 2.72 version of the game, in repeatedly_execute:
Code: ags

if (IsKeyPressed(403)==1) {PlaySound(6);anim(EGO,0);} //sword!

Indra Anagram

All Hail Crimson Wizard! The Tower won't stand.

Quote from: Crimson Wizard on Wed 17/08/2022 17:43:37
EDIT: following code works if I insert it into 2.72 version of the game, in repeatedly_execute:
Code: ags

if (IsKeyPressed(403)==1) {PlaySound(6);anim(EGO,0);} //sword!


You're genius! This worked in 3.5.1!!!  ;-D Now all former game controls except the arrow keys are re-assigned: Spacebar for throwing stars, Shift for the sword and Tab for snapshots. Here is the current build - https://www.dropbox.com/s/2kcu08p6tlabgie/Platformerius%203.5.1a.zip?dl=0.

I woundn't have come up with that piece of code alone. Too advanced stuff.

Crimson Wizard, I noticed one thing. When you press Esc, this pops up:



What file or code specifies such interface? I mean the way it looks and functions.


THANK YOU!
Did the old man and woman abuse Gingerbread Man?

Snarky

That quit GUI is built in. It appears when you call QuitGame(1). You can't modify its appearance or behavior. (I'm not sure you can even translate it.) If you want it to be different you would have to make an alternative one of your own from scratch.

Indra Anagram

Hey Snarky,

Quote from: Snarky on Fri 19/08/2022 06:56:44
That quit GUI is built in. It appears when you call QuitGame(1). You can't modify its appearance or behavior. (I'm not sure you can even translate it.) If you want it to be different you would have to make an alternative one of your own from scratch.
I see. What will be the command that I can call that new GUI with? Will it still be QuitGame(1) or IsKeyPressed again?

Thank you for your reply!
Did the old man and woman abuse Gingerbread Man?

Snarky

If you make your own GUI, you need to display it just like any other GUI you make, by setting GUI.Visible. You can do this from any function. If you want it to be in response to a keypress, then on_key_press() is the most sensible place. (I believe that by default there is a call to QuitGame() in on_key_press() under the Ctrl-Q case.)

SMF spam blocked by CleanTalk