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

#341
Hi, I'm trying to write a plugin in C++ for my game, using the ags-plugin-dll-template.

My reason for wanting to write a plugin is that my game has 1600x1200 pixel scrolling backgrounds (16bit color depth, 800x600 resolution) that need to be dynamically drawn, not every game-loop or so, but when the player enters a new room.

Right now I'm using an ags-function that loops through the 1600x1200 pixels and paints bitmaps of different colored stars at random positions on the black background image, using RawDrawImage() and RawDrawImageTransparent(). This function is called when the player enters a new room, and the stars stay in the background once they've been painted on, just like if a premade bitmap with fixed stars was loaded as background pic.

Now I want somethig a little more complicated then just drawing a bunch of semitransparent bitmaps on top of and beside each other, in other words, i need access to a two-dimensional array containing the pixel information (rgb-values) for the background, so that I can manipulate each pixel manually from the .dll I'm writing, adjusting overlapping stars and creating other weird graphics effects, before the final pic is drawn to the background. But once the background is drawn, it needs to stay fixed for scrolling when the player moves.

In the template dll, there's a call to AGSE_POSTSCREENDRAW, but whatever is drawn here is translated as the player moves around the room, and doesn't stay fixed in the background.

How would I be able to draw on the real room background picture? Do I need to call GetRawBitmapSurface(BITMAP *bmp) ?Ã, 
And what does the warning in the PlugIn API about this function only working with the virtual screen, mean? Isn't there a way to get and manipulate the real background picture?

- Fred
#342
Good job, CoolBlue - I've read your tutorial, and Im sure it's gonna be helpful to people making rpgs with ags.

A little c&c: perhaps you could include more illustrations, maybe a shot from the finished game as the player would see it - because rpgs can be so many different things. 

Also, you write that player health is set to 7, when it's actually set to 5 with GiveScore(5); if I'm not mistaken.

That's about it - good job. I like to see people sharing their experience.

Btw. Isn't somebody on the forums making a collection of ags tutorials? Did you contact him/her?
#343
Advanced Technical Forum / Re: Script Gone...
Sun 30/01/2005 09:27:46
Sorry for the delay. I'm no shark at dealing with RAM, the BIOS or CAS latencies.

My computer has been generally unstable for some time, but I thought it natural because I use a lot of open source and not 100 % bug free programs. All crashes I've had, were related to those. (GIMP, VLC Media Player, faulty Photoshop).

I ran chkdsk several times with little result, and did a virus-scan that found nothing. I can't access the BIOS (Windows Help says BIOSÃ,  is now called EFI, and that it's invisible to the user). If the RAM or File System is faulty, would there be any way of fixing it without having to do a complete reinstall of Windows? (Hm... I guess this thread is going off topic).

Thank you guys for helping out, I think the problem can be isolated to my computer, and not AGS. Just weird that my computer functions normally in most situations, and then has these sudden caprices. At least I'm becoming a veteran at making back-ups of everything I work on ;-)
#344
Advanced Technical Forum / Re: Script Gone...
Fri 28/01/2005 12:10:24
Quote from: PumamanAre you writing your game in English, or might there be extended characters in the script? I'm clutching at straws now, but it's possible that attempting to use unicode characters of some sort could cause a problem.
The only characters I'm using that aren't listed in the ASCII-table in the Help-file , are the '+' and '-' characters (keycodes 43 and 45). They work just like they were intended to (catching keypresses from different GUIs).

Btw. I redid the replacement of the 104 DisplayAt()-function calls already mentioned, doing only 5-10 at a time between saving and testing the script, and now the game works fine - only doing them all in one go seemed to cause the corruption.

Quote from:  radiantActually the symptoms of files being cut off half-way through may be caused by a faulty hard drive, or simple logical errors in your file system. Have you run scandisk lately?
I think you might be right about this - I'll try running scandisk as soon as I'm done working.

Quote from: GilbotAlso, faulty RAM can affect this, too. Try to config your BIOS so it doesn't do a "quick" test on the startup RAM test (if not already).
I'm not sure how it's done, but I'll try it also.
#345
Advanced Technical Forum / Re: Script Gone...
Fri 28/01/2005 08:05:04
QuoteOut of interest, did you use the Save And Exit command in the script editor, or did you close the window and select "Yes" from the "Do you want to save" dialog?

I used the Save And Exit command.

Quote...have you seen the problem while editing different games?

