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

#841
Thanks monkey, however there is a parse error in the expression near new. At least thats what the script compiler thinks.
Is there an error somewhere?

All this complex code is really new to me.
I reckon I'll credit both you and Ashen after this prototype is finished!  8) - Simply amazing stuff guys thank you so very much.

Paul.
#842
QuoteThat might just be a slip up in your post, but SetHotspotIcon isn't a Hotspot extender function
Oh yeah i changed it in my code to SetHotspotIcon because I need to write 2 more functions that apply to characters and objects. SetHotspot icon tells me clearly that it is for a hotspot. Unless I can declare objects and characters under the same SetIcon function then I really want to have function  names that I can tell apart. Would SetHotIcon be better or can SetIcon be made to work with both hotspots, characters and objects?

Thanks Ashen,
Paul.
#843
Thanks a bunch, Ashen.

As you mentioned with 2.72, the following commands go in player_enters_room, right? albeit in 2.72 style, however with 2.8 do they also go in the player_enters_room and can I put them in before fade in?
hTalldoor.SetIcon(75);
hOdddevice.SetIcon(32);

Is there any way to simply define the HotspotIcons in the global script or a module script. The idea is to make everything as neat as possible and I don't really want to have to define Hotspot Icons in every room script.

When I try and save the room, the error says SetHotspotIcon is not a public member of hotspot. So when I move the above code into the global script under function_game_start the error says undefined token hTalldoor.

I am a little unsure about the placement of those two commands.

Cheers,
Paul.
#844
You know what, your right! I thought this might complicate things but not if i make the GUI big enough to encompass the grace area AND the lower left part of the screen where the (i) button is.
Thanks, Khris, and Ashen.

Paul.
#845
Perfect Ashen. You've answered most of my questions, even the ones in my head that I wasn't ready to post. Your a troop.
I had a hunch arrays might be the answer here, however I've never written one. Theres a first time for everything, right!?

As you suggested, I'm using a function that assigns a hotspot a corresponding Icon sprite number. The sprite number is used in the GUI depending on what hotspot the mouse is over.
So my code would go like this? (I only have two hotspots for now).

Code: ags
#sectionstart SetHotspotIcon  // DO NOT EDIT OR REMOVE THIS LINE
function SetHotspotIcon(Hotspot, int sprite) {
  SetHotspotIcon(hTalldoor, 75);
  SetHotspotIcon(hOdddevice, 32);
}
#sectionend SetHotspotObject  // DO NOT EDIT OR REMOVE THIS LINE


#sectionstart repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
  if (GetLocationType(mouse.x,mouse.y)==eLocationHotspot) {
    gIconBox.Visible = true;
    DisplayHotspotIcon(mouse.x,mouse.y);  //// How exactly would something like this go according to my new function?/////
  }
}


Most appreciated, man. Thank you.

Cheers,
Paul.

EDIT:
I'm a little stuck on the function side of things now. To give you a better example of my small game prototype, it's available below if any one wants to take a look at it and tell me where I've gone wrong. It's basically a reworked old Loom Template.
http://www.shuugouteki.net/paul/Development/Adlanto.zip (409KB)

Cheers,
Paul.
#846
QuoteAnd btw, to check if the mouse isn't over gInventory, you can use...

Thanks, Khris but i've done it that way so that theres a small gap between the gui and the room in the background in case the mouse slips while trying to use one inventory item with another. Always good to have a bit of mouse freedom in this case. The other reason is so that the mouse can be moved to the bottom left of the screen where the inventory acivator (i) button is without repetedly closing the inventory. Because the inventory doesn't take up the entire screen and only uses a small portion of the middle of the screen then checking to see if the mouse is whithin the gui would not be the best choice in my case.

To answer your first question, what I want to happen is simple. I want the hospots disabled while the inventory is showing because, again, the inventory only takes up a small portion of the middle of the screen. If i move the mouse into the 'grace area' outside of the GUI, hotspots in that area, if any, should not be enabled.

Sorry if was a little too vague before.
Does that clear things up a bit?

Cheers,
Paul.
#847
I think I found a better way to handle this using GetLocationType:
Code: ags
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
  if (gInventory.Visible == true) { // If the Inventory is visible.
    if (GetLocationType(mouse.x,mouse.y)==eLocationHotspot) { // If the mouse if over a hotspot, do nothing.
    }
    else if (mouse.x > 300) { // If the mouse moves off the right hand side of the inventory GUI, fade it out.
      FadeGuiOut_NoBlock(gInventory,100,-15);
      FadeGuiOut_NoBlock(gInventoryback,100,-15);
    }
    else if (mouse.x < 20) { // If the mouse moves off the left hand side of the inventory GUI, fade it out.
      if (mouse.y < 140) {
        FadeGuiOut_NoBlock(gInventory,100,-15);
        FadeGuiOut_NoBlock(gInventoryback,100,-15);
      }
    }
    else if (mouse.y < 10) { // If the mouse moves off top of the inventory GUI, fade it out.
      FadeGuiOut_NoBlock(gInventory,100,-15);
      FadeGuiOut_NoBlock(gInventoryback,100,-15);
    }
  }
}


