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

#21
Hi! Smee again!

I have a further question:
If I have a scrolling room, aand I enable the magnifier - The picture behind the magnifier (which I think is the dynamic sprite from the background) will only show magnified whats in the first picture of the room, regarding my room resolution. So put simple: I walk right, the room scrolls, the magnifier acts as if the room would not scroll.
I know it's asked way to much of you to go trough all the Modules Code, if you don't have time/mood it's okay.



Code: ags

void Update(this MagnifierType*) {
  if ((this.AGSGUI == null) || (this.Sprite <= 0)) {
    this.Enabled = false;
    return;
  }
  if (this.prevenabled != this.Enabled) { // toggle on/off
    if ((this.HideMouseCursor) || (this.prevhidemouse)) {
      if (this.Enabled) this.HideCursor();
      else this.ShowCursor();
    }
  }
  else if ((this.prevhidemouse != this.HideMouseCursor) && (this.Enabled)) {
    if (this.HideMouseCursor) this.HideCursor();
    else this.ShowCursor();
  }
  this.prevhidemouse = this.HideMouseCursor;
  if (this.ScaleFactor <= 0.0) this.ScaleFactor = 0.1;
  this.prevenabled = this.Enabled;
  this.AGSGUI.Visible = false;
  if (!this.Enabled) return;
  this.AGSGUI.BackgroundGraphic = 0;
  this.X = mouse.x;
  this.Y = mouse.y;
  if ((this.X + this.XOffset) < 0) this.AGSGUI.X = 0;
  else if ((this.X + this.XOffset) >= System.ViewportWidth) this.AGSGUI.X = (System.ViewportWidth - 1);
  else this.AGSGUI.X = (this.X + this.XOffset);
  if ((this.Y + this.YOffset) < 0) this.AGSGUI.Y = 0;
  else if ((this.Y + this.YOffset) >= System.ViewportHeight) this.AGSGUI.Y = (System.ViewportHeight - 1);
  else this.AGSGUI.Y = (this.Y + this.YOffset);
  DynamicSprite *sprite = DynamicSprite.CreateFromExistingSprite(this.Sprite, false);
  int x = (FloatToInt(IntToFloat(this.X) * this.ScaleFactor) + this.XOffset);
  int y = (FloatToInt(IntToFloat(this.Y) * this.ScaleFactor) + this.YOffset);
  sprite.ChangeCanvasSize(FloatToInt(IntToFloat(System.ViewportWidth) * this.ScaleFactor), FloatToInt(IntToFloat(System.ViewportHeight) * this.ScaleFactor), x, y);
  this.BackgroundSprite = DynamicSprite.CreateFromBackground();
  DrawingSurface *surface = this.BackgroundSprite.GetDrawingSurface();
  int i = 0;
  while ((i < Game.CharacterCount) || (i < Room.ObjectCount)) {
    if (i < Game.CharacterCount) {
      if (character[i].Room == player.Room) {
        ViewFrame *frame = Game.GetViewFrame(player.View, player.Loop, player.Frame);
        int w = ((Game.SpriteWidth[frame.Graphic] * character[i].Scaling) / 100);
        int h = ((Game.SpriteHeight[frame.Graphic] * character[i].Scaling) / 100);
        surface.DrawImage(character[i].x - (w / 2), character[i].y - h, frame.Graphic, 0, w, h);
      }
    }
    if (i < Room.ObjectCount) {
      if (object[i].Visible) {
        int graphic = object[i].Graphic;
        if (object[i].View) {
          ViewFrame *frame = Game.GetViewFrame(object[i].View, object[i].Loop, object[i].Frame);
          graphic = frame.Graphic;
        }
        int w = Game.SpriteWidth[graphic];
        int h = Game.SpriteHeight[graphic];
        if (!object[i].IgnoreScaling) {
          int scale = GetScalingAt(object[i].X, object[i].Y);
          w = ((w * scale) / 100);
          h = ((h * scale) / 100);
        }
        surface.DrawImage(object[i].X, object[i].Y - Game.SpriteHeight[graphic], graphic);
      }
    }
    i++;
  }
  surface.Release();
  this.BackgroundSprite.Resize(FloatToInt(IntToFloat(this.BackgroundSprite.Width) * this.ScaleFactor), FloatToInt(IntToFloat(this.BackgroundSprite.Height) * this.ScaleFactor));
  sprite.ChangeCanvasSize(this.BackgroundSprite.Width, this.BackgroundSprite.Height, 0, 0);
  this.BackgroundSprite.CopyTransparencyMask(sprite.Graphic);
  int w = Game.SpriteWidth[this.Sprite];
  int h = Game.SpriteHeight[this.Sprite];
  int ww = this.BackgroundSprite.Width;
  int hh = this.BackgroundSprite.Height;
  if ((ww > w) && (hh > h)) this.BackgroundSprite.Crop(x, y, w, h);
  else if (ww > w) {
    this.BackgroundSprite.Crop(x, 0, w, hh);
    if (hh < h) this.BackgroundSprite.ChangeCanvasSize(w, h, 0, (h - hh) / 2);
  }
  else if (hh > h) {
    this.BackgroundSprite.Crop(0, y, ww, h);
    if (ww < w) this.BackgroundSprite.ChangeCanvasSize(w, h, (w - ww) / 2, 0);
  }
  else this.BackgroundSprite.ChangeCanvasSize(w, h, (w - ww) / 2, (h - hh) / 2);
  if ((ww <= w) || (hh <= h)) {
    sprite = this.BackgroundSprite;
    this.BackgroundSprite = DynamicSprite.Create(w, h, false);
    surface = this.BackgroundSprite.GetDrawingSurface();
    surface.Clear(0);
    surface.DrawImage(0, 0, sprite.Graphic);
    surface.Release();
  }
  surface = this.BackgroundSprite.GetDrawingSurface();
  if (this.ScaleFactor < 1.0) {
    surface.DrawingColor = 0;
    int xm = FloatToInt(IntToFloat(System.ViewportWidth) * this.ScaleFactor);
    int xx = (x + w);
    if (x < 0) surface.DrawRectangle(0, 0, -x, surface.Height);
    if (xx >= xm) surface.DrawRectangle(xm - x, 0, xx - x, surface.Height);
    int ym = FloatToInt(IntToFloat(System.ViewportHeight) * this.ScaleFactor);
    int yy = (y + h);
    if (y < 0) surface.DrawRectangle(0, 0, surface.Width, -y);
    if (yy >= ym) surface.DrawRectangle(0, ym - y, surface.Width, yy - y);
    if ((x < 0) || (y < 0) || (xx >= xm) || (yy >= ym)) {
      surface.Release();
      sprite = DynamicSprite.CreateFromExistingSprite(this.Sprite, false);
      this.BackgroundSprite.CopyTransparencyMask(sprite.Graphic);
      surface = this.BackgroundSprite.GetDrawingSurface();
    }
  }
  surface.DrawImage(0, 0, this.Sprite);
  surface.Release();
  x = (this.X + this.XOffset);
  y = (this.Y + this.YOffset);
  int xx = (x + w);
  int yy = (y + h);
  if ((xx <= 0) || (yy <= 0) || (x >= System.ViewportWidth) || (y >= System.ViewportHeight)) {
    this.BackgroundSprite = null;
    this.AGSGUI.BackgroundGraphic = 0;
    this.AGSGUI.Width = 1;
    this.AGSGUI.Height = 1;
  }
  else {
    if ((x < 0) && (y < 0)) this.BackgroundSprite.Crop(-x, -y, this.BackgroundSprite.Width + x, this.BackgroundSprite.Height + y);
    else if (x < 0) this.BackgroundSprite.Crop(-x, 0, this.BackgroundSprite.Width + x, this.BackgroundSprite.Height);
    else if (y < 0) this.BackgroundSprite.Crop(0, -y, this.BackgroundSprite.Width, this.BackgroundSprite.Height + y);
    this.AGSGUI.BackgroundGraphic = this.BackgroundSprite.Graphic;
    this.AGSGUI.Width = this.BackgroundSprite.Width;
    this.AGSGUI.Height = this.BackgroundSprite.Height;
  }
  this.AGSGUI.Visible = true;
}
#22
Aha, yes that worked!
Thank you so much :)

