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

#21
I'm trying to make my character automatically walk to the closest point on a rawdraw line. How do detect which coordinates on a rawdraw line that are the closest to a character?

Also, is there a way of changing the colour of the rawdraw line, or making it transparent?

Edit: does this belong in the technical forum?
#22
I'm having a few characters that in are like stick figures, with thin arms and legs. These are difficult to hit, sometimes. I cannot simply draw a hotspot over the characters, as they move all over the screen. Is there a way to enlarge the "click zone"?
#23
I've got this game that's grown to 170 megs without sprite compression turned on. This, of course, took a long time compiling. Depending on whether I ran photoshop or bittorrent, with only 512 megs of ram compiling often took 1-3 minutes. Then I tried turning ON sprite compression, just to see how much space I could save. I expected it to take at least twice as long as it used to. Guess what... it took about 20 seconds! And it still does, even after adding new sprites.

How the heck does this work?

Edit: I just gotta say, this discovery is really speeding up the game development. Is it on by default? If it is, I've probably turned it off a really long time ago to save time compiling. Running version 2.71.631 btw.
#24
Is there an easy way to trigger a screensaver, being sent to another room, after a certain period of time? It probably has go to somewhere in the global rep exec script but I have no idea how to find out whether the player moved his or her mouse and hit any buttons the last five minutes or now.

I tried snooping about the forums with little luck. Cheers!

Edit: The code below with a few additions made the screensaver work perfectly! Thanks a lot.
#25
AGS Games in Production / Life of D. Duck II
Sat 03/03/2007 00:53:16
Life of D. Duck II - It's DONE, completed game thread: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=35960.0

D. Duck is a champion. Having won Duckcity (Duckburg) marathon, his only goal left in life is winning the heart of Daisy. When D. Duck comes home with heart medicine for his sick old grandmother, fat Uncle Jubalon arrives at his doorstep. Unable to stop his uncle from breaking into the house, D. Duck is witness to an appetite unlike any other. As his girlfriend flees the scene, she seeks shelter in the loving arms of lucky Cousin Anton (Gladstone Gander). Take control over D. Duck as he struggles to handle his biggest problems yet, and meet up with popular Disney characters such as Uncle Scrooge, Magica De Spell and his three troublemaking nephews.

All dialogue and artwork made by aspiring artist Bjornar B, which will provide the project with exclusive material. Game design, animation and scripting by yours truly, heavily inspired by the amazing art of this fine, young craftsman. The soundtrack will feature several Commodore 64 tracks recorded straight from the sid files to give them that authentic retro feel that should go well along with the game's unique, lo-fi graphical style.

Game trailer (NEW!)



(click image or this link)


Screenshots


Status

DONE!

Finished game: http://www.adventuregamestudio.co.uk/yabb/index.php?topic=35960.0
#26
Alright, I've got two overlays in my room:
Code: ags
//script for Room: Player enters room (before fadein)
id1=CreateGraphicOverlay(0,250,984,0);
id2=CreateGraphicOverlay(150, 2, 1172, 1);


The first overlay, id1, is a bunch of plants that scrolls by near the bottom of the screen, giving the game a 3d look.

The second, id2, I want to be drawn BEHIND an object, in my case, a window frame.


Code: ags
// script for Room: Repeatedly execute
vpx=GetViewportX();Ã,  
MoveOverlay(id1,0-((vpx*width1)/swidth),100);
MoveOverlay(id2,50+((vpx*width1)/(swidth*20)),15);


This part moves the overlays around according to the movement of the player. Now, is there a way to put overlays behind objects and characters? I also tried to move around objects using nearly the same code, but failed miserably. The MoveObject command wants a speed variable which doesn't really go over well with the AGS engine, I guess.

Any tips?

PS: Yeah, I'm using the old scripting commands, I know, I know...
#27
I was thinking of implementing a feature where if the sun is covered by skies, the screen grows darker and vica versa. What I want for this is a script or a function that counts how many pixels of an object that are visible to the player. Is this doable?
#28
This snippet plays great ingame, as long as I don't try to skip it.

Room 2:
Code: ags

StartCutscene(eSkipESCOnly);
GUIOff(LUGGAGE);
hasmedicine = 1;

cEgo.Walk(222,138,eBlock,eAnywhere);
cEgo.Say("Animate: Open Door");
ObjectOff(2);
ObjectOn(1);
cEgo.Walk(174, 92, eBlock, eAnywhere);

SetCharacterTransparency(EGO, 100); // LINE 118, THIS LINE GIVES THE ERROR

DisableRegion(2);

cCar.ChangeRoom(2, 168, 89); // SPAWN CAR

