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

#1682
1. I don't think so.

2. SetRestartPoint

3. With AGS v2.7 you will be able to easily switch GUI controls on/off with the .Visible property, but with AGS v2.62 you have to move them away with SetGUIObjectPosition.
#1683
QuoteAlso don't you think the text should be centered vertically as is currently done horizontally?  I suppose something like that is in the tracker somewhere?

Indeed: http://www.adventuregamestudio.co.uk/tracker.php?action=detail&id=180
#1684
NewRoom/Ex is a delayed-response command, meaning it gets executed when the script finishes.
So if you do

Code: ags

  NewRoom(1);
  SetCursorMode(MODE_WALK);


SetCursorMode is actually executed before the room has changed, and since the player character is hidden, it doesn't change to the walk mode.

What you can do is, on "Player enters screen (before fadein)" in room 1:

Code: ags

  if (character[GetPlayerCharacter()].prevroom == 999) { // if coming from menu screen
    SetCursorMode(MODE_WALK); // change to walk mode
  }
#1685
If you tick "Hide player character" for a room, the walk mode is not accessible since there's no player character there that can be moved.
#1686
At least here in Germany, you can do free, anonymous HIV tests at your local public health department/health office/health authority/whatever it's called.
#1687
Hm, since objects and characters can move around, it's probably better not to use fixed positions for the gui but rather use descx/descy as offsets from the object's/character's current position, i.e.:

Code: ags

  //...
  else if (overwhat == 2) { // if mouse is over a character
    int charid = GetCharacterAt(mouse.x, mouse.y);
    newguix = character[charid].x + (GetCharacterProperty(thechar, "descx"));
    newguiy = character[charid].y + (GetCharacterProperty(GetCharacterAt(mouse.x, mouse.y), "descy"));
  }
  else if (overwhat == 3) { // if mouse is over an object
    int objid = GetObjectAt(mouse.x, mouse.y);
    newguix = GetObjectX(objid) + (GetObjectProperty(objid, "descx"));
    newguiy = GetObjectY(objid) + (GetObjectProperty(objid, "descy"));
  }
  //...


Edit: Added code for objects.
#1688
Code: ags

#ifndef AGS_STRING_LENGTH
  #define AGS_STRING_LENGTH 200
#endif


If you indent the second line with a tab, you get

QuoteParse error: unexpected '#'
#1689
Critics' Lounge / Re: new walkcycle
Mon 14/02/2005 11:17:23
Yes, for animations, you can connect loops so you can have more frames, but for walkcycles the maximum is 20 frames for each direction.
#1692
Ah, I didn't know Discworld does it like that.
Ok, then I would do all of the above except the rep_ex part, then:
Create two custom number properties, for example "descx" and "descy" where you can enter where the GUI should appear for each hotspot/character/object, then in repeatedly_execute:

Code: ags

  //...

  int newguix, newguiy; // declare variables that will hold the GUI's new position

  int overwhat = GetLocationType(mouse.x, mouse.y); // get what the mouse cursor is over

  if (overwhat == 1) { // if mouse is over a hotspot
    // get this hotspot's gui position values from its properties:
    newguix = GetHotspotProperty(GetHotspotAt(mouse.x, mouse.y), "descx");
    newguiy = GetHotspotProperty(GetHotspotAt(mouse.x, mouse.y), "descy");
  }
  else if (overwhat == 2) { // if mouse is over a character
    newguix = GetCharacterProperty(GetCharacterAt(mouse.x, mouse.y), "descx");
    newguiy = GetCharacterProperty(GetCharacterAt(mouse.x, mouse.y), "descy");
  }
  else if (overwhat == 3) { // if mouse is over an object
    newguix = GetObjectProperty(GetObjectAt(mouse.x, mouse.y), "descx");
    newguiy = GetObjectProperty(GetObjectAt(mouse.x, mouse.y), "descy");
  }

  SetGUIPosition(THENEWGUISNAME, newguix, newguiy);

  //...


