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

#1941
Setting the game speed too fast might not be the best idea since not everybody's computers can keep up the rate of 100fps.

The suggestions I gave were to be read as two independent pieces of advice.

1) You turn the player invisible. Then have two characters, cBody and cEgo, that get their x and y coordinates, along with view, loop and frame set to match the invisible character in repeatedly_execute_always.

or:

2) Using cHead.FollowCharacter(cEgo, FOLLOW_EXACTLY, 0); to have a static head move around with the player character.
#1942
Sadly, this is due to the way the character walking/animation system works. I've had problems with it too. It would seem that the character moves in-between you getting his coordinates/viewframe info and that the graphics are actually drawn.

One alternative is using a dummy character for the body, applying the x, y, view, loop and frame of the (invisible) player character to him every frame. These would then be identical to the settings for the head.
You could also look into the function Character.FollowCharacter and its FOLLOW_EXACTLY property.

#1943
The problem is your use of end brackets after the "else..." lines. You're trying to close a bracket which hasn't been started. Remember that the number of { and } brackets should always be the same:

Code: ags
if (GetGlobalInt(1) == 0) object[0].Visible = false; //no need for the brackets really, as you only run one line
else object[0].Visible = true; //no end bracket here
if (GetGlobalInt(2) == 0) object[1].Visible = true;  //no need for the brackets really, as you only run one line. There was also a ";" after the if statement which shouldn't be there.
else object[1].Visible = false;//no end bracket here either


If you needed to run more than one line of code in each if/else statement, you could use brackets like so:

Code: ags
if (GetGlobalInt(1) == 0) {
   object[0].Visible = false;
   //blah blah blah, more stuff here
   }
else {
   object[0].Visible = true; //no end bracket here
   //blah blah blah, even more stuff here
   }
#1944
Critics' Lounge / Re: Dott Background
Wed 08/08/2007 20:22:49
I'm guessing the missing picture is the enhanced EGA version of the Maniac Mansion title screen.
#1945
More console ports of PC adventures:

King's Quest V (NES)

Rise of the Dragon (SEGA CD)

Broken Sword 1 and 2 (PlayStation, Game Boy Advance)
#1946
Quote from: José Luiz on Mon 30/07/2007 20:27:36Walk until you reach that cross over there, Lavern. Then, look at the other side of the hill, and you'll see a huge white City, a place you could never imagine before. That's the place you'll live from now on.

Reminds me of the menu screen for Cannon Fodder for some reason.
#1947
If we end up choosing France (or anywhere else in Europe), consider me a possible attendee.
#1948
Ah, it seems the problem was that I tried to do both the struct and function declaration in a room script. Apparently the struct either has to be declared in the header or as part of the global script or a module.
#1949
Thank you, thank you, thank you, monkey!!! I'll immediately save this thread to my "AGS help" folder.
All those keywords make perfect sense now. What I discovered from your examples though, is that I don't really get how the declaration and importing of functions into structs work (mainly because I never used it before).

When I remove the lines you said won't compile and try:

Code: ags
struct MyStruct {
  import function SetVar(int value);
  import static function SetStaticVar(int value);
  };


function MyStruct::SetVar(int value) {
  if (value < 0) return;
  this.Var = value;
  }

static function MyStruct::SetStaticVar(int value) {
  if (value < 0) return;
  MyStruct.StaticVar = value;
  }


I get the error message:

QuoteError (line 166): Variable 'MyStruct::SetVar' is already imported

(line 166 is "function MyStruct::SetVar(int value) {")

What am I doing wrong?
#1950
Considering the discussion of changes to the manual, maybe this would be a good place to repeat something I wrote in another thread but never got a reply to:

Quote from: GarageGothic on Thu 10/05/2007 11:09:05is there any chance that one of you scripting wizards might write a brief introduction to these undocumented commands [referring to static, void, protected etc.] and their uses? (or if one exists, please direct me to it). I've previously studied some books on other programming languages (Java and C#, I think) in an attempt to grasp it, but their example scripts were so different from AGS script that it wasn't very helpful.

(and wow, this thread gave me two new undocumented commands I'd never heard about - private and attribute)
#1951
This exists already in the form of Character.InventoryQuantity[]. That's how the pro's would do it :)

Example:

Code: ags
if (player.InventoryQuantity[iShovel.ID] > 0) player.Say("Wow, I have a shovel!");
#1952
Do you mean the Windows boot menu? If so, that's not the same as the BIOS menu. The BIOS menu is usually accessed right after starting the computer, while the memory is being checked (depending on your motherboard manufacturer, the screen may be covered by a logo graphic while this is going on). If there is on-screen text during the bootup, it usually tells you what key to press (DEL on my computer) to access the BIOS setup.

On this site you can find the right key to press depending on the brand of the BIOS/computer.
#1953
General Discussion / Re: MAKE MY GAMEZ
Sun 22/07/2007 16:29:48
This is the best forum post since the baby horse game.
#1954
I don't have time to play the demo through now, but here are some first impressions:

The intro narrative - great. You have my attention from the very first line. It does get a bit talky towards the end, but it's one of the most exciting setups for a game I've seen in a long time.

The interface - I don't really like it. The letter icons are not quite as intuitive as graphical icons, one way of improving this would be to have the "hotspot identifier" part of the icon bar tell you what they mean, as you move the mouse over the icons. Also, PLEASE implement mousewheel support to scroll through the mouse cursors. It's always a pain to click one time too much and have to start all over. With the mousewheel, you could just scroll back one. A very nice surprise was the highlighting of exits when you press TAB. I have a similar feature in my game though it also shows hotspots.