Ah By the way... I just realized it doens't work in scrolling rooms... I'll check if anything is mentioned in the Module Thread.
#23
Hi guys!

Trying to avoid necroposting here. If an admin thinks this belongs to the module thread, I'm begging your pardon :/

So, I upgraded to the newest AGS Version. Looks, nice, works nice, all good.

I wanna use the Magnifier-Module for animating a Sniper-Crosshair while using a rifle.
So far so good. I used the magnifier Module before, in AGS 3.2.1. and it worked.
So, I set up the code provided by the Manual, but this time I got the error "Attributes of identifier do not match prototype", and it refers the first line of this chunk of code from the magnifier.ash.


Code: ags

bool IsModeEnabled(this Mouse*, CursorMode mode) {
  CursorMode prevmode = this.Mode;
  this.Mode = mode;
  bool enabled = (this.Mode == mode);
  this.Mode = prevmode;
  return enabled;
}


Any ideas?
#24
Hi guys,

So after being a rather silent member for over half a year now, I thought maybe I'll give this introduction thread a try.

So, I'm loslem. I'm a lab technician from germany. So much for my day-job.

I think the first idea of making an adventure game came to my mind when I started hosting small pen&paper adventures for my friends. If I write stories and swtting and riddles...why not make a point&click thing out of it. I just googled around, found some blogs about engines and decided AGS looks the best. So I got it, tried around with it and thought "a dang, you'll need a programmer and a graphics guy...". So I didn't really think I would continue with it.
Fast forward three weeks. I'm looking like a crack addict, because I was scripting random stuff in the templates just to see if it works, spending 3 hours to figure out why a code won't work, then getting it to work, celebrating for 5 minutes and picking the next problem to solve. But: it was fun, so I thought "maybe you could do this". So I continued.

