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

#301
It can be done using DynamicSprite.CopyTransparencyMask(int fromSpriteSlot)

Create and import a sprite that contains a filled circle (i.e. has the transparency mask you need)
Each game loop
1. create a DynamicSprite from the map sprite and use the player coordinates to crop it
2. use the above command to copy the transparency mask from the circle sprite to your dynamic map sprite
3. assign the GUI-sized and rounded sprite as your GUI's background image

Note that the DynamicSprite pointer has to be declared above your room_RepExec function as opposed to inside it.

Something like this:

Code: ags
DynamicSprite* map;

function room_RepExec()
{
 map = DynamicSprite.CreateFromExistingSprite(MAP_SLOT);
 map.Crop(player.x / 10 - 64, player.y / 10 - 40, gMinimap.Width, gMinimap.Height);
 map.CopyTransparencyMask(CIRCLE_SLOT);
 gMinimap.BackgroundGraphic = map.Graphic;
 Btnarrowminimap.NormalGraphic = 3220 + player.Loop;
}

(You can also get rid of the arrow button, too, and draw the arrow onto the map sprite if you want)
#302
Basically yes, however you can add

Code: ags
function on_key_press(eKeyCode key) {
  ...
}

to the room script. AGS will call it before the global one. When a key was handled by this room function, you'd usually call ClaimEvent(), this prevents the global one from also processing the key.

If the player movement is handled by a module you have to disable the module in room_Load, otherwise the module script will process the key first.
#303
There's no reason to break execution or step through your code though? That's not going to help with skipping over the beginning of your game in any way.
All that's of use to you is the Debug() function, and really only the "give all items" and "teleport" parts.

But again, there's no magical shortcut here. You need to actually write code that moves to the part you want to test.
Some time ago I caught a stream by Grundislav where he used a massive GUI to set game variables, trigger events and jump to various parts of Rosewater. It probably helped that it's not his first full-length game though :)
#304
Here's edited versions of the two functions:

Code: ags
function SaySpecial7(Character* thechar, String message) {
  slabel7.TextColor = thechar.SpeechColor;
  slabel7.SetText(message);
  gGui16.Visible = true;
  thechar.SayAt(0, 0, 0, message); // say text but hidden (width 0), so voice speech plays
  gGui16.Visible = false;
}

function SaySpecial23(Character* thechar, String message1, String message2) {
  slabel7.TextColor = thechar.SpeechColor;
  slabel7.SetText(message1);
  MLabel.TextColor = thechar.SpeechColor;
  MLabel.SetText(message2);
  gGui16.Visible = true;
  thechar.SayAt(0, 0, 0, message1); // say text but hidden (width 0), so voice speech plays
  Wait(5);
  gGui23.Visible = true;
  thechar.SayAt(0, 0, 0, message2); // say text but hidden (width 0), so voice speech plays
  gGui16.Visible = false;
  gGui23.Visible = false;
}
#305
Note that a term like oCup.Visible == true is redundant; AGS does not read this like a human would, it simply calculates the result. Therefore, oCup.Visible == true is the exact same as oCup.Visible.

In other words, you can do
Code: ags
  gPUZ1.Visible = cEGO.HasInventory(iGUN) && cJOE.HasInventory(iAXE);
#306
Just don't call your functions. Instead, show the two GUIs by making them visible and set the label texts. That's really all you need here.
If there's voice speech, run the SayAt command last, then hide the two GUIs again.
#307
This questions comes up occasionally and the usual advice is to basically do exactly what restoring the savegame does but manually (because as you know, savegames break).

I.e. divide your game into chapters and write a function that moves the game state to the beginning of a chapter by setting globals, adding inv items, etc.

(Also please edit your first post and use a proper thread title; I put a suggestion as this reply's title)
#308
Not sure why the text doesn't appear but in theory you should check the visibility setting of the GUI and its coordinates.

However, there's no need for a secondary label, let alone a secondary GUI. (You can always just add a label to the existing GUI instead.)
Let's solve the actual problem instead: the text doesn't fit the label. It sounds like you simply need to increase the size of the label. Text too long to fit the width wraps around, but if the label isn't tall enough, it's simply not rendered on the screen. Just increase the height of the GUI and label.

(Also, you do not need the #sectionstart lines at all; these are legacy markers old 2.x versions AGS used to find functions back when it had the interaction editor.)
#309
Not a huge deal but the main forums site's title is now just "Index" :)
#310
Just to be clear: are you saying these display issues don't happen when you change the language via winsetup?
#311
Thanks @Snarky, I tested my code with the player character and forgot to change it :)

@vrazumijin Leaving aside my player/cGallo mistake, the bool is defined right there in the first line of my snippet, and you were supposed to also put that in your own room script obviously.
#312
Try this version:

Code: ags
bool walking_right; // initially false

function room_RepExec()
{
  if (!cGallo.Moving) {
    if (!walking_right) cGallo.Walk(1000, 1020); 
    else cGallo.Walk(400, 1020); 
    walking_right = !walking_right;
  }
}

edit: fixed typo
#313
You can also create a copy of Game.agf and rename it to Game.xml. Open that with a suitable editor and you can search the entire game structure with a simple text search.
#314
Just in case this matters: Windows Defender isn't too fond of AGS unfortunately.
You should
a) upgrade to AGS 3.6.1 if you haven't already
b) add your main AGS folder to the list of exclusions
#315
When you run a published game for the first time, AGS uses the acsetup.cfg in the game folder afaik.
So yes, you should be able to set a window size.

But like eri0o is hinting at, you should leave that up to the user.

Can you tell us what resolution your game has and what your end goal is here?
#316
The modified acsetup.cfg is in C:\Users\[username]\Saved Games\[gamename]\
#317
There's the "Create voice acting script" option from File menu. Or you can create a translation source.
How to answer this is unclear because you haven't told us what your actual goal is.

https://xyproblem.info/
#318
In the editor, press F7 to make sure the game is built, then choose "Run Game Setup" from the "Build" menu.
Check "Start in windowed mode", then pick an appropriate scale factor for "Windowed scale".
Now click "Save and Run".
#319
Is this for actual top-down graphics? Or was that just an illustration?

I'm asking because the method and feasibility greatly depend on the type of graphics.
#320
I was surprised this doesn't work as expected but apparently AGS only duplicates the position.
You can do this manually by adding lines like this in repeatedly_execute_always:

Code: ags
  cShirt.Loop = player.Loop;
  cShirt.Frame = player.Frame;

This obviously requires the following character to have a shirt version duplicate of the walk-cycle frames, but that's pretty much a given anyway I guess.
SMF spam blocked by CleanTalk