AGS Awards nominations close at 13:59 GMT on Saturday 10 February 2018. You haven't yet nominated, so you've got 18 days and 15 hours left to play the games and decide which to nominate!

Show Posts

You can view here all posts made by this member. Note that you can only see posts made in areas to which you currently have access.

Messages - Khris

Pages: [1] 2 3 ... 522
You're welcome, and I'm looking forward to the game, we need more RPG/Adventure hybrids! I love those. ;-D

Just to get this out of the way, since you keep doing it, the variable name room_number is a really bad choice. It's a pointer to a Room instance, NOT a number, i.e. integer.
Anyway, converting would only be possible if AGS had an array of rooms so you could do
Code: Adventure Game Studio
  1.   Room* room = rooms[this.Room];
It doesn't though afaik, so this is not possible.
Code: Adventure Game Studio
  1.   int room_number = this.Room;  // possible, but pointless

Room.Width is static, used exactly like that in the manual's example. Which means there's only one available .Width, that of the currently loaded room.
To do what you want to do, you need to schedule the random placement, then call it in your on_event/eEventBeforeFadein block if (this.Room == player.Room), i.e. the player has entered the room the character is currently in, too.

I created a new game based on the template, and right-clicking made the inventory show up.

If you're using just the module, it might be different, but still: what did you try so far? And why do you need a test character to test whether right-clicking brings up the inventory?

Did you try right-clicking? It worked for me.

I guess I should've been more clear: OX, OY is the pixel position of the grid's top left corner in room coordinates.
Which means player.x - OX will calculate the player's pixel position relative to the grid's left edge, which is then converted into the column number by dividing it by the width of a column.

So the code should probably look something like this:
Code: Adventure Game Studio
  1.   int x = (player.x - 128) / grid_width;
  2.   int y = (player.y - 300) / grid_height;
  3.   grid_current = y * 20 + x + 1; // start counting at 1
By reversing the coordinate calculation, you also reversed the numbering of the squares.

And just for reference, here's the for loop, for just the first row:
Code: Adventure Game Studio
  1.   for (int i = 1; i < 10; i++) {
  2.     if (player.x >= grid_width * (i - 1) && player.x < grid_width * i) {
  3.       grid_current = i;
  4.       break;
  5.     }
  6.   }

Code: Adventure Game Studio
  1.   int x = (player.x - OX) / grid_width; // replace OX, OY with coordinates of grid in room
  2.   int y = (player.y - OY) / grid_height;
  3.   grid_current = y * number_of_columns + x + 1; // start counting at 1

(Also, even without math-based solutions like this, it's still pretty obvious that a simple for loop will automate the code. You're copy-pasting the block, then incrementing a number by 1. It's exactly what a for loop does.)

Or do this (just nitpicking though):
Code: Adventure Game Studio
  1. Hotspot* clickedHotspot;
  3.   clickedHotspot = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
  5.   if (clickedHotspot == hAnyGivenHotspot)
i.e. use a variable name actually describing what it stores and a Hotspot pointer.

First, try running the game outside the editor. Press F7 to create the files, then open the Compiled/Windows folder in your game's folder and run it from there.
You should also check your AntiVirus; Avast is known to interfere with AGS executables.

Indeed, declaring a variable inside for () is perfectly possible.

It sounds to me like a better approach would be to disable all room interactions?
Code: Adventure Game Studio
  1. // add this to GlobalScript.ash
  2. import void Narration(String text);
  4. // add to top of GlobalScript.asc
  5. Overlay *narratorSpeech;
  7. void Narration(String text) {
  8.   narratorSpeech = cNarrator.SayBackground(text);
  9. }
  11. // the following at the start of on_mouse_click()
  12.   if (narratorSpeech != null && narratorSpeech.Valid && mouse.Mode != eModeWalkto) return;

To have your narrator say something, simply use Narration("Some text");
This will disable all clicks except WalkTo ones. You might have to change things up slightly if you're using a module or template.

Advanced Technical Forum / Re: Illegal exception error
« on: 12 Jan 2018, 11:13 »
My first idea is to look at line 23 of room 2's script.

Just move up the GUI if the cursor mode is eModeUseinv:
Right after
Code: Adventure Game Studio
  1. int y = mouse.y + 10;
Code: Adventure Game Studio
  1. if (mouse.Mode == eModeUseinv) y -= 20;

Searched for tech topics with "alpha" in the title and found this right away...

StarEcho: Don't be afraid to ask questions, just make sure to take a deep long look at the manual beforehand.

Newbies tend to ask questions that have been asked and answered dozens of times before. However it can admittedly be hard to find exactly what you're looking for, in both the manual and the forum search, especially when you aren't familiar with the engine.

Therefore the best way to proceed is not to try and create a Dustbowl-clone straightaway but to start with a basic game that uses the basic mechanisms already provided by AGS. Once you have acquired most of the basic building blocks, putting them together in a slightly "non-AGS" way will become much easier.

It will take more time, but the upside is you won't get one-liners as replies that consist of a link to the manual ;)

If you have a specific question, I'll happily provide links to existing forum topics or answer it.

One way is to enable your custom cursor mode and disable all others.

General Discussion / Re: Trumpmageddon
« on: 09 Jan 2018, 18:10 »
Hope that was tongue-in-cheek, Khris
Not at all.
(I'm also very familiar with confirmation bias and other cognitive biases, in case you think I'm not.)

General Discussion / Re: Trumpmageddon
« on: 09 Jan 2018, 15:52 »
Btw, it's uncanny how spot-on Snarky's predictions from 14 months ago are.

Beginners' Technical Questions / Re: Changing Template
« on: 03 Jan 2018, 12:55 »
I don't know. Why don't you create a test room using that size, then draw a door and go from there?
The only thing you need to keep in mind is that scaling down a sprite always looks better than scaling it up. If the characters are going to get close to the "camera", draw them rather big.

General Discussion / Re: Icey Games Reborn
« on: 03 Jan 2018, 11:48 »
The site doesn't matter; the problem is that the forum software considers URLs that don't start with http:// as invalid. I mentioned this months ago and AGA tried to fix it but failed.

Beginners' Technical Questions / Re: Changing Template
« on: 03 Jan 2018, 11:38 »
You need to
  • import individual standing / walkcycle sprites in the sprite manager (PNGs or GIFs)
  • compose a VIEW from them
  • set the view as NormalView for your character
The import function you found is for importing characters that were previously exported from another AGS game.

Pages: [1] 2 3 ... 522