I realize I'm writing a whole memoire here, I'll wrap it up:
If it comes to art I'm a jack of all trades. I don't know how to do a thing? Heck, I'll figure something out. This also correlates with my love of punk-art and garage-rock. There is no you cannot do it. Just begin somewhere and make the best you can. Of course mostly the stuff has a raw or thrashy style, often going somewhere dark. But that's stuff I enjoy, so that's stuff I make.
I draw, I write stories, I make music, and most recently... seems I like making games.

It's good to be with you guys, a lot of helping folks around here, I hope to submit more games over the next years :)
#25
General Discussion / Re: Stranger Things 2
Sun 05/11/2017 15:49:48
After season 1 endet, I thought "Whew, if it ended right here, I'd still be satisfied." And then I wondered what Season 2 could bring. And I must say, it really topped season 1. It expanded the characters in logical ways (Steve for the win!), it expanded the story. It just was written good.
I loved it. Also I liked the little hints and nods to Stephen King or the goonies :)

So yes, good times for seriesjunkies :)
#26
Wow, I feel chuffed :)
Thanks guys. Clearly a motivation to keep going!
#27
Aaah, even better! Thanks Khris :)
#28
Thanks Dude! That was quick and did the trick :)
That's really one of my rookie prolems... using commands is no problems, but what all these different types of things do... no clue.
Well that's what help forums are there for, thanks again!
#29
Hi guys,

so for the first time I want to use some custom functions to generate me some shortcuts.

It's just about getting the charcater to play a pickup animation, making the object invisible and adding the item to the inventory.
That'S really an old issue, and I started by digging up some old Code-Advice that Khris scripted 10 Years ago or so.
So, in the Globalscript I have
Code: ags
function PickUpLow(int dir, int obj, InventoryItem*inv) {
  player.LockView(6); // change this to the pick up-view 
  player.Animate(2, 5, eOnce, eBlock); // play pick up-animation, make sure it's blocking
  object[obj].Visible=false; // turn off object
  player.AddInventory(inv);
  player.UnlockView();
}


Int he GLobalscript Header:
Code: ags
import function PickUpLow(int dir, int obj, InventoryItem*inv);