cCar.Walk(225, 139,eBlock,eAnywhere);
cCar.Walk(208, 157,eBlock,eAnywhere);
ObjectOff(1); // TURN ON OPEN DOOR SPRITE
ObjectOn(2); // TURN OFF CLOSED DOOR SPRITE
cCar.Walk(161, 171,eBlock,eAnywhere);
cCar.Walk(98, 187,eBlock,eAnywhere);
cCar.Walk(74, 204,eBlock,eAnywhere);

SetGlobalInt(212, 1); // TRIGGERS CONTINUATION OF CUTSCENE WHEN ENTERING NEXT ROOM
EnableRegion(2);
cCar.ChangeRoom(15, 124, 121);

player.ChangeRoom(15, 179, 156);


Room 15:
Code: ags


// script for Room: Player enters room (after fadein)
if ((player.prevroom==2) && (GetGlobalInt(212)==1)) {
 SetGlobalInt(212, 0);
 DisableRegion(1);

 cCar.Walk(114, 142,eBlock,eAnywhere);
 cCar.Walk(150, 146,eBlock,eAnywhere);
 cCar.Walk(187, 175,eBlock,eAnywhere);
 cCar.ChangeRoom(20);
 ObjectOn(0);
Ã,  
 SetPlayerCharacter(EGO);
 SetCharacterTransparency(EGO, 0);
Ã,  
 EnableRegion(1);

 AddInventory(13);
Ã,  
 GUIOn(LUGGAGE);
 EndCutscene();
}


If I do try to skip, I get this error:

---------------------------
Illegal exception
---------------------------
An exception 0xC0000005 occured in ACWIN.EXE at EIP = 0x00472148 ; program pointer is +7, ACI version 2.72.920, gtags (315,76)

AGS cannot continue, this exception was fatal. Please note down the numbers above, remember what you were doing at the time and notify CJ on the Tech forum.

in Room 2 script (line 118)


Most versions of Windows allow you to press Ctrl+C now to copy this entire message to the clipboard for easy reporting.
---------------------------
OKÃ,  Ã, 
---------------------------



Any ideas what's going on? Why would setting the player character's transparacy value to 100 cause problems skipping the cutscene?
#29
When I start my game from a shortcut on the desktop, AGS creates the savegames on the desktop also. Why does this happen, and how do I stop it? AGS saves normally when I start the game from the start menu folder.
#30
Completed Game Announcements / Life of D. Duck
Fri 06/01/2006 03:30:54
Over the course of the last six months, I have put way too much time into making this adventure game called Life of D. Duck. This adventure game is filled with broken english and awful, awful artwork that would make Walt Disney turn in his grave. You're probably wondering why, and the answer is to celebrate aspiring artist Bjornar B. He made all the dialogue and artwork in this project.

Quote
When D. Duck is born, he comes out of the egg with a clear vision in his mind: To win Andecity (Duckburg) marathon! Full of anticipation he asks Grandmother Duck what he must do to become a champion. The solution? Making oat porridge.

Take control over D. Duck in his quest to make oat porridge in this interactive adventure game developed by Audunsoft in close cooperation with aspiring artist Bjornar B.

Cover:

(Low-res cover art)

Screenshots:



Features
- Same kind of interface as in Sam & Max
- Over 80 different ingame sound effects
- Runs in glorious 640x480 resolution
- At least 30 minutes of gameplay
- Bjornar's own porridge recipe included
- Exclusive dialogue and artwork by Bjornar B

Download

!! IMPORTANT !!  Change "REPLACE" in the URL to a single "r". The AGS forums has some kind of de-leetifyer that corrupts my URLs.

http://home.online.no/~gei-pe-REPLACE/Readme.txt
http://home.online.no/~gei-pe-REPLACE/DDuckSetup1.00.exe (10.5 MB) (Windows installer)
http://home.online.no/~gei-pe-REPLACE/DDuckFiles1.00.rar (9.5 MB) (PC/MAC)

Don't let those lousy drawings put you off, there's an inspiring story to be told!

Previous game: Frog Island
Latest game: Life of D. Duck II
#31
I've got this function where I want to control an audience laughter by the help of a slider (A silly little feature that will by default be off!). I figure the easiest way of doing this is making the wavs play on a single channel that's easy to keep track of, so why not play them on channel 2, since all the other channels are extensively used..

However, I can't find any documentation on how to use PlaySpeech(int, int).
And I can't force AGS to play a sound effect on this channel by using PlaySoundEx either.

Doing a search on PlaySpeech on the forums is hopeless as it returns one million "DisplaySpeech" results... So what's a good workaround in this situation?
#32
I'm having my own inventory, where you can pick things off of the inventory background like in Sam and Max. While it gives you the illusion of taking stuff from the inventory, all it does is set the inventory slot sprite to a blank one, and change the cursor sprite into the old inventory sprite. Everything is working grand, except when putting it back to the spot where it originally was.

I'm having this in all my items' Use Inventory On This Item script:

Code: ags

// script for inventory1: Use inventory on this item

