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

#61
Hello.
I am actually using the 3.6.0 but these audios are not played, but this seems to happen above the audio track number 175
#62
Hello.
I'm still having issues with the ogg files, even with the files which are longer than one second.
As mp3 or wav are leaving a gap in the loops I need to use ogg files.
Are there plans of fixing this soon?
#63
Hello.
Is this issue going to be fixed un 3.6.0 aswell?
I'm having this problem since I use ogg, even with files larger than one second.
#64
Oh great. Now I understand.
#65
Hello.

I have an struct which have some methods on it and it can be used from any room of the game.

Code: ags
struct Actions{
  import static void Restablecer();
};


But now I am trying to call one of this method from another method not included in a room (in an external script) but AGS don't recognize it. And it says Error (linex): Undefined token 'Actions'
Code: ags
function HangUpPhone() {
  Actions.Restablecer();
}


How can resolve this?
#66
Ok, I have already realized that I was overwritting everything, I have solved it just checking first if the index is empty.
#67
Sure, it is a little bit long as it is linked with a menu, but here we go.
Headers:
Code: ags
struct MsgPDA {
  String Sender;
  String Message;
  import void Set(String sender, String sms);
};

import MsgPDA msg[30];


Body:
Code: ags
Label *listslots[9];
MsgPDA msg[30]; export msg;

function new_PDAmsg() {
  PDAmsg+=1;
  aNokia.Play();
  Display("Inbox messages: %i", PDAmsg);
}
String LengthCorrection (String concat){
  concat = concat.Truncate(25);
  concat = concat.ReplaceCharAt(concat.Length -1, '.');
  concat = concat.ReplaceCharAt(concat.Length -2, '.');
  concat = concat.ReplaceCharAt(concat.Length -3, '.');
  return concat;
}

String ConcatMsg(int msgindex) {
  String concat = msg[PDAmsg-1].Sender;
  concat = concat.Append(" - ");
  concat = concat.Append(msg[PDAmsg-1].Message);
  if(concat.Length > 19) {
    concat = LengthCorrection(concat);
  }
  return concat;
}

void MessageList() {
  
  listslots[0] = Msg1; listslots[1] = Msg2; listslots[2] = Msg3; 
  listslots[3] = Msg4; listslots[4] = Msg5; listslots[5] = Msg6;
  listslots[6] = Msg7; listslots[7] = Msg8; listslots[8] = Msg9;
  
  int i;
  if (PDAmsg < 9) {
    for (i = PDAmsg; i > 0; i--) {
      listslots[PDAmsg - i].Text = ConcatMsg(PDAmsg - 1);
    }
  }else {
    for (i = PDAmsg; i > PDAmsg - 9; i--) {
      listslots[PDAmsg - i].Text = ConcatMsg(PDAmsg - 1);
    }
  }  
}

void MsgPDA::Set(String sender, String sms) {
  this.Sender = sender;
  this.Message = sms;
}

void MessageContent(String sender, String sms) {
  new_PDAmsg();
  msg[PDAmsg-1].Set(sender, sms);
  MessageList();
}
#68
Thank you Khris, that is working.
Now the problem seems that every index of the array is returning the same content. It seems that I need global array the keep the information of every index stored.
#69
Hello Khris, thank you.
This should be working better but I need understand how this is working right now, because finally I'm tryingto set it from the function itself, as the array index is a global variable that increases everytime you got a new message. So there won't be any need to stablish the array index from the room.

Code: ags
msg[PDAmsg-1].Set(sender, sms);
#70
Hello.

The thing is that it happens randomly. Yesterday I got the same error in another part of the game.
But I tried to replicate and it doesn't happen.
https://imgur.com/a/oyD4syF
#71
Great stuff. Thank you very much!
#72
Advanced Technical Forum / Struct with arrays
Tue 20/04/2021 00:18:43
Hello.

I am trying to create someking of an instance msg app for the inventory, and I am using a struct with an array, at is explained in AGS documentation.
This is the struct in the header of a script:
Code: ags
struct MsgPDA {
 String Sender;
 String Message;
};


And in the body of the script I have declared the array as:
Code: ags
MsgPDA msg[30];


And through the following function above in the same script I'm trying to make it able to call from any room or the game.
Code: ags
void MessageContent(int index, String sender, String sms) {
  msg[index].Sender = sender:
  msg[index].Message = sms;
}


It says that msg is an undefined token.
What am I doing wrong?

Regards.
#73
Oh, I just realized that I need to activate the manual scaling to solve this issue.
Regards
#74
Hello all.

I'm having the following issue.
When I change the y axis parameter it just ignores the continuous Scaling of the room and goes back to the 100% size of the character.
Code: ags
Character.y += 10;

Do you know how I can avoid this?

Regards.
#75
Thank you!
#76
Hello.

I am trying to create a function to make my player to change his view, but as the view it has not the same size than the Normal view I need to move this new view to place so there won't be a gap from one to another. If I do it in a room without scaling that is easy, but the problem happens when the character is in a room where there is scaling, because the distance from one view to another changes.

I would like to know how this scaling works, because if I understand how it works I would make it work in any place of the walkable area.
Also I would like to know if there is a way to get the actual scaling where the player is, so then I would be able to apply a calculation.

This is how it works. There is another method who sents first the parameters, and the second option in parameter direccion sets back to the first position.

Code: ags
static void Actions::Correcciones(Character *personaje, int x, int y, Direction direccion) {
  if (direccion == eForwards) {
    personaje.x = personaje.x + x; 
    personaje.y = personaje.y + y;
  }
  else {
    personaje.x = personaje.x - x; 
    personaje.y = personaje.y - y;
  }
}
#77
Hello, I'm not having this error in the 3.5.1 version.
This error happens while being in that room during a half minute. It is truth that this room has a lot of things going on, animations and other events, but it works fine in the 3.5.1.
#78
Hello.

I have received this error while running a room.
https://imgur.com/byuwNv7
[imgzoom]https://imgur.com/byuwNv7[/imgzoom]
#79
Thank you. If someone needs something similar this is how it worked for me.
Code: ags
 
int i; 
for(i = 1; i < Game.InventoryItemCount; i++) {
   CharacterB.InventoryQuantity[i] = CharacterA.InventoryQuantity[i]; 
}
UpdateInventory();
 
#80
That simple? Thank you very much!
SMF spam blocked by CleanTalk