In my Roomscript it will be;
Code: ags
function oBlueCup_AnyClick()
{
  if (Verbs.MovePlayer(523, 531)) {
    // LOOK AT
    if(Verbs.UsedAction(eGA_LookAt)) {
      player.Say("It's a blue cup.");
    }
    // USE
    else if(Verbs.UsedAction(eGA_Use)) {
      player.Say("I'd rather pick it up.");
    }
    // Push
    else if(Verbs.UsedAction(eGA_Push)) {
      player.Say("It might break.");
    }
    // Pull
    else if(Verbs.UsedAction(eGA_Pull)) {
      Verbs.Unhandled();
    }  
    // PICKUP
    else if(Verbs.UsedAction(eGA_PickUp)) {
      PickUpLow(eDir_Right, oBlueCup, iCup);  
    }
    //USE INV
    else if(Verbs.UsedAction(eGA_UseInv)) {
      Verbs.Unhandled();
    }
    // don't forget this
    else Verbs.Unhandled();
  }
}


My Error reads:
Error (line 105): Type mismatch: cannot convert 'Object' to 'int'


My guess is that maybe some codestuff was updated in the timespan of ten years, and I'm just missing something obvious. 
So... Any thought?
#30
Thanks matti, I must have uploaded a wrong version that I compiled while bugfixing...
I'm so sorry, I tend to get dizzy while working on stuff at 10pm after putting my son to bed.
Thanks for reporting, I will fix the latest issues!


EDIT: Fixed the issue with the wrong compiled English Exe. Now you start at the title.
#31
Thanks Khris, I know you're very experienced so to me as a newbie that means a lot :)
And you're right, I've heard more than one time that the effect is to crass. I'll alter the sprites so it will flicker less.
And maybe in a year or so you'll see it in a gane ;)
#32
The Rumpus Room / Re: What's your "Day Job"
Thu 07/09/2017 12:22:49
I'm a lab technician in germany. Nothing special really ^^
#33
Hi Guys,

I'm not much of a scripter, so I work mostly with workarounds and creative stuff I fuddle together.
So, here's what I have in mind:
I want acharacter to be able to use a Nightvision Mode.
Until now I managed to do this (I fuddled around with Abstaubers Tumbleweed Demogame, I mostly do this when just trying out stuff):

Code: ags

// Push
    else if(Verbs.UsedAction(eGA_Push)) {
     gGui1.Visible=true;
    gGui1.LockView(VIEW4);
  gGui1.Transparency = 0;
  gGui1.Animate(0, 1, eOnce, eBlock);
  SetBackgroundFrame(1);
  gGui1.Transparency = 25;
  gGui1.Animate(1, 1, eRepeat, eNoBlock);
  SetAmbientTint(0, 155, 0, 100, 100);


Video Example:
https://www.youtube.com/watch?v=hlHwBXSVnEY

Basically I created a GUI over the whole screen and animated it with the Gui Animation Module. Loop 0 is the startup (think of turning on an old TV), Loop 1 is the grainy flickering overlay to give this atmosphere. I wasn't satisfied with the TintScreen command, so I decided to alter the BackgroundFrame in GIMP and call this when turning nightvision on. (though I'd like to avoid this I think it's won't be much of extra work, the Nightvision should only be needed in certain rooms) The character is tinted all green via SetAmbientTint. I thought the object should be tinted to, but somehow this does not work until now. Maybe I'll just have to alter the Object sprites to and set animations there..though this could be really a lot of work...


Question: so far, do you like the idea?
And how could I improve. For example I don't know how to pack the commands in one line of script so that I could call it with one line like "nightvision_on();" or so.
Also the objects not tinting with the ambient tint. The manual says it should tint all objects and characters.

Oh, forgot to mention: I used the newest AGS beta (3.4. Beta 7)


EDIT: OKay, I solved the Object Issue. "Use Ambient Light Level" was set to false. Everything cool now.
#34
Hints & Tips / Re: The House without Windows
Sun 27/08/2017 14:38:46
No problem, I'll give you a hint :)

