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

#21
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.
#22
Thank you, that's much cleaner than my attempt.
#23
Thank you that helped I am planning for 6 save slots so I ended up with this code:
Code: AGS
  bool Continue = false;
  if(Game.GetSaveSlotDescription(1) != null) { Continue = true; }
  if(Game.GetSaveSlotDescription(2) != null) { Continue = true; }
  if(Game.GetSaveSlotDescription(3) != null) { Continue = true; }
  if(Game.GetSaveSlotDescription(4) != null) { Continue = true; }
  if(Game.GetSaveSlotDescription(5) != null) { Continue = true; }
  if(Game.GetSaveSlotDescription(6) != null) { Continue = true; }
  if(Continue == false)
  {
    SetBackgroundFrame(1);
    object[0].SetView(5);
    object[0].Animate(1, 3, eRepeat, eNoBlock, eForwards);
    object[0].Visible = true;
	}
  if(Continue == true)
  {
    SetBackgroundFrame(2);
    object[1].SetView(5);
    object[1].Animate(1, 3, eRepeat, eNoBlock, eForwards);
    object[2].SetView(5);
    object[2].Animate(1, 3, eRepeat, eNoBlock, eForwards);
    object[1].Visible = true;
	}	
#24
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
#25
How can I modify that code so that if the cursor is anything but those three modes the whole thing is ignored? as I'm getting the same crashes for the use inventory cursor and some other crashes at random times complaining of the same thing, that it can't find that property.
#26
Thank you it works perfectly now.
I try to follow that scheme of indentation but after a few I start getting lost  :)

And Mazoliin you were right I didn't need those extra brackets, thanks.
#27
Ah right sorry about that as I said before I'm not very experienced with coding. Although I can't test if it works as it comes up with:
Undefined symbol m in line 37 (which is below)
Code: ags

    if (m.Length == 2) v = CUR_WALK;


I don't understand what m is meant to be so I'm not sure how to go about fixing it.

As for the brackets they seemed sensible at the time I put them in I'll test if they are needed. (I think I went through a phrase of when in doubt enclose in brackets  ???)
#28
I wasn't sure where that code should go so I may have stuck it in the wrong place, but I still get the crash.
My global script
Code: ags

// main global script file
bool pressingTAB;
int old_mouse_view;

#sectionstart game_start  // DO NOT EDIT OR REMOVE THIS LINE
function game_start() // called when the game starts, before the first room is loaded
  {
  }
#sectionend game_start  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() 
{
  {
  if (IsKeyPressed(9)) {
  if (pressingTAB == false) {
    if (gInventory.Visible == false) gInventory.Visible = true;
    else if (gInventory.Visible == true) gInventory.Visible = false;
  }
  pressingTAB = true;
	}
	else pressingTAB = false;
	}
{
  bool _A;
  String mm = "";
  int v;
  if (mouse.Mode == eModeTalk) { mm = "TALK"; v = CUR_TALK; }
  if (mouse.Mode == eModeGrab) { mm = "GRAB"; v = CUR_GRAB; }
  if (mouse.Mode == eModeLook) { mm = "LOOK"; v = CUR_LOOK; }
  mm = mm.Append("_A");

  int lt = GetLocationType(mouse.x,mouse.y);
  if (lt == eLocationHotspot) {
    Hotspot*h = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
    _A = h.GetProperty(mm);
  }
  else if (lt == eLocationObject) {
    Object*o = Object.GetAtScreenXY(mouse.x, mouse.y);
    _A = o.GetProperty(mm);
  }
	if (lt == eLocationHotspot) {
    Hotspot*h = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
    if (mm.Length == 2) v = CUR_WALK;
    else _A = h.GetProperty(mm);
  }  
  if (_A) v++;  // assuming that the tinted view's number is standard view + 1

  if (v != old_mouse_view) {   // only change if necessary
    mouse.ChangeModeView(mouse.Mode, v);
    old_mouse_view = v;
		}
	}
}
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart on_key_press  // DO NOT EDIT OR REMOVE THIS LINE
function on_key_press(int keycode) // called when a key is pressed. keycode holds the key's ASCII code
  {
  if (IsGamePaused()==1) keycode=0; // game paused, so don't react to keypresses
  if (keycode==17) QuitGame(1); // Ctrl-Q
  if (keycode==363) SaveGameDialog(); // F5
  if (keycode==365) RestoreGameDialog(); // F7
  if (keycode==367) RestartGame(); // F9
  if (keycode==434) SaveScreenShot("scrnshot.pcx");  // F12
  if (keycode==19) Debug(0,0); // Ctrl-S, give all inventory
  if (keycode==22) Debug(1,0); // Ctrl-V, version
  if (keycode==1) Debug(2,0); // Ctrl-A, show walkable areas
  if (keycode==24) Debug(3,0); // Ctrl-X, teleport to room
  }
#sectionend on_key_press  // DO NOT EDIT OR REMOVE THIS LINE
 

#sectionstart on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE
function on_mouse_click(MouseButton button) // called when a mouse button is clicked. button is either LEFT or RIGHT
  {
  if (IsGamePaused() == 1) // Game is paused, so do nothing (ie. don't allow mouse click)
    {
    }
  else if (button == eMouseLeft) 
    {
    ProcessClick(mouse.x,mouse.y, mouse.Mode);
  }
  else if (mouse.Mode == eModeWalk){ //when right-clicking disabled, do nothing
		}
		else // right-click, so cycle cursor
		{   
			mouse.SelectNextMode();
    }
  }
#sectionend on_mouse_click  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart interface_click  // DO NOT EDIT OR REMOVE THIS LINE
function interface_click(int interface, int button) 
  {
  }
#sectionend interface_click  // DO NOT EDIT OR REMOVE THIS LINE


The error is:
in Global script (line 37)
Error: GetProperty: no such property found in schema. Make sure you are using the property's name, and not its description, when calling this command.

I added a new view CUR_WALK and a property WALK_A
#29
Ah right I hadn't realised that, I'm not very experienced with scripting/coding.
That seemed to work at first but it called the wrong animations so I reorganised the cursor animations to be what it expected and updated the cursors animation numbers, but now the Look cursor seems to show up as the grab cursor and the grab cursor shows up as the tinted talk cursor.

Edit:
I just loaded it up again to check something and the cursors all seem to be fine now, thank you for your solution.
But the crash on hovering over the door hotspots is still occuring.

Properties Schema
TALK_A Boolean
LOOK_A Boolean
GRAB_A Boolean

The hotspots that crash the game use this script for hover:
Code: ags
 
   mouse.SaveCursorUntilItLeaves();
   mouse.Mode = eModeWalk;
   mouse.UseModeGraphic(eModeWalk);

These hotspots have none of the properties ticked. Any ideas on what I did wrong?
#30
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