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 - Calin Leafshade

#61
Bravo!

Custom speech is something I have hacked in a few times using an empty font but having some interface for that would be great
#62
Eternally Us go a lot of play outside the hardcore adventure gamer community and many people just didn't understand that you could look at things with a right click(Which is required for a puzzle).
So some kind of tutorial is probably needed for the adventurally challenged in the population.
#63
The origin of Objects is the bottom left. So you the Y coord would be GetViewportY() + System.ViewportHeight
#64
Ideally I'd like a much more flexible preferences system. A key/value system similar to visual studio.

But having the ability to switch between a light and dark theme for AGS would be great in the interim.
#65
If a dialog (or indeed other items i imagine) exceed the maximum allowed length then the new data writer throws "Can't resolve import dMyDialogWithALongName" but the old compiler gives the correct error message about the length.
#66
I've made several AGS games now and have *never* used CallRoomScript.
#67
Mine doesn't, no.
#68
Also I'm getting the same hard link error that blackthorne is getting.
#69
I've got some weirdness with the new compiler and for loops. Something weird is happening.

Take this short piece of code

Code: ags

    Display("%d", top);
	for(y = start; y < h; y++) {
		bool found = false;
		for(x = 0; x < w; x++) {
			p = ds.GetPixel(x,y);
			if(p != COLOR_TRANSPARENT) {
				found = true;
				break;
			}
		}
		if (!found) {
			bottom = y;
			break;
		}
	}
	Display("%d", top);


The display at the top shows 5 and the display at the bottom shows 10 despite the top variable never being altered.
#70
Advanced Technical Forum / Fatal Exception
Wed 10/12/2014 20:36:34
I'm getting this error:

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x004DC2AC ; program pointer is -42, ACI version 3.4.0.2, gtags (73,24)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and post the details on the AGS Technical Forum.

in "Utilties.asc", line 50
from "Utilties.asc", line 96


Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.

An error file CrashInfo.dmp has been created. You may be asked to upload this file when reporting this problem on the AGS Forums. (code 0)
---------------------------
OK   
---------------------------

Looks like it might be some scoping issue with nested for loops.

It happens in this function: (I will mark line 50)

Code: ags

function writeSpriteFont(int fontNum) {
	String fontstring = "";
    int i = 32;
	for(i=32;i <= 126; i++){
		fontstring = fontstring.Append(String.Format("%c", i));
	}
	int w = GetTextWidth(fontstring, fontNum) + 5;
	int h = GetTextHeight(fontstring, fontNum, w) + 2;
	DynamicSprite *s = DynamicSprite.Create(w * 2,h);
	DrawingSurface *ds = s.GetDrawingSurface();
	Rectangle* rects[] = new Rectangle[127];
	String metrics = "";
	ds.Clear();
	ds.DrawingColor = 15;
	int x = 0;
	for(i=32; i<=126; i++) {
		ds.DrawString(x,0,fontNum,String.Char(i));
		int ww = GetTextWidth(String.Char(i), fontNum);
		rects[i] = Rectangle.Create(x,0,ww,h);
		x += ww;
	}
	
	int top = -1;
    int y = 0;
    
	for(y = 0; y <= h - 1; y++)
    {
		for(x = 0; x <= w-1; x++) {
			int p = ds.GetPixel(x,y);
			if (p != COLOR_TRANSPARENT) {
				top = y;
				break;
            }
		}
		if(top > -1) {
			break;
		}
    }
	
	int bottom = -1;
    int start = 3;
    if (top > -1) {
        start = top;
    }
	for(y = start; y < h; y++) {
		bool found = false;
		for(x = 0; x < w; x++) {
                        Display("%d %d %d %d", x,  y,  ds.Width,  ds.Height); // <-- THIS LINE WILL ALSO CRASH IT.       
			int p = ds.GetPixel(x,y); // <-- THIS WAS THE OFFENDING LINE
			if(p != COLOR_TRANSPARENT) {
				found = true;
				break;
			}
		}
		if (!found) {
			bottom = y;
			break;
		}
	}
	
	ds.Release();
	
	if (top > 0) {
		s.Crop(0,top,w,h);
		for(i = 0; i < 127; i++) {
            if (rects[i] != null) {
                rects[i].y = top;
            }
		}
	}
	
	if (bottom > 0) {
		s.Crop(0,0,w,bottom - top);
		for(i = 0; i < 127; i++) {
            if (rects[i] != null) {
                rects[i].height = s.Height;
            }
		}
	}
	
    s.SaveToFile("spritefont.bmp");
    
	//now build metrics
    File *f = File.Open("metrics.txt",eFileWrite);
    for(i = 0; i < 127; i++) {
        if (rects[i] != null) {
            f.WriteRawLine(String.Format("SetGlyph(%d, %d, %d, %d, %d, %d);[", fontNum, i,  rects[i].x, rects[i].y,rects[i].width,rects[i].height));
        }
    }
	f.Close();
	
}