Spoiler
Try to make the Sick making root to into a syrup (You'll need something you already used in the first dream). Then with the make vomit-syrup try to find something to feed it to. More specific: I think you already saw a mouth while exploring, didn't you?
[close]
#35
Quote from: Crimson Wizard on Fri 18/08/2017 11:32:36
Quote from: Loslem on Thu 17/08/2017 06:28:51
As for the configuring-problem: I think I did the mistake to name the project "schwarzweiàŸrot", when I created the project-file... That's what happens if you are german :(
For now I think we have to live with that, eh? This can't be changed after the file was named, orrr?

You can rename the project folder, and rebuild the game, this will change its exe name. (This is undocumented "feature" of AGS)

Did that and it worked! Thanks for the help!
#36
Thanks for reporting, I'll look into the issues this evening!

EDIT: I fixed the game-crashing bug Shadow ran into.

As for the configuring-problem: I think I did the mistake to name the project "schwarzweiàŸrot", when I created the project-file... That's what happens if you are german :(
For now I think we have to live with that, eh? This can't be changed after the file was named, orrr?
#37
Hi guys!


So, for the most I've been creeping the forum for some months now and I finished making my first little game. (There really was next to no need to post something, it's amazing how much answers are provided in old help-threads.)

In "The House without windows" you take control over Ida, a girl who investigates a haunted house.


Screenshot_20170814-124631 by Andreas Wachtendorf, auf Flickr

Screenshot_20170814-124412 by Andreas Wachtendorf, auf Flickr

I choose a rather trashy stile (mostly because I like trashy stuff). I only used 3 colours, the soundtrack is more like a louisiana-americana thing.

Well, as many first games I think it's not perfect, but in the process I learned a lot. I hope it's still fun to play.


The game is set up with the 9-Verb-Template and uses some modules, credited in the credits.

It's available in GERMAN and ENGLISH.

Edit: I forgot to mention: playtime is roughly half an hour up to an hour (If you don't run in any problems :-/)

Update
17.08: fixed some translation mistakes and abug that got you stuck in a dialog

Update
19.08.17: changed the game name, now setting up the game works.

Update:
12.09.17: I have to apply somw fixing to the English Version, so for some days I'll take it down. I'll try to be fast. Thanks to everyone who played the game already and thanks for the nice constructive feedback :)
EDIT: It's up again. Thx for waiting!

GERMAN
https://www.dropbox.com/s/vym0d5keav9fi2d/SchwarzweissrotGERMAN.rar?dl=0

ENGLISH
https://www.dropbox.com/s/bvfa0serwa66d13/SchwarzWeissRotENGLISH.rar?dl=0
#38
Ah, ohmygod that makes so much sense... I never thouhgt of the doors working that way. It seems to work now :)

Now regarding the sound...

That's what I find in the script:
Code: ags

#ifdef USE_OBJECT_ORIENTED_AUDIO
// In AGS 3.2 you do it this way:
//   Audioclip *openDoorSound = aDoorsound;
AudioClip*  openDoorSound,  
            closeDoorSound, 
            unlockDoorSound;    
#endif


Aaaand I don't relly get the pointer stuff...
So this here doesn't work.
Code: ags

#ifdef USE_OBJECT_ORIENTED_AUDIO
// In AGS 3.2 you do it this way:
//   Audioclip *openDoorSound = aDoorsound;
AudioClip *openDoorSound = aTuerAuf,
            closeDoorSound = aTuerzu,
            unlockDoorSound = aTuerAuf;    
#endif

Debugger says: "Cannot assign initial Value to global pointer"
Sry guys, for the most part of the coding stuff I'm doing fine, but here I don't get how it's done right :/

#39
Thanks to you both :)

Just to clarify: Does that mean that every door in the whole game should have an ID on it's own? I thought that was linked to the room, so I started over from ID 1 in every room. Ahehehe...
#40
Hu guys!

I have 2 questions, both regarding the doorscript.
1. That may be the simpler one: where can I define the default door sounds for opening and closing? The 9Verb pdf says that these sounds will be called if the script is used... but I don't know where to insert them ^^

2. My game is set in a house, hence I use a lot of doors. So when I test the game and run around the rooms, from time to time it happens that doors lock themselves(and of course then there is no key exising). Or doors that should be closed are open. Or the door is open, but the object sprite is not displayed. Anyone else has similar experiences?
SMF spam blocked by CleanTalk