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

Topics - TMuh

#1
AGS Games in Production / Microworld
Sun 09/02/2014 17:25:42
Hi all,

Im making this rogue-like 2d action game "Microworld". It started as "Microcombat", similar game with guns and more platforming based, but then I got the idea to make it more fantasy-themed with rogue-like elements and leveling up system.

The idea of the game is to travel in this semi-randomized 2d world and trying to stay alive while the world gets harder and harder by time. You do that by leveling up, gaining better equipments and skills.

Its in quite an early stage right now, but I think posting this and making it public encourages me to actually finish it some day :9



Ps. Technically this is not a risk of rain copy! I had the idea before hearding of that game.



#2
Hi,

Im using Character.GetAtScreenXY for detecting if there is an enemy at the location of players sword. It works fine, but the problem is when there is multiple characters at the same location. So is there way of identifying all overlapping characters in some x,y position?
#3
Hi,

Is there a way to change drawingsurface drawing color brightness? All i found was Game.GetColorFromRBG.

If there isnt, id suggest to add it. I assume it would be quite easy, because brightness value is already there in game's color finder.


Edit: Also a little side question: Is there limit how many characters can be in game/in one room?
#4
Hi,

Id like to return multiple values from function by using dynamic array. I have this simple function:
Code: AGS
function GetLocation (int sx, int sy,  int tdir, int tdis) {
int r_xy[] = new int[2]; //(instruction i linked above suggested "int r_xy[] = new array[2];" here but it reported error for me)
int tdir2;
if (tdir == 90) {r_xy[0] = 0; r_xy[1] = sy-tdis; return r_xy;}
}


But Im getting this error: Math.asc(85): Error (line 85): Type mismatch: cannot convert 'int[]' to 'int'
So what Im doing wrong?
And is there any other ways to return multiple values? (except global variables)
#5
Ok, I edited this useless topic to ask another question. How I can change the script editor's background color? In my mom's laptop I changed it to black long time ago but now i cant remember how it was done.
#6
Hey,

im doing game with a lot of 1 pixel sized bullets moving around screen at the same time (from 100 to 1000, depends what is possible). So is there ways to do it? I was thinking of drawingsurface but would it be too slow?
#7
Ok, I have another problem when im trying to save tiledata to a file.

Code: AGS
if (keycode == eKeyF5) {
File *output = File.Open("tiles.dat",eFileWrite);
if (output == null) Display("Error opening file.");
else {
  int tx = 0; int ty = 0;
  while (ty < 15) {
    while (tx < 20) {
      output.WriteInt(tiles[ty].x[tx]);
      tx++;
    }
  ty++;
  }
output.Close();
}
}


if (keycode == eKeyF6) {
File *input = File.Open("tiles.dat",eFileRead);
if (input == null) Display("Error opening file.");
else {
  int tx = 0; int ty = 0;
  while (ty < 15) {
    while (tx < 20) {
      tiles[ty].x[tx] = input.ReadInt();
      tx++;
    }
  ty++;
  }
input.Close();
}
}



It should work that pressing f5 saves tiles[].x[] to tiles.dat and f6 loads the stored data back to tiles[].x[]. But from some reason when I load the stored data, only first row of the data is returned (that means tiles[0].x[from 0 to 20]). Values in tiles[1].x[], tiles[2].x[]... are 0. Code is short and simple so the problem should be easy to fiqure out but i just dont see it.

tiles[].x[] is like this:

Code: AGS
struct TileDataSt {
int x[20];  
};

TileDataSt tiles[15];
#8
Im doing level editor for my tilebased game. Level is drawn to the background and then exported as a bmp file. The problem is that one command in the editor is supposed to fill entire background with the selected tile graphic. Drawing works fine but the background doesnt update. I can update background by using wait command between code but id like to know if there is more proper way to do it. And id like to understand how drawingsurface works and why it doesnt update background rightaway.

Without wait command background updates only if I for example move character on the screen and the area where character moves is updated.

if (keycode == eKeyCtrlF) {
ViewFrame *frame = Game.GetViewFrame(CURSORVIEW,  0, 0);
DrawingSurface *mainBackground = Room.GetDrawingSurfaceForBackground(0);
int tx = 0; int ty = 0;
while (ty < 480) {
  while (tx < 640) {   
    mainBackground.DrawImage(tx, ty, frame.Graphic);
    //Wait(1); IT WORKS IF I USE WAIT COMMAND HERE BUT IT SLOWS THE EDITOR
    tx = tx + 32;
  }
  tx = 0;
  ty = ty + 32;
}
mainBackground.Release();
}
#9
Hi. Im trying to manually call a button click function by pressing the enter key, but for some reason i dont get it working.

Also Id like to know what "GUI Control *control" parameter exactly does and what I should write at that section.

Im quite tired now so I hope Im not just missing something stupid, but I couldnt find clear answer from search or manual.


I have this in "on_key_press" function:
Code: AGS
if (keycode == eKeyReturn && gDevelop.Visible == true && TxtBoxDevelop.Enabled == true) BtnDevelopOK_OnClick(BtnDevelopOK, eMouseLeft);


And this function somewhere above it:
Code: AGS
function BtnDevelopOK_OnClick(GUIControl *control, MouseButton button)
{
...Some code...
}


I have tried this with and without putting the "OnClick" function to import and export (Do I need to?). And tried also without "gDevelop.Visible == true && TxtBoxDevelop.Enabled == true" inside if section, but none of those didnt work.
SMF spam blocked by CleanTalk