What do you think Khris?

Paul.
#848
I am trying to make my code more efficient in the sense that when the mouse is moved over a hotspot, it's corrosponding icon (oWhatever) is faded in. Problem is, I can't figure out how to tell the game that an object belongs to a hotspot and that when the mouse is over one, to fade the correct one in.

Here is a snippet from the room code that I want to make part of the global script to save me having to set up each hotspot with each object tediously.
Code: ags
function room_a() {  // Set the icon of the hot/obj/char when cursor hovers over it
  // script for room: Repeatedly execute
  Hotspot *theHotspot = Hotspot.GetAtScreenXY( mouse.x, mouse.y );
  if (GUI.GetAtScreenXY(mouse.x, mouse.y) == null ) { // If there is no GUI visible,
    if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hOdddevice) { // If the mouse is over the odd device hotspot,
      FadeObjectIn_NoBlock(oOdddevice,0,-20); // fade the hotspot's icon in.
    }
    else if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == hTalldoor) { // If the mouse is over the tall entrance hostpot,
      FadeObjectIn_NoBlock(oTalldoor,0,-20); // fade the hotspot's icon in.
    }	
    else if (Hotspot.GetAtScreenXY(mouse.x, mouse.y) == null) { // If the mouse is over nothing,
      FadeObjectOut_NoBlock(oOdddevice,100,-20); // Fade the Odd Device icon out.
      FadeObjectOut_NoBlock(oTalldoor,100,-20); // Fade the Tall Door icon out.
    }	// Do the same for all hotspots/objects/characters you use in this room.
  }
  else if (gInventory.Visible == true) { // If the inventory GUI is visible, ignore hotspots/objects/characters.
  }
}


Here is some psuedo code that gives an impression of what I want to acheive:
Code: ags
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
  Object*oHotspotIcon=Object.ForHotspotAt(mouse.x, mouse.y); // The hotspot's icon is an object that can be tied with the hotspot.
  if (gInventory.Visible == true) { // If the inventory GUI is visible, ignore hotspots/objects/characters.
    if (GetLocationType(mouse.x,mouse.y)==eLocationHotspot) {
    }
    else if (mouse.x > 300) { // If mouse moves off the right hand side of the Inventory GUI, fade it out.
      FadeGuiOut_NoBlock(gInventory,100,-15);
      FadeGuiOut_NoBlock(gInventoryback,100,-15);
    }
    else if (mouse.x < 20) { // If mouse moves off the left hand side of the Inventory GUI, fade it out.
      if (mouse.y < 140) {
        FadeGuiOut_NoBlock(gInventory,100,-15);
        FadeGuiOut_NoBlock(gInventoryback,100,-15);
      }
    }
    else if (mouse.y < 10) { // If mouse moves off the top of the Inventory GUI, fade it out.
      FadeGuiOut_NoBlock(gInventory,100,-15);
      FadeGuiOut_NoBlock(gInventoryback,100,-15);
    }
    else { //If the mouse is over a hotspot, fade in the corrosponding Icon.
      if (GetLocationType(mouse.x,mouse.y)==eLocationHotspot) {
      FadeObjectIn_NoBlock(oHotspotIcon,0,-20);
      }
    }
  }
}


Completely non-working code, perhaps ridiculous to some, however if some of you get what I am trying to do, could you give an example of how to achieve this?
Thanks in advance, guys.

Cheers,
Paul.

EDIT: DARN! I posted this in the wrong forum. This ain't so beginner I don't think. Can a moderator please move this thread to the Technical Forum. Thanks.
#849
Sure thing. I understand which is why I am posting for help. And I thankyou kindly for offering yours.

BTW, Hotspot*h=Hotspot.GetAtScreenXY(mouse.x, mouse.y); didn't seem to work in my case. It said hotspot h doesn't exist.

Basically I'm writing a small game prototype in AGS so that when I have a few programmers on board we can tackle the really major stuff. Right now I'm simply working on a small piece of what should later be a great adventure. I appreciate any help you can give me.

Thanks, Khris.

Paul.
#850
Sorry pal. I didn't mean to be rude. It's just that all this stuff confuses me and it's even more irritating when I've spend 4 days going through manuals not to find a thing that gives me any clue how to write the code. Naturally, I'm asking on the forums because anything in the manual isn't enough for me to problem solve my way through it. I'm pretty good at simple things, like global ints and basic code however writing functions that aren't specifically made an example of in the manual are not my strong points.

Did you say the 2.72 manual? Why should I be reading that if I'm using 2.8? That doesn't make any sense. Is the 2.8 manual not complete? That WOULD make sense.
Terms like 'RTFM' aren't particuarly popular with artists making a good attempt at writing code. Especially after spending days in the manual to no avail.

