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 - Crimson Wizard

#11361
Quote from: theoneelectronic on Tue 17/09/2013 15:14:08
I'm trying to make the background change when the player has an object in the inventory but without success.

player.ActiveInventory checks selected item.
To check existing items, use player.HasInventory:

Code: ags

function room_AfterFadeIn()
{
  if (player.HasInventory(iSpanner))
    {
      SetBackgroundFrame(1);
    }
  else
    {
      SetBackgroundFrame(0); 
    }
}



But in your case I'd suggest to use global variable instead to keep "generator state". Presence of inventory item is  generally irrelevant, from the game design perspective. For example, later in game player may loose the spanner or give it away - this will turn the lights off again, although generator is still working.
#11362
Hmm, which line is line #2812?
#11363
Spoiler
Err.... wtf?
Code: cpp

void SetMusicMasterVolume(int newvol) {
    if ((newvol<0) | (newvol>100))
        quit("!SetMusicMasterVolume: invalid volume - must be from 0-100");
==> play.music_master_volume=newvol+60; <==============================
    update_music_volume();
}

[close]

EDIT:
The 3.2 manual suggests that SetMusicMasterVolume() function is deprecated.
Try using System.Volume or Game.SetAudioTypeVolume().
#11364
Quote from: Radiant on Tue 17/09/2013 13:01:28
How stable is beta7 so far? Is it likely to be an RC?

I'm asking because I would like to use 3.3 for a big game release (i.e. Heroine's Quest).
Engine seem to be stable enough, at least as stable as previous 3.2.1, as it seems.
But I would hope the game be beta-tested first?
Editor has at least one crash issue (which does not seem to corrupt any data though). I am currently trying to track it down.

Quote from: Radiant on Tue 17/09/2013 13:01:28
On that note, would it be possible to fix the following bug: In a game with Sierra-style portraits and a voice pack, the amount of time that the portrait runs its mouth animation depends on the length of the text string, whereas it should instead depend on the length of the voice sample
I will look into this, but can't give any promises regarding time; the speech logic in AGS is messy.

Quote from: Radiant on Tue 17/09/2013 13:01:28
And something that's been bugging me about the 3.X line is that the keyboard shortcut control-1 to open script #1 (and ^2, ^3 etc, and shift-control-1 for script header 1) that used to be in AGS2.7 no longer exists. Would it be hard to put that back?
Hmm, what IS "script #1"? I am afraid that with current folder system (where scripts could be arranged in folders) this enumeration is pretty much nonsensical. What others think about this?
#11365
Engine Development / Re: Isometric Angles
Tue 17/09/2013 12:37:52
Quote from: Frostfalk on Tue 17/09/2013 11:43:46the feature that I would love to see in the future is the ability to change the angles for when the view changes loop (instead of 45degrees, I would have it at like 60). The reason is that the walking loops don't match the amgle of the map, making the character walk in a strange way across the map.
This is interesting; I can't put this in my plans right away (someone else maybe?), but I believe this should be possible.


EDIT: Found this very old thread with same suggestion:
http://www.adventuregamestudio.co.uk/forums/index.php?topic=14602
#11366
I might be not knowing something, what is "standalone" version and what are differences from... non-standalone(?) one?
Heh, nevermind, I think I got it.
#11367
Just a small note,

this:
Code: text

combined_alpha = 1 - (1-front.alpha)*(1-back.alpha);

is algebraically (sp?) equivalent to
Code: text

combined_alpha = front.alpha + back.alpha * (1-front.alpha);

The latter formula is given on wiki page. It is also slightly faster to calculate.
#11368
General Discussion / Re: GTA V
Mon 16/09/2013 18:28:41
Quote from: Peder Johnsen+ on Sat 14/09/2013 22:04:47
In preparation for GTA Online I've made an AGSers crew:
http://socialclub.rockstargames.com/crew/agsers
Just of curiosity, does it work with Gta IV and Max Payne 3?
#11369
Okay, I found the mistake that produced unexpected black color.

Regarding magic pink (eurgh!), this was simply because the Gui sprite did not have alpha channel. Well.. it technically was 32-bit image, but the sprite was marked as not having alpha-channel, and AGS just blended it as opaque surface over room.

To make things even more confusing, the Gui which does not have background image at all, but has background color set to transparent, works properly (translucent buttons are rendered as translucent over room background).
I feel like this:
(wtf)?????????

Anyway, this is another issue and should be dealt with separately.

E: For now I am glad to tell that Col. Knox'es Inventory works well both in its original and modified way (without gInvBackground).
#11370
I just wanted to ask your opinion, do you think this template is worth (useful and well-scripted) to be added to AGS Editor distribution for the future versions?

