Hi all
I have been playing AGS games for a couple of years (and loving them!) and decided that its time I contributed myself. I have been working for a while on a first test game- essentially a minor game just to teach myself how constructing AGS games work before moving on to a proper contribution. I have hit two major snags- neither of which I have been able to resolve through the tutorials. I must confess that I am not a programmer and so there may well be a few concepts basic to the rest of you that I am failing to comprehend.
The issues are two fold:
1). I have been working on the initial room. Room 1 as per the default first room. I have not attempted a second room yet. I have built a character and got her walking around the room via the run option to test this and was all working okay. Now for no apparent reason when I try to test run it an error message is produced informing me that "room 1 is the start point but it does not exist yet" or words to that effect. I don't know what I've screwed up, but room 1 does still exist, I am still working on it and it still shows in the menus and tabs as room 1. Spent the last 4 evenings trying to figure out what Ive done wrong and how to fix it.
2). I am building my characters in MS Paint and uploading them. This has been working well except that there are random white spots (like a creepy aura of some sort) surrounding the characters as they move. Its really messy and kinda spoils the effect. I've tried recreating all the characters from scratch and re uploading them many times, but for some reason it just isnt correcting the problem. But what I have noticed is that each time I copy and paste the same image to another file and upload that, the spotty effects (although still there) have changed position everytime.
I have prepared screen shots to demonstrate what I mean but seem unable to paste them here
I realise these are total basic questions for you guys, but I have not been able to find solutions. Any help would be appreciated
Pharlap
1. I'm not sure how that will happen. Maybe you have the player character changed to start in a different room that doesn't exist yet. Make sure that the player character starts in Room 1 and that the file room1.crm exists in your game's folder.
2. You probably saved the images as JPEG files. NEVER, under ANY circumstances should you use JPEG as the picture format for your working images. JPEG files use lossy compression, that will introduce random spots of different colours to your images. Use PNG (or even BMP) instead.
1. Could you post the EXACT error? It will probably help diagnose the problem.
2. When you say "uploading", I presume you mean "importing" - the AGS term for getting graphics into your game.
In addition to what Iceboty said about using PNG vs JPEG, you've also mentioned you're using MS Paint. Paint does have tools that utilize partial transparency, but there is no way to set the background color as transparent. This means that if you use a tool such as the brush in MS Paint then you will always get the "aura" effect as well.
If you need to use an alpha channel, then check out programs such as the GIMP or Paint.NET that support transparent backgrounds, and save the images as PNG, and make sure your game is set to 32-bit color depth (under the Game Settings pane), and make sure to use the appropriate settings when importing the sprites (transparency should probably be "Leave as-is" or "No transparency" but making sure you use the alpha channel when prompted).
If you don't need to use an alpha channel, avoid tools such as the brush like the plague - use the pencil tool instead.
Also, I recommend Densming's video tutorials (http://www.youtube.com/densming#p/c/21DB402CB4DAEAEF/0/1Ml_DR76Cl4). Slightly outdated but very useful for beginners.
To show a picture here, you can't simply paste one; the image file needs to be upload to the internet first, more specifically an image hoster (e.g. imgur.com).
After you've uploaded the picture (also ideally as PNG), imgur will show you a bbcode link that looks like this: [img]url_to_picture[/img]. Paste that into your post.
Hey thanks everyone! Your help has been most excellent.
As for the not recognising the existence of room 1 error, I ended up deleting the whole game and starting from scratch.
Also I when it comes to making my actual contribution I will use a medium other than MS paint to construct my sprites as that appears to be the root of the problem there. For the test version I will continue with it as I have built all sprites in this format and the test is really just to teach myself how MS paint works before creating a proper game.
I am having a couple of issues presently which I have failed to overcome, perhaps due to my interpretations of the manuals and tutorials. In particular this infernal "Parse" error. From what I can interpret from my readings on the subject it appears to be some sort of conflict or inconsistency between rooms scripting and global scripting, but I have not yet been able to unravel it. Essentially the error occurs when I try to create a situation of picking up an object.
I have also had difficulty (which I believe to be rooted in room scripting) around the placement of the character entering a new room. I have built several rooms in my test game and I can get characters to move from room to room by crossing edges. But they always appear in the top left hand corners. I have gone through all of the rooms scripting etc (admittedly I am still learning the scripting) and options (but cant seem to find a means of controlling the point at which the player enters the new room.
Any assistance would be appreciated
Cheers all. Sorry if this is an overly basic question
First the character placement issue:
The command is Character.ChangeRoom(int room_number, optional int x, optional int y) (http://www.adventuregamestudio.co.uk/manual/Character.ChangeRoom.htm).
If you call this with just the room number as parameter, the character retains their position. If you add the x and y parameters, you can specify the new position:
player.ChangeRoom(2, 10, 100); // go to coords x=10, y=100 in room 2
Your character always ending up in the top left corner means you always put small numbers as the second and third parameter.
The Parse error appears whenever you use faulty Syntax. The most common reason is typos and putting commands outside of functions. In scripts, everything except variable (, struct, enum) declarations must be inside a function's block, between { and }.
// this will generate a parse error
player.ChangeRoom(2);
function room_LeaveRight()
{
player.ChangeRoom(2); // this will compile fine
}
The reason is that AGS wouldn't know when to actually call the command. But putting it inside a function that's linked to an event, AGS will execute the commands inside the function when the event is triggered.