EDIT: Ok no, it's a compiler issue. If i define "p" earlier in the script then it works. Seems that the compiler allows int p to be defined twice (I thought it would be allowed because they are different scopes (in other languages))
#71
I've been considering a NuGet like system for AGS for a while. I think it would be pretty simple to do. That would negate the need for symbolic links and such.

The main problem with that is the lack of forward declarations so the ordering of scripts is important.
#72
I'm going to have a go this month. Looks like fun.
#73
I'd like to know the reasons why they are doing so. There doesnt seem to be any real advantage
#74
I'm almost of the opinion that they idea of colour depth should be removed entirely from AGS.

Modern systems dont really cope with anything less than 32-bit surfaces. It disables aero and isnt really much faster anyway.

The only possible benefit is to reduce file size which is hardly a concern at this stage surely.
#75
General Discussion / Re: New voice microphone
Mon 17/11/2014 13:09:11
Pretty much any USB condenser mic will be fine. The Blue range mentioned are great for the price but if you want cheaper then the Behringer or Samson USB ranges are also fine.

Good voice recordings rely on basically 3 things:

Good talent,
Low noise floor,
Low reflection environment.

The microphone is a distant 4th on that list.

Don't get an Omni mic. You will never get good results from it because it'll pick up too many reflections and it will be hard to isolate any noise leaking from the environment. Get a good cardiod mic like the Blue Yeti or one of the others I mentioned.

If you find that your recordings sound a bit "baggy" and dont sound clear then you have 2 options.

1) Stand closer to the microphone. The closer you are to the mic the clearer the recording because your voice is much more present compared to reflections off the wall and so forth.
2) Isolate the actor. The best and cheapest way to do this is to do the recording in a room with lots of absorbant material. So big curtains, sofas and so on. It's also good to hang a duvet or something *behind* the speaker to catch the most problematic reflections off the wall facing the microphone. The human voice doesnt go very low so catching vocal reflections is really easy compared to instruments.
#76
Sorry for the bump.

I wrote an improved algorithm for this in AGS. It's in AGS-Lua so it might not be of use to you but i thought i'd post it anyway.

source: https://dl.dropboxusercontent.com/u/27247158/pixelformer2src.zip
compiled: https://dl.dropboxusercontent.com/u/27247158/platformer.zip
#77
very quick observation that I dont know is the cause but your conditionals are wrong.

Take this line:

Code: ags

while (xprog < mPlayer.velx || done == false)


That should be a boolean AND not OR.

If you set done to true and xprog is still less than mPlayer.velx then the statement still evaluates as true so setting done to true does nothing.

If that's just a performance optimisation then it wont matter but I thought I'd mention it since I noticed it immediately.

#78
Ideally, the compiler itself would be a separate assembly, a library.

Then a compiler exe could simply reference this library and provide a terminal front end for it and the editor can reference it and provide an in-editor front end.
#79
The class you need is UITypeEditor

then you need to decorate the property with the Editor attribute

I believe the sprite picker in the property grid is implemented this way.

Code: c#

class Foo
{
    [Editor(typeof(FancyStringEditor), typeof(UITypeEditor))]
    public string Bar { get; set; }
}
class FancyStringEditor : UITypeEditor
{
    public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
    {
        return UITypeEditorEditStyle.Modal;
    }
    public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
    {
        var svc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
        if (svc != null)
        {
            using (var frm = new Form { Text = "Your editor here"})
            using (var txt = new TextBox {  Text = (string)value, Dock = DockStyle.Fill, Multiline = true })
            using (var ok = new Button { Text = "OK", Dock = DockStyle.Bottom })
            {
                frm.Controls.Add(txt);
                frm.Controls.Add(ok);
                frm.AcceptButton = ok;
                ok.DialogResult = DialogResult.OK;
                if (svc.ShowDialog(frm) == DialogResult.OK)
                {
                    value = txt.Text;
                }
            }
        }
        return value;
    }
}
#80
I've been going through replacing all the C++ stuff with managed code for a couple of weeks now.

The biggest duplication seems to be clib access. Things like getting and rendering fonts is especially problematic.
SMF spam blocked by CleanTalk