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

#161
Using conditions and variables is very basic programming, that's why is has not been mentioned much  ;)
#162
You have to make the walk command blocking, otherwise other things will happen simultaneously.

Code: ags
player.Walk(160, 135, eBlock);


If this doesn't help than the problem is related to the Tumbleweed template and I can't help you with that as I've never used it. But I don't understand why there would be a difference between walking to hotspots and walking to objects.
#163
Yes, you would have a function like this in Global Script:

Code: ags
function unhandled_event(int what, int type) {

  if (what == 1)  // hotspots
  {
    if (type == 1)         // Look at hotspot
    {
    }
    else if (type == 2)    // Interact with hotspot
    {
    }
    ...



The help file does have a part about unhandled events in the Tumbleweed template, and it says: "The messages itself are defined outside of this function, initially in TemplateSettings.asc."
#164
I think what you're looking for is unhandled_event.
#165
@Vincent: The way my code works you can't decrease the random variable, because task 6 may be completed while task 9 is not. It just repeats picking a random task until one is found that is not completed yet. This might not be the most elegant solution but should work without problems.

To set the specific task as completed just write TaskCompleted[4] = true; instead of Task4Completed = true; You could keep track of the current task with a variable and write TaskCompleted[CurrentTask] = true; I'm not sure how completing the tasks exactly works in you game.

@ eri0o: Ah. Set and Dictionary are still things I have to take a look at, as I'm not familiar with them yet. Thanks for reminding me ;)
#166
You can use an array to keep track of that.

Code: ags

// setting the variables at game start
bool TaskCompleted[10];
for (int i = 0; i < 10; i ++)
{
  TaskCompleted[i] = false;
}

// picking a random task that is still available
r = Random(9);
while (TaskCompleted[r]) r = Random(9);


If the tasks had more more parameters than a text and and a completion state I would've suggested using a struct.
#167
AGS Games in Production / Re: The Witch House
Mon 07/06/2021 19:27:09
Sweet! Nice trailer  :)
#168
Thanks for the clarification.

@Laura: Thanks, that's a convenient solution :)
#169
I just realized that making the mouse cursor invisible doesn't disable the mouse and clicks are still being registered. This seems a bit weird to me and I assumed that the player can't click while the cursor is invisible.

Is there an easy way to disable the mouse alltogether? I have a non-blocking effect in one of my rooms and the player is not supposed to do anything while the effect is running. I can of course use ClaimEvent or write some condition in the Global Script. It just seems a bit unnecessary and something like Mouse.Enabled and Mouse.Disabled would be handy.
#170
Beginners' Technical Questions / Re: Book GUI
Sun 06/06/2021 16:00:51
Putting a single [ in the text will result in a line break.

As for the code, I don't think you could make it much more efficient.

Edit: Well, you could of course display one image per book that contains all the text, instead of using three labels. That would shorten the code significantly and you could also see if you want different or anti-aliased fonts or a bit of variety in the pages.
#171
Just a quick note: The big link at the top of the forums goes to the newest post in this thread, which is not intentional I guess.
#172
Yes, this may be done differently, but I'm pretty sure it's how it's always been, at least in Monkey Island. I think it makes sense too, because the highlight still just tells you what will be selected if you right-click something.
#173
You can shorten the bit you changed in the GlobalScript:

Code: ags

if (type == 1) // look
{
  if (player.Room != 14) {
    player.Say("It looks as expected.");
  }
}
#174
Oh cool. I thought Wretcher has been abandoned, but it's obviously still in production  :)
#175
You don't need to change the view to make the character invisible. There's a ShowPlayerCharacter property in the room's properties panel in the editor that you can set to false. Another way would be to set the character's transparency to 100.
#176
Quote from: Hobbes on Sat 29/05/2021 06:56:06
1. I have multiple player characters. So a Character.ChangeRoom & Character.ChangeView won't work, since the map screen is in the menubar GUI and might be used by different Characters at any time.
2. With the map screen being in the menubar, it's accessible from any room at any time. So if you're on the map, pressing "Exit"... there's no Character.ChangeRoom(PreviousRoom, previousX,previousY) function that I can see.

1. If you use player.ChangeRoom instead of Character.ChangeRoom (which is recommended anyway) it doesn't matter which character is the current player character, same with ChangeView or anything else.

2. There is a Character.PreviousRoom property you can use. And you can easily store the player's coordinates before entering the map, so that shouldn't be a problem. Edit: Also, what Snarky said. If the player is invisible on the map you don't even need to store the coordinates.

I'd say go for using a room as a map.
#177
Quote from: bx83 on Mon 24/05/2021 15:28:20
I don't know why anyone would need more than.... 1 save game (for an adventure game)... but each to his own.

Because of bugs or possible dead ends ;)
#178
So true :D
#179
In Khris code I think it should be && instead of || in line 6:

Code: ags
  if (diff > -5 && diff < 5) dispMoney = realMoney;
#180
I'm pretty sure that was the meaning. I guess you have to imagine a colon after the first sentence.

Quote
I found what the error was: I put the function to show the money on the label on repeatedly_execute and not on repeatedly_execute_always.

I guess the problem was exactly like CW described.
SMF spam blocked by CleanTalk