I've only seen theÃ,  problem while editing the current game.

Quoteyou could use a #define for those numbers so you don't have to repeat them hundreds of times

I'll try that now, although they only need to be changed once :-)

Guess we'll just have to wait and see if anyone else reports something like it. Also, it's not so important, because the script isn't really deleted if you don't save the corrupted script or game. (Of course I didn't know the first couple of times it happened).

Additional info: I'm running Windows XP (Professional Edition) with a Kerio Personal Firewall installed.
#346
Advanced Technical Forum / Re: Script Gone...
Thu 27/01/2005 14:55:15
It happened again - I had been working on my script, closed and saved it, and when I triedÃ,  to "Test game", I got an error pointing to a certain line, where, as I discovered upon opening the script to edit it,Ã,  the script had been cut off, the last 3000 lines or so having been replaced by a few characters.

I had been going through the whole script, providing new ints for 104 calls to the DisplayAt()-function, using the Ctrl+F (subsequently F3) to find the cases: DisplayAt(135,75,118,"different messages"); and replacing them with DisplayAt(82,55,300,"same different messages"); The changes spanned app. 5000 script lines, and took place in maybe 30 different functions.
Note: I used Ctrl+v to paste the new integers (82,55,300) into the function after having deleted the old ones with <backspace>.

I found that if I closed down ags without saving changes, the script could be restored - so luckily there was no actual loss of code - only the changes weren't made. Still kinda scary to see my script gone like that. Do you think it's because of the "amount" of code changed, or could it be due to using Ctrl+v or Ctrl+f?
#347
Completed Game Announcements / Re: The Cell
Sat 15/01/2005 07:33:51
It seems a bit illogical that the spoon only appears after you have made the mask. What's that got to do with that?

Also, you should change "YOUR FREE" to "YOU'RE FREE" at the end.

Nice first game, though, and really pro-looking intro screen.
#348
Nice animated sequence - I think you could make something interesting if you worked a bit more on the plot.
#349
Advanced Technical Forum / Re: Script Gone...
Tue 11/01/2005 23:32:58
Quote from: PumamanI'm rather concerned by this corruption... but it's very strange that nobody else has seen it.

You shouldn't be too worried - the reason I haven't posted these corruptions is that I haven't been able to make sure they weren't just my own stupid mistakes - so don't be too concerned. If anything like it happens again I'll be sure to take note of everything I was doing and report it.

Quote from: PumamanDo you remember if you switched away from the script editor and did some work in the main AGS Editor while the script editor was still open? If so, any ideas what you might have been doing?

I don't remember if I switched away from the script while it was open, but it is likely. My game doesn't use Inventory Items, Global Messages, Dialogs, Text Parser or Lip sync - but I could've been working in any of the remaining branches of the Editor.

Quote from: PumamanDo you remember whether the compile error was on the line where the script was corrupt, or was it something earlier on in the script and unrelated?

I remember one occasion where the error pointed to the line where the corruption started, but I'm not sure where it pointed the other times.
#350
Advanced Technical Forum / Re: Script Gone...
Tue 11/01/2005 20:53:07
I'm glad to hear long scripts aren't the problem, I was starting to think there may be some limit to script-sizes.
Btw, is there a limit to how many custom global variables you can use in a script? Or to the length of arrays?
I currently have:Ã, 
1 array of 80 ints
1 of 360 ints
3 of 100 ints
2 of 40 ints
They're all made globals with the header-/global script import-export statements.

Quote from: PumamanDoes it seem to be if you add a large chunk of code in one go?

I do believe that the script-corruption happened after I had addedÃ,  at least some code (don't remember how much), and possibly also after I had added new custom arrays of ints to be imported and exported.

Quote from: PumamanDoes it only happen if a compile error occurs?

Yes. Or maybe the compile error occured because a big chunk of the script was missing.
#351
Advanced Technical Forum / Re: Script Gone...
Tue 11/01/2005 01:57:30
I've experienced loss of data from the global script (AGS version 2.62 final) too on several occasions, but never the whole thing. The script is about 6500 lines, and when this has happened, the script seems to have been simply cut at a random position (say, line 4912) - everything after that is gone, and sometimes there have been some strange characters instead. This has only happened when I used the Ctrl+T (Test game) option after exiting and saving the global script where I had just added new content. The game would try to compile, and I would get an error (do you want to fix this..?) and when the script re-opened for me to fix it, a huge chunk would be gone - always at the end of the script.
I haven't reported this earlier as I didn't see any pattern in the data-losses and I figured it had someting to do with me adding so much custom content to the global script (more than 200 custom functions and 720 arrayed custom ints so far). Its probably my own fault - but strange that part of the script is suddenly replaced by nonsense characters. I'll give a more thorough bug report if something similar happens again. But I'm sure limited disk space can be ruled out as a factor.
#352
Hints & Tips / Re: Stuck in Demon Day
Wed 29/12/2004 12:44:36
Desimaui, are you stuck in the basement with the third demon, or at the pier?

If you're in the basement:
Spoiler
You will find the needed clues if you read this thread again.
[close]


If you're at the pier after dealing with the third demon:
Spoiler
The demon's bird-avatarÃ,  should be sitting in the tree in the background. You need to use an inventory item with a hotspot at the pier to conclude the scene and finish the game.
[close]


Still stuck?
#353
Hints & Tips / Re: Stuck in Demon Day
Tue 28/12/2004 08:46:02
Well...Ã, 

Spoiler

The bird in the tree is prone to chase worthless shimmering objects.
[close]
#354
Could it be that the GlobalInts are only updated at the end of a complete game-loop? I think I've encountered a similar problem once, and it was fixed by adding Wait(1); at the end of the function in order to update all globals.

Another thing is that your function doesn't seem to have any exits - maybe you just simplified it in your post, but it would need to check for EGO's or ENEMY's hitpoints going below zero in order to conclude battle.

Can I ask how you switch turns between player and opponent? Is it done from repeatedly_execute() or another custom function with a while loop, say:

while ((character_hps > 0) && (enemy_hps > 0))
{player_attack();}

I'm asking because in a script that hangs like you describe it, you should generally track through all the loop's while-statements. The bug is probably a while-loop without exits somewhere, the probable reason you aren't getting the "15001 iterations without an update"-error is that the repeated animations takes time to execute and you exit with Alt+x before you get the message.
#355

I was thinking of putting some kind of donations button on the download page of my next game. In that way the game would be free, and the very rich or very excited could donate a few bucks to inspire possible sequels. I'm considering this because having to pay (even having to register) for downloadable products is one of my personal turn-offs, I often instinctively forget about it and browse somewhere else. On the other hand I would happily donate something for a great game once I played it, if it raised the probability of future games from the same developers.

Does anyone have experience with this kind of thing or know of any good programs for setting up a donations button? And does anyone know what kinds of (tax) rules apply to donations as compared to buying/selling games?
#356
I just installed windows xp on my computer and found that the ags game I have been puttiing together under windows 2000 no longer works. I can open it in the editor and edit it, but when I test it or run the compiled .exe file, all I get is an empty/black windows-standard-type window. I can hear from the sounds that the game is running, but how come there's no visual? And the game isn't set to run in windowed-mode anyway, so how come it opens in a window?

note: i have been using both ags 2.61 and ags 2.6_sp1 to develop the game under windows 2000, and that didn't give me any compatibility problems there. Does win XP handle this differently?

I hope someone else has had this kind of problem or will be able to help me in some way, as I'm really depressed to see hundreds of hours of work compiling to a black screen :-\

fred

-------------------------------

Note: I SOLVED the problem: updating my display drivers and reinstalling directx. Now I can edit, compile and play my ags-game(s) again.  :)

fred
------------------------
#357
Hints & Tips / Re: Stuck in Demon Day
Mon 02/08/2004 16:39:18
Hey JG0630

It isn't possible to summon the third demon before you get the bird. I made it so in order to prevent people from getting stuck in the basement. This aplpies to the game as such: You can't do anything that kills the main character or otherwise requires you to go back and restore a saved game. The only way to get stuck is by becoming temporarily unable to figure out what to do next. But then again - trying just about anything won't hurt. I hope you figured out by now that the bird was cleverly tucked away - in your inventory.  ;D

fred
#358
To nope!: Demon Day isn't a MAGS game, but maybe I'll join the competition in May now that I've had a little experience making the first game.
fred.
#359
Demon Day

Waking from a weird dream, our hero finds himself taking part in a strange chain of events, involving demons, a walk in the park, and lots of bad behaviour.

Medium-length game (640x400, 16-bits)

Download the game (2,7 MB):

https://creativesparkstudios.com/demonday/

(http://www.id.cbs.dk/~jmc/freden ) obsolete

SMF spam blocked by CleanTalk