if (character[EGO].activeinv==1) {
Ã,  Ã,  SetInvItemPic(1, 54); // Replaces the blank sprite with the original one, user has "put back" the item.
Ã,  Ã,  SetActiveInventory(-1);
Ã,  Ã,  SetCursorMode(MODE_USE);
Ã,  Ã,  Wait(15); 
}


It's the Wait() function that's causing the annoyance for me. After you've put the item back, it waits for a little while, breaking the illusion I'm looking for, which, by the way, works great when I click with the item anywhere else on the inventory surface (which also puts the item back to its original slot).

If I don't have the Wait() in there, it will pick the item right back up, and it won't release the item. Any clues here?
#33
1. I've got several object in the game I want to see, but not being "seen" my cursors, that change when hovering over objects. How do I avoid this?

2. Is there a way of having a character only move in only the y direction, independent of what x position it is? When doing MoveCharacter(character, int x, int y), you always have to fill in both x and y....

3. Is there a way of changing the animation speed in the IdleView? Not how long you have to wait for it to happen, but the actual animation's speed?

Sorry about the awfully general topic, but these things are really bugging me... :-*


Edit: Thanks Strazer! I had no idea you could set negative values in the view editor...
#34
I have a screen where a train passes by every now and then. Here's the repeatedly execute script:

Quote
if ((character[TRAIN].x > -100) && (character[TRAIN].x < 420)) { // If train is closing in on visible screen, play the train sound
PlaySound(4);
}

if (character[TRAIN].walking == 0) { // When the train has reached its destination, it's time to go back
Ã,  int randomPosX = Random(1000)-2000; // Find random negative X value
Ã,  MoveCharacterPath (TRAIN, randomPosX, 152);
Ã, 
Ã,  int randomNegX = Random(1000)+2000; // Find random positive X value
Ã,  MoveCharacterPath (TRAIN, randomNegX, 152);
Ã,  }

if (AreCharactersColliding(EGO, TRAIN)) { // Character being hit by train
Ã,  Display("Ouch!");
Ã,  }

if (AreCharObjColliding(TRAIN, 0)) { // Train hits bottle
Ã,  ObjectOff(0); // Bottle vanishes
Ã,  ObjectOn(1); // Insides revealed
   }

I have this puzzle where, in order to open a bottle, you have to put in on the train tracks and wait for the train to pass by. As the train is already making a sound when it's passing by, having the engine output a nice glass breaking sound proved harder than I imagined.

Putting a "PlaySound(X) while (IsSoundPlaying()) Wait(1);" in the AreCharObjColliding part won't work, since there is a sound playing continously from before (the train sound). A simple PlaySound(X) obviously won't work as it's in the rep execute script. I've tried experimenting with various Global Ints also, but haven't had any luck here.


In short, my questions are:

A) How do I workaround this problem?
B) How come the AGS engine can't find out whether a spesific sound effect is playing or not? Why not a IsSoundPlaying(X) function?
#35
I can't believe I can't make this work... I am so angry I'm about to pop a fuse! In a rooms repeatedly execute:

Code: ags

if (i = 320) {
Ã,  SetCharacterView(JUBALON, 23);
Ã,  AnimateCharacter(JUBALON, 0, 3, 1);
Ã,  while (character[JUBALON].animating) Wait(1);
Ã,  ReleaseCharacterView(JUBALON);
Ã,  i = 0;
Ã,  }

i++;
}



My problem is where to define integers start value?

It's supposed to be an Idle animation, where a person is sipping soda from a bottle. When the animation is running, the bottle, Object 0, should vanish.