Edit: Fixed typos, added indentation.
#1693
Create a new GUI, put a Label control on it, change the label's text to @OVERHOTSPOT@, uncheck the GUI's "Clickable" checkbox and put

Code: ags

SetGUIPosition(THENEWGUISNAME, mouse.x, mouse.y);


in the repeatedly_execute function (menu "Script" -> "repeatedly_execute").

This has been asked many times before, try a forum search next time.

Oh, and Welcome to the forums! :)
#1695
Quote from: RickJ on Wed 02/02/2005 22:44:43
Quote
Yes, a prefix should definitely be used. I also think adding a (maybe abbreviated) prefix to function names would help grouping related functions for the auto-complete feature.
I am not sure exactly what you mean by abbreviated prefix?   Do you mean an abbreviation of the module name or additional abbreviations, such as "DelSection(), DelOption(), DelValue()" to control the list order in the auto complete.   I think abbreviating the module name increases the possibility of name collisions.

Yeah, I was thinking of INI_DoStuff(), but you're right that it could easily cause name collisions.
Static functions grouped together by the full module name is probably the best approach, i.e.

Code: ags

struct IniFile {
  import static function SomeStuff();
  import static function SomeOtherStuff();
};


Quote from: RickJ on Wed 02/02/2005 22:44:43
I wonder if the demo game should be a seperate download though?  The module files are so small in comparison.

I for one will put it into the package. It depends on the size of the demo but the default game is so small, a few kilobytes more don't matter to most people. It's up to the module author, really.

As for documentation, everyone has their own idea of what it should look like.
I say keep it simple, just put up a few recommendations of what a proper doc should contain and the file format (TXT or HTML) and let's leave it at that. Anything else is a waste of time IMHO. The programming conventions part is far more important.
#1696
Quote from: GarageGothic on Wed 09/02/2005 18:59:30As for the transparency thing: Keep in mind that this wouldn't work if you're using an all-transparent gui. Possibly an option to darken/tint disabled buttons would be another solution.

Are you referring to my idea?
It works great for me. Notice I wrote "see-through", i.e. setting fore- and background color to 0, not setting its transparency level.
What good is an all-transparent gui that you can't see? ;)
#1697
Quote from: Pumaman on Tue 08/02/2005 20:19:22
Quote
mouse.ChangeModeGraphic doesn't work properly with the UseInv mouse cursor.
It works if it is the current cursor mode, but each time you cycle to it with mouse.SelectNextCursorMode, it resets to the active inv item's sprite.

Use SetGameOption with OPT_FIXEDINVCURSOR to stop this behaviour.


Or check "Don't use inventory graphics as cursors" in General settings.
However, doing it this way, it doesn't use the inv item's custom hotspot location, so it's probably better to use the workaround above.
#1698
QuoteThe reason for that is that changing it would require people to rework tons and tons of code, for no real advantage.

I'm either a sucker for consistency or a nitpicker, but I would like to have them capitalized. :P
If object-based scripting is enforced, a lot of code has to be reworked anyway, so why not capitalize them there?

Edit:

mouse.ChangeModeGraphic doesn't work properly with the UseInv mouse cursor.
It works if it is the current cursor mode, but each time you cycle to it with mouse.SelectNextCursorMode, it resets to the active inv item's sprite.
#1699
Yeah, I'm also not fond the gray pixel pattern.
I wanted to have transparency too so what I did is make two GUIs on top of each other, one as the background and the other one see-through, holding the GUI controls (gMain).
Then, in repeatedly_execute_always:

Code: ags

if (IsInterfaceEnabled() == false) gMain.Transparency = 50;
else gMain.Transparency = 0;


This way, only the buttons appear to become transparent when the interface is disabled.

Edit:

But Button.DisabledGraphic is a nice idea, it would allow for easy customization of the behaviour.
#1700
Advanced Technical Forum / Re: Walkable Areas
Tue 08/02/2005 07:44:50
I'm not certain what your problem is, but a character's coordinate point is at the very bottom-middle of the sprite.
Make sure there's no empty space below his feet or make walkable areas smaller to compensate for this.
SMF spam blocked by CleanTalk