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

#1
I have 3 mini games that are run from my main game using RunAGSGame(mgX.exe, 0, 0), all three run fine when run in the editor or from the compiled exe but when I run two of them with RunAGSGame I get errors. All the games are created in the same version of AGS (the latest one from the ags home page) with the same resolution and colour depth.
For mg2 one of the buttons on the HUD gui seems to have it's normal graphic set to the wrong sprite every cycle.
For mg3 it crashes with an undefined import for the name of one of the buttons on the HUD gui but if I comment out the line that sets the graphics for that button then it complains about an undefined import for 'player'. But if I set the main game not to exit completely then it crashes when it tries to play a sound embedded in the mini games exe file.

Any ideas on how to figure out what the problem is?

Edit: Nevermind I decided to combine the mini games into the main project.
#2
Is it possible to produce an *.ags file of a game in AGS3?
If not is it possible to strip the engine from the compiled game exe?

I have 3 mini games in my project and which means I have 4 copies of the ags engine that I don't need.
#3
I was wondering how the marbles part of Kweepa's Mega Demo was done?

http://www.kweepa.com/step/ags/games/MegaDemo.zip (5Mb)

I'm trying to create a mini game where objects randomly fall from the top of the screen and the player has to move the character to catch the objects.
#4
I'm trying to recreate an effect, it is a consistent ripple/wave distortion so.
I started with the LakeModule as a base and modified it to be a single instance in the room script as I only need it once.
I got the ripple to reverse and stopped the ripple from tapering but it doesn't look right and the warped image doesn't scroll up.
I was hoping that someone who is better at maths and ags scripting could help me match the original warp.

The background image is http://s8.postimage.org/ffcydh879/arena_bg.png (tiles vertically)

And an animation of the resulting effect: http://s8.postimage.org/x44p53jyd/10000.gif


I'm running ags 2.72, arena_bg.png is set as background frame 2, my current code looks like this:
Code: AGS
// room script file

/********************************************
* Background                                *
********************************************/

int displayFrame = 1;
int bufferFrame = 2;

int bg_y = 8;
int bg_h = 255; // should be 208
int buf_y = 255;

float bg_speed = 1.0;

float bg_yRipplePhaseScale = 1.0;
float bg_yRippleSize = 0.0;
float bg_yRippleDensity = 3.0;

float bg_xRipplePhaseScale = 1.0;
float bg_xRippleDensity = 0.5;
float bg_xRippleSize = 5.0;

float bg_yPhase = 2.0;
float bg_xPhase = 2.0;

function bg_warp()
{
  float phaseScalar = Maths.Pi/IntToFloat(GetGameSpeed());
  
  bg_yPhase += bg_speed * bg_yRipplePhaseScale * phaseScalar;
  while (bg_yPhase > 2.0 * Maths.Pi) bg_yPhase -= 2.0 * Maths.Pi;
  
  bg_xPhase += bg_speed * bg_xRipplePhaseScale * phaseScalar;
  while (bg_xPhase > 2.0 * Maths.Pi) bg_xPhase -= 2.0 * Maths.Pi;

  float fh = IntToFloat(bg_h);
  
  int i = 0;
  while (i < bg_h)
  {
    float fi = IntToFloat(i);
    float yAngle = (bg_yRippleDensity * (fh - fi)) + bg_yPhase;
    float yoff = bg_yRippleSize * (28.0 / 14.0) * (1.0 + Maths.Sin(yAngle));
    int yoffi = FloatToInt(yoff);
    int yi = i - yoffi;
    if (yi >= 0)
    {
      float xAngle = (bg_xRippleDensity * (fh - fi) ) + bg_xPhase;
      float xoff = bg_xRippleSize * (28.0 / 14.0) * (1.0 + Maths.Sin(xAngle));
      int xoffi = FloatToInt(xoff);

      //an attempt to get the image to scroll
      //if (buf_y - i <= 1) buf_y = 255;
      DynamicSprite *s = DynamicSprite.CreateFromBackground(bufferFrame, xoffi, buf_y - yi, 320 - xoffi, 1);
      RawDrawImageResized(0 + xoffi/2, bg_y + bg_h - i, s.Graphic, 320 - xoffi/2, 1);
      s.Delete();
    }
    i++;
  }
  //an attempt to get the image to scroll
  //buf_y = buf_y - bg_h;
}

#sectionstart room_a  // DO NOT EDIT OR REMOVE THIS LINE
function room_a()
{
  // script for Room: Player enters room (before fadein)
  SetViewport(0, 0);
  SetBackgroundFrame(displayFrame);
}
#sectionend room_a  // DO NOT EDIT OR REMOVE THIS LINE

function repeatedly_execute_always()
{
  bg_warp();
}
#5
I have a mini game in one of my rooms which when started saves in slot 7 and runs mg3.ags, that works fine.
When I exit mg3.ags it starts the main exe and the main game before the title screen checks for a save game in slot 7 if it exists then it loads it.
But when it tries to load the save game in slot 7 ags crashes and gives me this error:
Error: Restore_Game: Game has changed (inv), unable to restore position