I've tried using the Idle animation thing, but that doesn't let me turn an object off, or does it? (Actually I tried playing an empty sound file during one frame of the animation to remove Object(0) (With the help of a bit of code in rep execute), but, since AGS can't distinguish one sound from another, it didn't work correctly. If a command like IsSoundPlaying(8) would be available, it would save a lot of trouble.

Or, perhaps there is a command that reports back if a spesific View is being used? If the program could report back if my character is using view 23 I'd sure appreciate someone telling it to me.Ã,  :-X
#36
When I press the F5 button, a custom GUI pops up. The problem is, I can still press and interact with persons and objects in the game world when clicking outside this GUI. How do I make a GUI stay on top blocking all other GUIs? ???

The same problem goes for when another GUI pops up:



I can still click the buttons on the GUI "below" it!  >:(
#37
Almost all AGS games uses buttons within the inventory GUI to change the mouse cursor's looks and behaviour. What I've tried for quite some time is to have the mouse cursor change the same way by right-clicking the mouse inside the custom GUI as when right-clicking inside the gaming part, a task I have yet to succeed in.


Let's take a look at parts of the global script:

In repeatedly execute:
Code: ags

// Script that changes icon of the mouse whenever there's something you can interact with underneath.

string name;
GetLocationName(mouse.x, mouse.y, name);	// Get the name of what's under the cursor	
if (StrComp(name,"")==0) SetDefaultCursor();	// if blank ( or hotspot with no name ) do nothing	
else {	
   if (GetCursorMode()==1) {
      if (GetLocationType(mouse.x,mouse.y)>0) SetMouseCursor(8);
   else SetDefaultCursor(); 
   }
   if (GetCursorMode()==2) {
      if (GetLocationType(mouse.x,mouse.y)>0) SetMouseCursor(9); 
   else SetDefaultCursor(); 
   }
   if (GetCursorMode()==3) {
      if (GetLocationType(mouse.x,mouse.y)==2) SetMouseCursor(10);
   else SetDefaultCursor(); 
   }
}


// This snippet just turns the inventory off if clicked outside of it before entering, or if the cursor has entered - and then moves out of it.

if (IsGUIOn(INVENTORY)){
    // Checks if mouse has moved onto GUI...
    if (((mouse.x > 50) && (mouse.x < 270)) && ((mouse.y > 35) && (mouse.y < 165))) {
    SetGlobalInt(1, 1); // Mouse HAS entered GUI!
    }
  
    // Checks if the mouse has entered the GUI...
    if (GetGlobalInt(1)==1) {
       // Checks if mouse is still over the GUI...
       if ((mouse.x < 50) || (mouse.x > 270) || (mouse.y < 35) || (mouse.y > 165)) {
          //If not:
          GUIOff(INVENTORY);
          SetGlobalInt(1, 0);
          }
       }
    }
  
    // Closes GUI if clicked outside GUI before entering it
    if (GetGlobalInt(1)==0) {
      if ((IsButtonDown(RIGHT)) || (IsButtonDown(LEFT))) {
        GUIOff(INVENTORY);
        SetGlobalInt(1, 0);
      }
    }


No need to change anything here, is it?


function show_inventory_window()
Code: ags

function show_inventory_window() {
  
  GUIOn (INVENTORY);
  
  SetMouseCursor(6);
  SetCursorMode(2);
  
}


I guess this is the part where I have to add new code? The problem is whenever I try to program something when the "handle inventory clicks in script" box is checked, I can't make anything work. It has to be checked in order to add this kind of "advanced" feature, no?

I haven't been able to find an answer to this "right-click to change mouse actions inside custom inventory GUI" riddle anywhere on the forums, which I think is kind of strange. Is it possible to implement this feature into the game?
#38
I'm in the middle of creating an icon-based dialog system similar to the one in Sam and Max... I'm wondering, is there a way of manipulating Objects / Buttons within a GUI? For example, when the user has clicked an icon and it runs a dialog, I want some buttons to just disappear afterwards.

Please tell me I don't have to use several GUI's to accomplish this...
#39
Does anyone know how to get AGS to automatically close the GUI when the mouse hovers outside it? I'm trying to make a custom inventory GUI that closes when the mouse is outside of it...

Code: ags
#sectionend repeatedly_execute  // DO NOT EDIT OR REMOVE THIS LINE

function show_inventory_window() {
  
  GUIOn (INVENTORY);  
  // switch to the Use cursor (to select items with)
    SetCursorMode (MODE_USE);
  // But, override the appearance to look like the arrow
  SetMouseCursor (6);
}



Additionally, does anyone know why the SetMouseCursor command doesn't change the cursors appearance to cursor number 6, but instead it uses the "Use" cursor instead? If I understand the function correctly, you're supposed to be able to have the cursor appear as you like, but with the use function.

Does anyone know why this isn't working?

I couldn't find any answers anywhere to these little riddles...
#40
Completed Game Announcements / Frog Island
Wed 03/11/2004 02:50:09
Audunsoft proudly presents Frog Island v1.00!

After surviving a horrible accident, you wake up on... Frog Island! Your goal is to get past the hideous french guard with a baguette which is, of reasons unknown, stopping anyone from leaving the area. Frog Island is a short adventure game about a creature stuck on an island with a gigantic frog, an unhappy banjo player and good rhythms!


Features:

- Runs in the good old 320 x 200 resolution
- 16 bit colour
- At least 15 minutes of gameplay
- Same kind of interface as in Sam & Max
- Almost 10 different background images
- A broad variety of ingame sounds
- Cutscenes that will blow you away
- A main character with some serious personality


Screenshots:




Download

readme.txt
frog_island.zip 1.8 MB (fastest)
frog_island_installer.exe 1.8 MB (installer that creates start menu group w/ uninstaller)


Notes

I've worked on this game for a couple of months, off and on, while learning AGS at the same time. As it's my first game, please be gentle with me.

I hope you enjoy playing it, and that you leave a message on the games' homepage (http://audunsoft.moo.no) as well as here when you've tried it out!
SMF spam blocked by CleanTalk