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

#721
Quote from: barefoot on Sat 11/06/2011 21:18:46
MODULE: KeyboardMovement v1.02: have heard you can do diagonal (up right + up left keys).. This is what I would like to implement. Have you tried it?

Of course diagonal walking works, you don't need to implement anything.
#722
A condition must be enclosed by (and). Also, in a condition you need to change = to ==.

if (gSaveGame.Visible == true)

Also, you can shorten the whole thing to this:

if (gSaveGame.Visible) gIconbar.Visible = false;

EDIT: You don't even need the condition because the GUI is visible in any case:

Code: ags

function Button5_OnClick(GUIControl *control, MouseButton button)
{
  gSaveGame.Visible = true;
  gIconbar.Visible = false;
}
#723
Btw, you don't have to select ID 0, you can simply right-click to use the eraser.
#724
No problem. You can check all the limits in the help file under Reference > System limits.
#725
Nah, that would be quite a limitation! I just checked, there's no limit for loops per view or frames per loop.
#726
Quote from: Tabata on Fri 10/06/2011 11:29:42
I don't want to see my next handy-bill

For non-german members: cellphone bill  ;)
#727
It totally depends on the style you choose and your personal preference. I myself draw characters approximately 1/3 of the screen heigth, others make them smaller or larger.. the most important thing is that they correlate with the backgrounds you make and the resolution you use. I suggest drawing some backgrounds first and then see what size the characters should have to fit in.

You can make as many animations as you like. I think there's a limit for the frames per animation but it's high and shouldn't bother you. Edit: There's no limit for frames per loop!
#728
Critics' Lounge / Re: character sprites & BG
Fri 10/06/2011 16:20:03
Thanks for the frank criticism, it's appreciated. And sorry for the late reply.

It wasn't really a decision to ignore perspective rules, I justed started drawing like this and nobody really complained (well, except for you obviously ;) ) It's just a practical thing because I can always cheat a bit to have a certain size for the walkeable area or a specific view on objects or other stuff in the room, and I can often avoid character scaling.

But maybe you're right and I think I will redo this background with proper perspective and then decide on how to proceed. I'll post it here when I'm done.
#729
option-off is a dialog command. If you want to disable an option using 'normal' scripting use Dialog.SetOptionState(int option, DialogOptionState)
#730
If the character is constantly standing on the hotspot then consequently the .Say command is constantly being repeated..

Either use a region and the "walks onto" function or use a variable to stop the command from being called again.
#731
Abstauber, you still got the ActiveInventory part wrong ;)
#732
This looks really nice. I haven't played a text based adventure in a long time and can't say that I've ever been a huge fan of such a thing but if the story is appealing and the parser sophisticated, this could be something for me.

Keep it up!
#733
Btw, you can shorten it a bit:

player.Walk(x, y);
if (Region.GetAtRoomXY(player.x, player.y) == region[1]) Display("The door has opened");
#734
Mode7, that would make a great background style for a jump'n'run game!
#735
Put a region on the other side of the river (where the hotspot is):

if (Region.GetAtRoomXY(player.x, player.y) == region[1]){
 player.Walk(x, y);
 Display("The door has opened");
}

else player.Walk(x, y);
#737
"single most useless and annoying thing"  ???

It's quite the opposite, cause the one reading the code has to either indent it himself or go through it and count/compare all the brackets which is quite annoying. Also, not indenting the code generally makes it quite error prone which has been the case here (in the tech forums) countless times. I understand that you're used to not indenting code and may have trouble changing that, but I don't at all get why you don't see its great advantage.

In your case the indentation was easy, otherwise I wouldn't have bothered..

Btw, you know that instead of

Code: ags
if (ad>0)
{
fww=(parts[ad].Width-parts[ad-1].Width)/2;
}


you can just write

Code: ags
if (ad>0) fww=(parts[ad].Width-parts[ad-1].Width)/2;


Makes things even shorter and more readable  ;)
#738
You didn't indent a single line, you just rearranged the brackets ;)

Code: ags

int ax, ox,fxx=25, fyy=0, fww, sections=20, d=20, ad;
DynamicSprite*scale, res, parts[];
DrawingSurface*bg, fx;
float rw=5.0, rh=1.0;

function room_Load()
{
  bg=Room.GetDrawingSurfaceForBackground();
  object[0].Clickable=false;
  parts=new DynamicSprite[sections];
}

function room_RepExec()
{
  if (ax>Room.Height-240)
  {
    ax=Room.Height-240;
  }
  while (ad!=sections) 
  {
    int sze=(240/sections);  
    float ratew=rw/IntToFloat(sections);
    float rateh=rh/IntToFloat(sections);
    scale=DynamicSprite.CreateFromDrawingSurface(bg, 0, ax, 320, 240);
    parts[ad]=scale;
    parts[ad].Crop(0, (sze*ad), 320, sze);
    parts[ad].Resize(parts[ad].Width-((sections-ad)*FloatToInt(ratew)), parts[ad].Height-((sections-ad)*FloatToInt(rateh)));
    fx=res.GetDrawingSurface();
    if (ad>0)
    {
      fww=(parts[ad].Width-parts[ad-1].Width)/2;
    }
    fx.DrawImage(fxx-fww, fyy+parts[ad].Height-1, parts[ad].Graphic);
    fyy=fyy+parts[ad].Height-1;
    fxx=fxx-fww;
    ad++;
  }
  ad=0;
  fx.Release();
  object[0].Graphic=res.Graphic;
  object[0].SetPosition(0, 240);
}

function on_key_press(int keycode) 
{
  if (keycode==eKeyUpArrow) ax+=d;
  if (keycode==eKeyDownArrow) ax-=d;
}


I'm totally with Khris here, unindented code is way to messy to even bother with.
#740
Sounds interesting. If you find it, please post a link. EDIT: Thanks, Khris.
SMF spam blocked by CleanTalk