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

#1
Great to read you like the game.
Latest version doesn't save the screens to disk during play anymore. So now save/restore works as it should.
But if you use the meatball to draw pretty pictures like EdLoen there, you can still save all the visited screens by pressing the Enter key.

Dialogues and some more sprites are still waiting for my attention.
#2
Thanks to KhrisMUC and a day of learning on Complie errors, now I understand what struct is. To me that was a giant step.

The code works fine ... but now, when/where do I delete all those dynamic sprites (as help file strongly suggests)? Or is it just ok, as it is?

And again: is this more efficient than saving to disk?

Code: ags

// main global script file


int start = 0, i, room_curr, room_nr = 0, off_curr_x = 0, off_curr_y = 0;

struct background
{
   int off_x;
   int off_y;
   DynamicSprite* screen_bg;
};

background room[512];


function on_event(EventType event, int data)
{
   if (event == eEventEnterRoomBeforeFadein)
   {
      if (start == 0)
      {
         start = 1;
         room_curr = 0;
      }
      else
      {
         if (from == 1) off_curr_y = off_curr_y + 1; // from top
         else if (from == 2) off_curr_x = off_curr_x - 1; // from right
         else if (from == 3) off_curr_y = off_curr_y - 1; // from bottom
         else if (from == 4) off_curr_x = off_curr_x + 1; // from left
         
         room_curr = -1;
         i = 0;
         while (i < 512)
         {
            if ((room[i].off_x == off_curr_x) && (room[i].off_y == off_curr_y))
            {
               room_curr = i;
               i = 512;
            }
            i++;
         }
         
         if (room_curr == -1)
         {
            room_nr = room_nr + 1;
            room_curr = room_nr;
         }
         
         room[room_curr].off_y = off_curr_y;
         room[room_curr].off_x = off_curr_x;
         
         if (room[room_curr].screen_bg != null) {
            RawDrawImage(0, 0, room[room_curr].screen_bg.Graphic);
         }
      }
   }
}

function save()
{
   room[room_curr].screen_bg = DynamicSprite.CreateFromBackground();
}


function repeatedly_execute()
   {
      
         if (player.x < 1) // left
         {
            save();
            from = 2;
            player.ChangeRoom(1, 315, player.y);
         }
         
        // ... and so on ...
        // ...
        // ...
      
   }