What does this error mean?
I'm running AGS 2.72
#6
I finally got ags 3.2.1 working on linux with wine so I tried upgrading my project from 2.72 to 3.2.1 but I ran into a problem.
When my flc animations try to play I get, "Error: Mismatched colour depths"
My game is 16bit colour and the flc are 256 but afaik that's the limit for the format.
How can I fix this?
#7
I created my own custom gui for saving/loading but when I restore a saved game the save/load gui is still visible.
How can I get it to save but not hide the gui, but when I load the saved game have the gui not visible?

I'm currently saving with:
Code: AGS
function SaveGame(int slot)
{
  String slot_name;
  slot_name = slot_name.Append(RoomName);
  slot_name = slot_name.Append(", ");
  slot_name = slot_name.Append(Progress);
  
  gSaveload.Visible = false;
  gLabel.Visible = false;
  mouse.Mode = old_mouse_mode;
  SaveGameSlot(slot, slot_name);
  if(slot == 1) sl_slot1_label.Text = slot_name;
  if(slot == 2) sl_slot2_label.Text = slot_name;
  if(slot == 3) sl_slot3_label.Text = slot_name;
  if(slot == 4) sl_slot4_label.Text = slot_name;
  if(slot == 5) sl_slot5_label.Text = slot_name;
  if(slot == 6) sl_slot6_label.Text = slot_name;
  gSaveload.Visible = true;
  old_mouse_mode = mouse.Mode;
  mouse.Mode = eModePointer;
}


And loading with:
Code: AGS
function LoadGame(int slot)
{
  RestoreGameSlot(slot);
  gLabel.Visible = false;
  gSaveload.Visible = false;
}
#8
Is it possible for the mouse cursor to go under an object?
I have labels that are visible when the mouse hovers over an exit but at the moment if the cursor goes over the label object when it is visible then the label disappears.
I would like to have the cursor go underneath the label.
#9
This maybe a very stupid question but is there any reason why I can't use separate rooms for my Inventory and Save/Load menus?
As I can see how I can make them the way I want as rooms with objects and hotspots but not as GUI.
#10
I want to make it so the title screen for my game either shows just 'new game' or if there is a save game to show 'new game' and 'continue'.
Is this possible?

I found a few ways to do this on google and in the manual but they all seem to be tied to listboxes.
Like here: http://www.adventuregamestudio.co.uk/wiki/?title=Creating_Custom_Save_and_Load_Dialogs
#11
I wanted to tint my animated cursors when they are over objects or hotspots that the current cursor can be used on. So if an object has a response to being looked at then the cursor would be tinted red. Using examples around the forum I ended up with this code in the global script under repeatedly execute:

Code: ags

	if (GetLocationType(mouse.x,mouse.y)==eLocationHotspot) {
		Hotspot* h = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
				if (mouse.Mode==eModeTalk) {
					if (h.GetProperty("TALK_A")) {
						mouse.ChangeModeView(eModeTalk, CUR_TALK_A);
						}
					else mouse.ChangeModeView(eModeTalk, CUR_TALK);
					}
				if (mouse.Mode==eModeGrab) {
				  if (h.GetProperty("GRAB_A")) {
				    mouse.ChangeModeView(eModeGrab, CUR_GRAB_A);
						}
				  else mouse.ChangeModeView(eModeGrab, CUR_GRAB);
					}
				if (mouse.Mode==eModeLook) {
				  if (h.GetProperty("LOOK_A")) {
				    mouse.ChangeModeView(eModeLook, CUR_LOOK_A);
						}
				  else mouse.ChangeModeView(eModeLook, CUR_LOOK);
				  }
		}
	if (GetLocationType(mouse.x,mouse.y)==eLocationObject) {
		Object* o = Object.GetAtScreenXY(mouse.x, mouse.y);
				if (mouse.Mode==eModeTalk) {
					if (o.GetProperty("TALK_A")) {
						mouse.ChangeModeView(eModeTalk, CUR_TALK_A);
						}
					else mouse.ChangeModeView(eModeTalk, CUR_TALK);
					}
				if (mouse.Mode==eModeGrab) {
				  if (o.GetProperty("GRAB_A")) {
				    mouse.ChangeModeView(eModeGrab, CUR_GRAB_A);
						}
				  else mouse.ChangeModeView(eModeGrab, CUR_GRAB);
					}
				if (mouse.Mode==eModeLook) {
				  if (o.GetProperty("LOOK_A")) {
				    mouse.ChangeModeView(eModeLook, CUR_LOOK_A);
						}
				  else mouse.ChangeModeView(eModeLook, CUR_LOOK);
				  }
		}
   if (GetLocationType(mouse.x,mouse.y)==eLocationNothing) {
 				if (mouse.Mode==eModeTalk) mouse.ChangeModeView(eModeTalk, CUR_TALK);
				if (mouse.Mode==eModeGrab) mouse.ChangeModeView(eModeGrab, CUR_GRAB);
				if (mouse.Mode==eModeLook) mouse.ChangeModeView(eModeLook, CUR_LOOK);
			  }
		}

Which on the whole works well but now all the cursors animations are running too fast, what is the reason for this? and how and I slow them down to their original speed?
SMF spam blocked by CleanTalk