EDIT: Oops I can see how you got the idea that I was using 2.72. I've imported a 2.72 game in 2.8 and am reworking the code. Sorry for the confusion there, Khris.

Please, no hard feelings. I'm sure it read twice as bad as I meant it. Apologies.

Cheers,
Paul.
#851
Thanks but are you referring to the manual incuded with ags 2.8 betas or do you mean the online one. I've been searching for a number of things in the offline manual and apart from the occasional, badly referenced code example, h.Enabled didn't come up at all. How am i supposed to find that in the darn manual if it simply does not exist. You know what, I've said it before and I'll say it again, the AGS help manual is in desperate need of a re-write. A beter search algorithm would be nice along with all the new script functions and everything else that has been inconveniently left out.
#852
How would I go about this?

My pseudo code:
Code: ags
function repeatedly_execute() {
  // put anything you want to happen every game cycle here
int hotspot_ANY=GetHotspotAt(mouse.x,mouse.y);
  if (IsGUIOn(1)==true) {
  hotspot_ANY.Enabled = false;
  }
  else {
    hotspot_ANY.Enabled = true;
  }
}


Problem is, '.Enabled' obviously can't be applied to integers, naturally, and I'm not sure what property I need to define hotspot_ANY under. It's not int and string doesn't work either.

Cheers,
Paul.
#853
I prefer the new layout to be honest. Having the pane on the right, for me, feels more like I'm using a newer engine.
I suppose that comes from the fact that most software in windows that include panes, such as Adobe Flash, have it on the right by default.

I welcome the option for left hand pane placement openly however.

Paul.
#854
QuoteThe Beyond A Steel Sky template should be in.
I agree there.

One cool template I forgot to mention was a pop-up system similar to the sierra style interfaces however at the bottom of the screen with a cool flick back animation along with a fade in. To give you a visual example:
http://www.shuugouteki.net/paul/Movies/example.html

Cheers,
Paul.
#855
I think it should be possible for AGS 2.8 to be able to load plug ins from a directory just like with scripts.
I strongly believe the same for all things including templates but thats another ball game.

Cheers,
Paul.
#856
I agree. In addition to the Monkey Island 2 / Fate of Atlantis system I think we should include a Dig style system too. Full screen 320x200 background art with a non invasive (i) button to launch the inventory/mousemode interface.

I would also love to see a more age specific interface. I've always thought Loom was a great system for children who don't fully understand the A-typical Monkey Island verb-bar interface. Instead of notes on a wooden staff, a few simple icons for look, use, grab and talk would be fitting along with, like loom, an icon based hotspot indicator that fades in and out at the bottom-right hand corner of the screen.

I'm no template writer but I've managed to come up with a similar interface for my game that, in my opinion, takes the cake over the old systems. It shouldn't be too hard for a programmer.

EDIT: To shed more light on this topic, I believe we need new class systems in addition to the classic MI2/FOA interfaces. We should be experimenting to the best of our ability, especially with AGS 2.8 close on the horizon.

Cheers,
Paul.
#857
QuoteThe reason this isn't implemented is because views are still referenced by number, and thus if they could be deleted all the numbers could go out of sync. However I guess it could allow view 3 for example to be deleted, and rather than shuffling them all down one it could just leave a gap at 3.

Why not implement the ability to change the view numbers like you can with sprites. In fact why not unify the numbering system in the following ways:
Instead of Sprite 'Number' call it sprite 'ID' (like Rooms, GUIs and Views).
Unlock the ID field for GUIs, Views, and Sprites to be modifiable.

If we can rearrange our stuffs Id's regardless of them being in use and perhaps with a more user friendly warning system that allows editing of the Id's before we go and change them in the script to match then life would be a load easier.

QuoteNot really sure what you mean here, as monkey_05_06 says, there's already an Object.Clickable property.
Forgive me there Chris. I must have missed this one.

Cheers,
Paul.
#858
I was thinking that. But I wanted to code in support for looping background for my game to A. To conserve resources and B. To be able to apply the same technique in other rooms.
I've actually done it your way for now but code support for looping/wrapping rooms would be nice.

Cheers,
Paul.
#859
What would I have to do to get Strazer's code to work with my background?
My buffer width is the same as the nexus in The Dig. Buffer Width = 335.
Here is my background:
http://www.shuugouteki.net/paul/Images/ballroom_example.gif

Ego is meant to be able to travel left until he walks down the second set of stairs and comes to a new room at the door beneath the starting point.
I can't seem to get the number's right. I've tried all sorts of values in #define BUFFERAREA_LENGTH XXX.

Any ideas what's going wrong? I'm using 2.8 b10 by the way.

Cheers,
Paul.
#860
I see. I knew there was an overlapping region for a reason. I just didn't think it would apply to AGS. Considering the nature of this effect, it appears to be a vital part of the technique.

Cheers for this and thanks for modifying the pic link Gilbot.
Awesome!

EDIT: I found this old thread about looping/wrapping rooms.
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=20269.0

Paul.
SMF spam blocked by CleanTalk