Also, sorry for not being able to check this thoroughly myself, - are all of the modules/features included are actually used by the template logic? I am asking, because Ghost included Tween module in the previous version of his "BASS Stub" template, which was not directly used anywhere in template scripts.
#11371
Quote from: Snarky on Mon 16/09/2013 10:08:42However, from that hex value, it looks like the magic pink pixels don't in fact have zero alpha, but are set to opaque (which I guess is the whole point of magic pink; I thought it was stored internally with 0 opacity, but that doesn't seem to be the case)
No, it has opacity (alpha) = 0. The format is ARGB with blue being the lower byte and alpha being the highest byte...
So 0x00FF00FF is:
A: 00
R: FF
G: 00
B: FF:

EDIT: corrected myself.
#11372
Quote from: Snarky on Fri 13/09/2013 09:26:38
Code: AGS
combined_rgb = (front.rgb * front.alpha + back.rgb * (1 - front.alpha) * back.alpha) / combined_alpha;  // Now verified


<...>
I believe if you switch to this formula, it should also take care of the magic pink problem without any special case code.

<...>
Edit: I've had a chance to think it over, and also check with Wikipedia (see the final formula in the Description section), and yes, this is the correct formula.

Okay, with this formula I am combining translucent Gui & Button sprites and the results are identical to what I see in graphic editor (I use Paint.Net) when I make 2 translucent layers over 1 opaque one. If I do not make final division (by combined alpha) the result has something in common, but with relatively darker colors (less brightness?).

But now I got two different troubles:
1) When opaque control color is drawn on opaque gui color, result is pitch black. Translucent colors combine with opaque fine.
2) When translucent control color is drawn over gui pixels with zero alpha (e.g. magic pink 0x00FF00FF) the result is opaque.
Maybe I made some silly mistake in algorythm implementation...
#11373
The Rumpus Room / Re: *Guess the Movie Title*
Sun 15/09/2013 16:07:39
#11374
The Rumpus Room / Re: *Guess the Movie Title*
Sun 15/09/2013 16:05:20
Quote from: bbX1138 on Sun 15/09/2013 16:02:45
That looked like Robert Mitchum and it's in colour, so The Big Sleep?
No, but close :).
#11375
Well, I think it is possible to script this as a module , but this way you won't be able to make it a "real" AGS font.
Meaning, you won't be able to use this "pseudo-font" with built-in display boxes, speech, etc.

You may script a function that draws a text using bitmap tileset.
You may either import whole font as single big sprite, or as a multiple sprites - one per letter/symbol. In the first case you'll also need an array of coordinates to find letters inside big sprite.

E: I must apologize, I don't have enough time to make a proper AGSScript example right now. But the drawing algorythm should be rather straightforward.
Here, you may use Calin's plugin source as a basic reference:
https://github.com/adventuregamestudio/ags/blob/master/Plugins/AGSSpriteFont/AGSSpriteFont/SpriteFontRenderer.cpp#L83
It's C++, but it looks very similar to AGSScript.
#11376
The Rumpus Room / Re: *Guess the Movie Title*
Sun 15/09/2013 15:48:44
Quote from: miguel on Sun 15/09/2013 09:25:51
Home From The Hill?
No.

Quote from: Ponch on Sun 15/09/2013 04:36:34
Holy crackers, Crimson Wizard. I'm starting think that you may be the person to finally win this thread. I have NO idea what this is. :P
Lol. I thought there were already few movies guessed by cheatinggoogling, no?

This is the US movie. The story takes place in 1940-ies LA. The protagonist is the private detective. There's a mystery, betrayal and many dead bodies (hehe).


E: More funny people:
Spoiler


[close]
#11378
The Rumpus Room / Re: *Guess the Movie Title*
Sat 14/09/2013 23:39:05
#11379
Quote from: dbuske on Sat 14/09/2013 19:41:03
Do you have a complete list of options that can be disabled, and maybe enabled?
I gave the full options list above. These are really only ones which may be disabled.

Also, the filter names that can be disabled are:
Code: text

// nearest-neighbour filters:
StdScale2
StdScale3
StdScale4
// anti-aliased nearest-neighbour:
AAx2
AAx3
AAx4
// Hq filters:
Hq2x
Hq3x




I am still wondering why would someone want to disable any of those. Why would you?

E: I am asking, actually, because I am rewriting setup for "custom resolutions" build I am making now (the original code is really bad), and I am considering removing unneeded stuff. So I want to know if someone ever used this "disable" feature, and why should anyone need it at all.
#11380
Engine Development / Re: Set-up editing
Sat 14/09/2013 19:38:20
Only by changing the engine source code.
Alternatively you may create your own setup program, which should not be really difficult if you can program user interface. The configuration is saved in a simple text format, known as INI (http://en.wikipedia.org/wiki/INI_file).

Also, there was already some discussion here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=48097.0
SMF spam blocked by CleanTalk