Edit: I just found out about the hotkeys for selecting cursors - nice touch.

The thought interface - I find it slightly tedious to use for conversation, something that was also the case with the notebook in Dagger of Amon Ra. But I'm sure that it will work great for gameplay - The Shivah and Blackwell Legacy proved that to me, even though I was rather annoyed with the implementation in Discworld Noir. A small point, which can be argued since there's also the inventory to get the current thought from, is that it would be nice if the cursor changed to the current thought after selecting one and exiting the thoughts screen. I think it currently defaults to the hand icon.

The graphics - Animation is a bit stiff as can be expected from Poser characters, but overall the look is very professional. There's something off about the perspective in the street screen (not the building exterior), but I can't really put a finger on it.

Voice acting - Very nice. I've only seen the intro and had a short dialog with Sydelle, but all voices were appropriate to their characters (the main character also sounds more like a teenager than he looks it - I would never had guessed from the graphics that he was only 20).

Great work. I look forward to having some time to actually play the demo.

EDIT: Ah, so I played the demo through, and as it turns out there wasn't much more to it than I'd already seen. I can't say that the single puzzle changed my first impressions much. To be honest it doesn't make much sense that...

Spoiler
... a person tells you straight out about a problem they're having, yet you have to combine two thoughts for this topic to appear. I'm also wondering - is the nightmare about the demons just an in-joke, or does the story have actual connections to Other Worlds?
[close]
#1955
My guess, since this deals with oversaving an existing slot, is that there is some kind of confusion between actual save game indexes and the slot numbers. Make sure that you remember to FillSaveGameList after making any changes to it (including deleting games) and check that you always use SaveGameSlots property to get the proper savegame instead of just getting the SelectedIndex.
#1956
I'm guessing he means this page.
#1957
I have been bothered by the issue mentioned in 1) for some time. It seems that AGS currently calculates directions as even radians on a circle, when in reality, due to perspective that circle should be somewhat flattened.
#1958
Probably the easiest approach would be to store all the item IDs in an array, sort them there, then lose all inventory and add it back in the order of the array. I use a similar device to alphabetize lists, and I see no reason why it shouldn't work for inventory items too.

Something like this should do the trick, I think:

Code: ags

function SortInventory(InvWindow* invwin, String property, bool highestfirst) {
   int maxitems = invwin.ItemCount;
   int invitem[AGS_MAX_INV_ITEMS]; //initialize an array, unfortunately we can't use maxitems because it's not a constant. Should be possible using Dynamic arrays in AGS 2.8
   int itemcount;
   Character* invchar = invwin.CharacterToUse;
   if (invchar == null) invchar = player;
   while (itemcount < maxitems) { //read inventory to array, emptying the inventory at the same time
      invitem[itemcount] = invwin.ItemAtIndex[0].ID;
      invchar.LoseInventory(invwin.ItemAtIndex[0]);
      itemcount++;
      }

      int countentries;
      int countsubentries;
      while (countentries < maxitems) { //Now we bubble sort the items according to custom properties
         while (countsubentries < maxitems - (1 + countentries)) { 
            if (inventory[invitem[countsubentries]].GetProperty(property) > inventory[invitem[countsubentries+1]].GetProperty(property)) {		  
               int tempid = invitem[countsubentries];
               invitem[countsubentries] = invitem[countsubentries+1];
               invitem[countsubentries+1] = tempid;
               }
          countsubentries++;
          }
      countsubentries = 0;
      countentries++;
      }
   
   //write back items into inventory, with either highest or lowest value first.
   if (highestfirst == true) {
      while (itemcount > 0) {
         itemcount--; 
         invchar.AddInventory(inventory[invitem[itemcount]]);
         }
     }
   else {
      itemcount = 0;
      while (itemcount < maxitems) {
         invchar.AddInventory(inventory[invitem[itemcount]]);
	 itemcount++; 
	 }
      }
   }


I don't get any compile errors, and my small test game works fine now. But I don't have a game around with a lot of inventory items to test it out with. Could someone please give it a try and see if it works?

Rewriting this to sort alphabetically by text property instead of numerical properties should be trivial. Just replace:

Code: ags
if (inventory[invitem[countsubentries]].GetProperty(property) > inventory[invitem[countsubentries+1]].GetProperty(property)) {


with

Code: ags
String tempstring = inventory[invitem[countsubentries]].GetTextProperty(property);
if (tempstring.CompareTo(inventory[invitem[countsubentries+1]].GetTextProperty(property))  > 0) {
#1959
It's obsolete as the easiest way of running scripts for a button click (mainly because script-o-names means that we don't have to keep track of the numbers of every GUI and GUI object). In fact I just realized that I don't have a single interface_click script in my otherwise GUI heavy game.

Edit: In response to what Gilbot writes below, I just find that a single interface_click as opposed to individual functions turns into endless rows of nested "if" and "else if"s, becoming increasingly hard to troubleshoot. Also the fact that script-o-names appear in the autocomplete menu is great for disorganized people like me.
#1960
As I see it, the problem is that you deleted the interface_click function. I don't quite understand the comment about it not reading the default parameters. But obviously the crash is due to the game running interface_click(int interface, int button) while the current format of the function is interface_click(). Have you tried putting those parameters back in

Either way, interface_click is now pretty much obsolete for most uses, due to the script to run being selected directly in the GUI editor. So I'm wondering if you have actually specified a script to run for the button, or just set Left click to "Run Script" without specifying a script for the Click?
SMF spam blocked by CleanTalk