Are you planning to add the possibility to update games without losing saved files in this version of ags?
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 MenuQuote from: eri0o on Sun 25/02/2024 22:33:58In your code, just before WaitUntilKeyPressed (line 35 above), put a wait, and wait for something around 300ms, which if it's a 60fps game it would be around 20 game loops (Wait(20)). I think the problem is the debounce of IsKeyPressed which checks if a key is pressed and hold.Hey, thanks for the response!
Quote from: eri0o on Sun 25/02/2024 22:33:58I did this effect using the tty module in Don't Give up the Cat where I pointed it out.I will try this module, maybe is more easy for me instead of trying my own code
Quote from: eri0o on Sun 25/02/2024 12:41:43I think the best option would be using the Typewriter module instead
https://www.adventuregamestudio.co.uk/forums/modules-plugins-tools/module-typedtext-0-7-0/
Quote from: Khris on Sun 25/02/2024 13:10:04The main problem is the display command, which pauses the game until you press a key or mouse button.
If you use a GUI and a label instead, it'll work as expected.
Quote from: Crimson Wizard on Sun 25/02/2024 18:17:23Yes, what Khris said, Display is for showing blocking text only, for non-blocking display there are several variants:
- GUI with a label;
bool keyPressed = false;
bool IsAnyKeyPressed() {
int i = eKeySpace;
while (i <= eKeyUnderscore) {
if (IsKeyPressed(i)) return true;
i++;
}
return false;
}
function WaitUntilKeyPressed() {
while (!IsAnyKeyPressed()) {
Wait(1);
}
}
function Typewriter(Character* ch, String text, int speed) {
String textShow = "";
gText.Visible = true;
for (int i = 1; i <= text.Length; i++) {
textShow = text.Substring(0, i);
lText.Text = textShow;
Wait(speed);
if (IsAnyKeyPressed()) {
keyPressed = true;
break;
}
}
if (!keyPressed) {
lText.Text = textShow;
}
WaitUntilKeyPressed();
gText.Visible = false;
}
function Typewriter(Character* ch, String text, int speed) {
String textShow = "";
for (int i = 1; i <= text.Length; i++) {
textShow = text.Substring(0, i);
Display(textShow);
Wait(speed);
}
}
Typewriter(player, "Wow, Amazing", 10);
Quote from: eri0o on Tue 05/04/2022 12:03:54
Which Fullscreen you are using? Borderless windowed Fullscreen or the exclusive Fullscreen?
Quote from: Crimson Wizard on Tue 05/04/2022 12:20:41
It's also useful to know which graphic renderer does this happen with (Direct3D, OpenGL, Software, all).
Quote from: Babar on Mon 04/04/2022 17:38:09
Aaa....I'm not a fan of the art style. I don't see Mark Ferrari's name anywhere.
(and it's not even a heart-ripping April 1st update!)
Quote from: Crimson Wizard on Mon 17/05/2021 18:05:36
I did not yet look into this problem, but I am not quite sure what "Impr Pant PetSis" button is. Is this like "Print Screen" button?
Quote from: Crimson Wizard on Mon 17/05/2021 18:05:36
OpenGL and Direct3D perform hardware accelerated drawing which improves perfomance by delegating tasks to GPU, especially in cases when there's object scaling and other visual effects (like sprite tinting).
int itemcount[10];
void UpdateInvNumber() {
InventoryItem *CountItem1 = PlayerMainShow.ItemAtIndex[0];
InventoryItem *CountItem2 = PlayerMainShow.ItemAtIndex[1];
InventoryItem *CountItem3 = PlayerMainShow.ItemAtIndex[2];
InventoryItem *CountItem4 = PlayerMainShow.ItemAtIndex[3];
InventoryItem *CountItem5 = PlayerMainShow.ItemAtIndex[4];
InventoryItem *CountItem6 = PlayerMainShow.ItemAtIndex[5];
InventoryItem *CountItem7 = PlayerMainShow.ItemAtIndex[6];
InventoryItem *CountItem8 = PlayerMainShow.ItemAtIndex[7];
InventoryItem *CountItem9 = PlayerMainShow.ItemAtIndex[8];
InventoryItem *CountItem10 = PlayerMainShow.ItemAtIndex[9];
if (CountItem1 != null) {
lInv1.Visible = true;
itemcount[1] = player.InventoryQuantity[CountItem1.ID];
lInv1.Text = String.Format("%d", itemcount[1]);
}
else {
lInv1.Visible = false;
}
if (CountItem2 != null) {
lInv2.Visible = true;
itemcount[2] = player.InventoryQuantity[CountItem2.ID];
lInv2.Text = String.Format("%d", itemcount[2]);
}
else {
lInv2.Visible = false;
}
if (CountItem3 != null) {
lInv3.Visible = true;
itemcount[3] = player.InventoryQuantity[CountItem3.ID];
lInv3.Text = String.Format("%d", itemcount[3]);
}
else {
lInv3.Visible = false;
}
if (CountItem4 != null) {
lInv4.Visible = true;
itemcount[4] = player.InventoryQuantity[CountItem4.ID];
lInv4.Text = String.Format("%d", itemcount[4]);
}
else {
lInv4.Visible = false;
}
if (CountItem5 != null) {
lInv5.Visible = true;
itemcount[5] = player.InventoryQuantity[CountItem5.ID];
lInv5.Text = String.Format("%d", itemcount[5]);
}
else {
lInv5.Visible = false;
}
if (CountItem6 != null) {
lInv6.Visible = true;
itemcount[6] = player.InventoryQuantity[CountItem6.ID];
lInv6.Text = String.Format("%d", itemcount[6]);
}
else {
lInv6.Visible = false;
}
if (CountItem7 != null) {
lInv7.Visible = true;
itemcount[7] = player.InventoryQuantity[CountItem7.ID];
lInv7.Text = String.Format("%d", itemcount[7]);
}
else {
lInv7.Visible = false;
}
if (CountItem8 != null) {
lInv8.Visible = true;
itemcount[8] = player.InventoryQuantity[CountItem8.ID];
lInv8.Text = String.Format("%d", itemcount[8]);
}
else {
lInv8.Visible = false;
}
if (CountItem9 != null) {
lInv9.Visible = true;
itemcount[9] = player.InventoryQuantity[CountItem9.ID];
lInv9.Text = String.Format("%d", itemcount[9]);
}
else {
lInv9.Visible = false;
}
if (CountItem10 != null) {
lInv10.Visible = true;
itemcount[10] = player.InventoryQuantity[CountItem10.ID];
lInv10.Text = String.Format("%d", itemcount[10]);
}
else {
lInv10.Visible = false;
}
}
function repeatedly_execute_always() {
UpdateInvNumber();
}
void AddInventoryExtend(InventoryItem *item, int addAtIndex) {
if (PlayerMainShow.ItemCount >= (PlayerMainShow.ItemsPerRow * PlayerMainShow.RowCount)) {
player.Say("Inventory full, will be added to the bag.");
cSInventory.AddInventory(item, addAtIndex);
}
else if (PlayerMainShow.ItemCount < (PlayerMainShow.ItemsPerRow * PlayerMainShow.RowCount)) {
player.AddInventory(item, addAtIndex);
}
}
Quote from: Khris on Tue 04/05/2021 08:22:21
Please don't quote the entire previous post. There's a Reply button at the bottom.
Quote from: Gilbert on Tue 04/05/2021 10:41:26
As KhrisMUC pointed out you can actually add or subtract more than 1 in each game loop, but you'll need to do additional checks (for example, if you add/subtract 5 each time and don't check the result, then say if at some instance realMoney = 8 and dispMoney = 7 then dispMoney will annonyingly fructuate between 7 and 12 indefinitely). The check would be easy. I just put out the simplest possible codes as a start:
Quote from: Snarky on Tue 04/05/2021 07:30:17
You also need to actually update the label. Something like this (assuming the label is called lblMoney):Code: ags int dispMoney, realMoney; function repeatedly_execute_always() { // ... (anything else you have in this function) if (dispMoney < realMoney) dispMoney++; else if (dispMoney > realMoney) dispMoney--; lblMoney.Text = String.Format("%d", dispMoney); }
Quote from: eri0o on Sun 02/05/2021 12:47:20
Hi WiseFrog!
Have you tried on your character, disabling the anti-glide? If you click the character on the AGS Editor, in the properties panel, look for the option MovementLinkedToAnimation and try setting it to false.
Also the character MovementSpeed and AnimationDelay have different meanings when MovementLinkedToAnimation is either true or false, so I would recommend still playing a bit with those values.
Also setting your game speed to 60 (ags defaults to 40) usually helps too.
By continuing to use this site you agree to the use of cookies. Please visit this page to see exactly how we use these.
Page created in 0.059 seconds with 14 queries.