#3
Thanks!
It is still work in progress, so anything could happen. Maybe a nasty-homebound-fork-from-above?
#4
ok, that variant with array of short-s would work ok, I guess.
So, how can I define a name for array, when I need it?
The game has only one room, and the "name" property changes each time you enter. So if I stay in a room I only need one array (actually none, if I don't leave), but if I go in straight line through a lot of screens, then I need a new array each time. Currently there is only a problem with 255 char limit for file names. So one can only go 255 rooms from room 0 in each direction (65.025 posible rooms (64k)). But with arrays, should I define 128k (x,y) of arrays manualy?
(and there are two different tracks in each "room" so that would be 256k of arrays).

So, can I do somethnig like this:
short *room_name*_x[10000], *room_name*_y[10000];

About performance when raw drawing the sprites after a room loads:
Now I only read one .pcx and raw-draw it. With array I could end up with raw-drawing 10000(àâ€"2) sprites onBeforeFadein. This sounds much more memory and time consuming. Or am I wrong?

KhrisMUC suggested something more like:
struct position{short x[10000]; short y[10000]; short sprite_number[2]; String room_name[65025];};
But I am not familiar with struct-s. How do I read it right? How do I get only the data for the current "room"?
I guess I loop through room_name and if fits current room then read other values from x, y, and sprite_number, then rawdraw, then loop room_name again, starting on latest index and so on .... a lot of looping every time I enter a room.

Ok, now I know some more ways to do what I want, but the question remains: What is the most optimal solution?
#5
That was suggested in the game thread by KhrisMUC.
Traces are drawn by raw-drawing a 16àâ€"13px sprite.
Game is 32bit so it can use alpha.

How many ints can array hold?
If I roll around in one room forever, that could again mean an array of infinite size.
And is there a problem raw-drawing some thousand (or more) sprites before fade-in?
#6
General Discussion / Re: Banner in signature
Sun 07/10/2007 10:44:32
I allways see it, too.
#7
I did this one room game, where you roll a ball around. When you exit the room at top, you apear at bootom, same for left - right.
The thing is: the ball leaves a trace as you roll. So, when "changing rooms" the trace should be as it was in that "room" when you left.

Now it is done by saving background to dynamic sprite, then .pcx to disk, then delete dynamic sprite - before you change room. Before fadein the apropriate background is loaded from disk if exists, else it is default empty screen.
Screens are named by relative coordinates to room 0. (NNN.pcx - 3 times north; NNEEE - 2 north, 3 east; SW - south and west ... and so on)

Is it wise to just keep screens as dynamic sprites? I can't really predict how much of them will player create with his/hers path. If you keep close to room 0, then they are rewriten eact time you visit, but if you go in straight line, there is allways a new one.

How much dynamic sprites of 320àâ€"240 can I create before I get in trouble?

And I am not sure how to asign variable names to dynamic sprites, since I don't get the room name until I visit. In theory, there can be infinite number of rooms.

So what wil crash first - disc or memory?

The game thread with download is here.
#8
Yes I know that.
My first option is disable save / restore.

But I am just posting in technical forum for best solution.
#9
For all of you who allready played my game - The latest version has an option to talk and an ending.
"Dialogues" might still need some work.
#10
I thought of just keeping screens as dynamic sprites, but with some 120kB each (thats .pcx size), isn't that  just a waste of memory? I really only need one at the time.  So whole lot od full-screens in memory didn't sound right.

Keeping only coordinates didn't ocure to me (If I understand correctly). That way I only need an array (or two) of coordinates for each "room". Or is there an even better solution?

BTW - I am no programer, some ags and vbscript is all I know, and I have no idea how memory and other low level stuff works.
#11
It has a blank screen with text displayed at the begining, but it is a one (or infinite) room game.

Just put up a new version. Now the meatball track stays on the "other" screens.

This is done by saving .pcx files of background, so delete the .pcx files or run CLEAN _SCREENS.BAT after play, or even better: run the game with MEATBALL.BAT, which should do that for you.

I didn't find any better solution to this.
#12
Quote from: Babar on Fri 05/10/2007 16:56:28Is there an end to the game?
Spoiler
Not yet. Maybe I should add one random meatball that doesnt run away.
[close]

Quote from: Babar on Fri 05/10/2007 16:56:28Also, I encountered a bug:
Global script line 179
NewRoom: Cannot run this command, since there is a NewRoom command already queued to run.
Aha, found the problem. It happend when you exit the room at a corner. Fixed that.
I had four if-s one after another, but it should be: if, else if, else if ...
New version is up.
#13
AGS Games in Production / No Love for Meatball
Fri 05/10/2007 16:34:07
I made this and I called it "No Love for Meatball".
So here it is for you to enjoy.

Story: Catastrophe, end of the world and such ... now, can you find love?
The in-depth pre-story is in the game itself.



No_Love_for_Meatball.rar

Mouse is useless in this game.
Use arrow keys to move and "T" to talk. You can only talk if there is another meatball in the room.
F5, F7, F9, F12 and Ctrl+Q work as usual, and that is about it.

Use Enter to save all the visited screens to disk.

Ending is there, you will know when you reach it.

I might still work on "dialogues", so it is not completely finished yet.
#14
To me it was the Interaction Editor that got me started with AGS. I was looking for simple game creation tool for a long time. AGS's Interaction Editor made it possible to me to make a silly 8-room game with no scripting at all at the time. But with looking at Text script equivalent code all the time I slowly went from IE to scripting.
AGS is a powerfull tool, and scripting is the only way to use it at full, but IE is a very easy first step. (And it makes a game creation process a point-and-click adventure at it's own.)

Now I would't miss IE a bit, but any new user with no scripting experience would.

I say: keep the Interaction Editor.
#15
I saw this today in the completed games and I went to playing right away.
I just finished the game and I am really impressed.
I love the artwork, puzzles are interesting, funny, just hard enough (I really don't like to get stuck), deciphering was a nice change, lots of witty dialogue, references to stuff, well everything is just perfect. At first I noticed the sharp edges of characters, but it didn't bother too much.
And I didn't know there was music (I had the midi volume to zero for some unknown reason), until I read the forum again. So I'm giving it another go, this time with music on.

P.S.
It took me little more than 2 hours, but than again, I could never get the jukebox in demo to play.

Great game!
#16
That was fast!

ThanksÃ,  SSH and Gilbot.

I used Gilbot's solution and it works.
#17
Hi.

In script for *Look at hotspot* I need to get a random variable from a string array.

Now I declare the array and set all the values each time Look at action takes place, and it works fine, but is there a way to declare the array only once, not every time I click on a hotspot?

In *Look at hotspot* script I only want:

int ran = Random[59];
Display("%s", my_array[ran]);

but ...

String my_array[60];
my_array[0] = "value 1";
my_array[1] = "value 1";
my_array[2] = "value 1";
...

... I want to put somewhere else, just to be declared once and then left alone.

I tried *global script / game_start*, but I can't import a string array (manual also says: You cannot currently import string variables.) I can't use Game.GlobalStrings, because it only provides 50 variables, and I need them elsewhere. And I only need this array in one room.

I tried *First time player enters room* and *Player enters room (before fadein)*, but I get an error "undefined symbol my_array".

So, is there a way to declare the array anywhere else than in *Look a hotspot*?

Thanks
#18
Hi, there.
This is my first post in this forum, since now the help file and forum search did the trick ...

Is there a way to display a variable, lets say Game.GlobalStrings[0]  as part of a dialog topic name?

For example, option name to be:
- Have you seen my *Game.GlobalStrings[0]*?

I can do it in a dialog using run-script command, but can't find a way to do it as a option name.

Thanks
SMF spam blocked by CleanTalk