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

#1
Okay, I wasn't happy with any of the modules/pug-ins for credits, so I made my own.  Somewhere along the line it stopped working and I didn't notice.  Now I cannot figure out what went wrong?!

For troubleshooting purposes, I set the background of my gCredit from transparent to BLUE.  Then I installed a couple of checks, TEST A thru D to make sure that I wasn't moving the GUI on accident.

Between Tests C & D the GUI turns goes transparent/disappears/moves - I didn't know?!

So I created the ResetCredit function, and added the lines to run it.

The screen starts, the GUI background image is set, and then it all disappears between test C & D?!  Keep in mind the position of the GUI never wavers.  Also, the ResetCredit function which worked fine to initially set the background image, does nothing on any of the subsequent runs.

I REM'ed out the repeatedly_execute_always() to see if THAT was giving me grief, and nothing.  The GUI still disappears.

Went into the GUI, checked controls 0 thru 4, (they are labels), and NONE of them are locked.  The GUI covers the entire screen.

Any ideas?

- Cogliostro.

Code: ags

// room script file

String RollCredits[5];
short Number;
int OrgPosition=500;
  
function room_Load()
{
  gBox.Visible=false;
  gGear.Visible=false;
  Mouse.Visible=false;

  aGreek.Play();
  gCredits.Visible=true;
  
  Number = 1;
  RollCredits[Number]=String.Format("Design, Story, Scripting, & Graphics:[Cogliostro");
  Number++;
  RollCredits[Number]=String.Format("AGS Game Engine:[Chris Jones");
  Number++;
  RollCredits[Number]=String.Format("");
  Number++;
  RollCredits[Number]=String.Format("Thank you for playing!");
  Number++;
  RollCredits[Number]=String.Format("");
 
  gCredits.Controls[0].X=0;
  gCredits.Controls[0].Y=OrgPosition;
}

function room_AfterFadeIn()
{
  int x=0;
  while (x<Number) {
    gCredits.Controls[0].AsLabel.Text=String.Format(RollCredits[x+1]);
    gCredits.Controls[0].TweenPosition(0.75, 0, 200, eEaseInSineTween, eBlockTween);
    Wait(10);
    gCredits.Controls[0].TweenPosition(0.75, 0, -50, eEaseInSineTween, eBlockTween);
    x++;
    gCredits.Controls[0].Y=OrgPosition;
  }
  Wait(300);
  RestartGame();
}



**********************************************
EDIT
**********************************************

Looks like the TWEEN module died.  Replacing with a newer version....  More troubleshooting later - It's not the tween module. 


A lot of troubleshooting has allowed me to eliminate a bunch of possible causes.  The code as it is currently represented shows the problem.  If I do anything that causes a delay in the LOOP - WHILE (lines 47-59) it causes the GUI to disappear: either a wait command or a eBlock.
#2
Hints & Tips / Bigfoot
Tue 05/06/2018 02:18:22

I preserved the game as my son created it, so there's one bug.  Pick up the bucket BEFORE you pick up all the wood.
#3
Completed Game Announcements / Bigfoot
Tue 05/06/2018 02:10:15
My son wanted a shot at making his game in AGS.  This is the result.  I had him design it, write all the dialog, typos included, and enter all the code.  I created the graphics and coached from the sidelines.  This is the result:





Left click to interact / walk
Right click to examine / look

Click here to download the game!  20 minutes of your life you will NEVER get back.  (For the PC only)

- Cogliostro

#4
Between the Pillars of Creation needs a couple of voice actors:

Female - Atalanta, ship's doctor - 10 lines, calm and condescending

Two female, one male - Stygian Witches - They were astronomers before they lost their marbles - about 8 lines each

Male - Castor & Pollux - the arrogant twins - 14 lines total, really just one role since they sound alike.

Either gender - Harvester - A poetically murderous robot!  14 lines done 4-5 times each.

Male - Draco - officious and smug little AI - 7 lines

Male - Pelias - Captain of the ship, 40 lines.  Half of them are delivered in a fatherly disapproving voice, the rest are murderously insane.

Male - Phineas - Aquaponic Engineer and friend of Jason's - 15 lines

PM me if you're interested.
- Cogliostro
#5
Okay, I'm having a problem with the RoomTint function.  I had everything shift blue as the main character tries the UV light to check for blood, but when I use the command RoomTint(0,0,0) it does NOT go back to the original color.  As you can see in the BEFORE and AFTER pix below.

BEFORE


AFTER




AGS Editor .NET (Build 3.3.3.0)
32-Bit True Color
Direct3D 9 hardware acceleration
640x400 resolution


GLOBALSCRIPT.ASC
Code: ags

function BluRayOn() {
  int x=0;
  TintScreen(0, 0, x);
  while (x<50) {
    TintScreen(0, 0, x);
    x+=1;
    Wait(1);
  }
  
}

function BluRayOff() {
  int x=50;
  TintScreen(0, 0, x);
  while (x>0) {
    TintScreen(0, 0, x);
    x-=1;
    Wait(1);
  }
}


GLOBALSCRIPT.ASH
Code: ags

import function BluRayOn();
import function BluRayOff();


ROOM CODE
Code: ags
  if (mouse.Mode==eModeFlashligh) {
    BluRayOn();
    player.Say("&284 Running various bandwidths of UV light across the surface to look for either blood or bacteria... and nothing.");  
    BluRayOff();
  }


What the BLAZES did I do wrong?!

- Cogliostro
#6

Okay, for one point of the game, there is a combination, and I wanted it to be randomly generated.  No big deal. 
Code: ags

  //Set combination for the door!!
  Combo1=Random(9);
  Combo2=Random(9);
  Combo3=Random(9);
  Combo4=Random(9);
  cMedea.Say("&39 The combo is %d%d%d%d.",Combo1,Combo2,Combo3,Combo4);


EXCEPT, I am going to have voice overs.  Is it possible have voice overs with a random combination?  And by that I mean without having the character read the four-digit combination one number at a time and sound like an idiot.

- Cogliostro
#7
Okay, upgraded to AGS 3.3.2 and my problems playing music went away - I was getting static on MP3 files.  But when trying to number the lines for voice acting I got this error.  Upgraded to 3.3.3 and still getting the same error

ERROR when trying to number the lines for voice acting:
Code: ags
Unknown character name: ayer
Unterminated string in script: 'll just leave it where it is.");CntLabC++;}
Failed to save room room41.crm; details below
room41.asc(356): Error (line 356): Type mismatch: cannot convert 'const string' to 'int'


Code from the room itself ==This is the script for the ENTIRE ROOM so the line #s in the error code would match.
Code: ags
// room script file

// Create only a particles system manager
ParticleSystemManager PS;
int value=1;
bool Steam=true; 
bool Gas=false;
bool Rescue=false;
bool OpenDoor=false;
bool Mission=false;
bool DirtClean=true;
bool Turniquet=false;
bool TakeRope=false;

int CntFoot=0;
int CntPhilo=0;
int CntTanks=0;
int CntComp=0;
int count=1;
int CntRupt=0;
int CntChair=0;
int CntGloveT=0;
int CntGloveP=0;
int CntMask=0;
int CntLabC=0;

int s;  // PArticle Ssytem Identifier

// **********************************************************************
DynamicSprite* GenSprite;
DrawingSurface* GenSurf;
//oInv object must be created - has blank image = #105

function Take(int ImgNum) {
   int x=0;
   while (x<99) { 
     GenSprite = DynamicSprite.CreateFromExistingSprite(ImgNum, false);
     GenSprite.Resize(400 - (x*4), 400 - (x*4));
     GenSurf = GenSprite.GetDrawingSurface();
     GenSurf.DrawImage(0, 0, GenSprite.Graphic);
     oInv.Graphic = GenSprite.Graphic;
     oInv.X=(100 - x + GetViewportX());
     oInv.Y=400;  //oInv.Y=(400 - x*4 );
     Wait(1);
     if(x==0) { Wait(60); }
     x=x+5;
   }
   GenSurf.Release();
   GenSprite.Delete();
   oInv.Graphic = 105;
   oInv.X=0;
   oInv.Y=0;
}
// **********************************************************************

function Steamy() {
  s = PS.CreateSystem(100, false, dtBackground);  
  PS.emitter_creation_mode (s, rmAllways, 1, 2, 10);
  PS.emitter_set_position (s, ptPoint, 700.0, 235.0);
  PS.emitter_set_velocity (s, 120, 200, 60, 100);
  PS.emitter_set_transparency (s, 30, 85);
  PS.emitter_set_age (s, 40, 100);
  PS.emitter_set_sprite (s, 841, 844);
  PS.action_set_bound_box (s, 550, 0, 950, 400);
  PS.action_add_force (s, ftConstant, 0.0, 9.8);     
}

function Vapor()
{
  s = PS.CreateSystem(150, false, dtBackground);
  PS.emitter_creation_mode (s, rmAllways, 0, 1, 2);    
  PS.emitter_set_position (s, ptLine, 1290.0, 244.0, 1440.0, 244.0);
  PS.emitter_set_velocity (s, 10, 20, 278, 282);
  PS.emitter_set_transparency (s, 30, 90);
  PS.emitter_set_age (s, 300, 400);
  PS.emitter_set_sprite (s, 1547, 1550);    
  PS.action_set_bound_box (s, 1250, 0, 1490, 275); 
  
  PS.action_add_force (s, ftRandom, -2.0, 0.0, 2.0, 0.0);
  PS.action_set_transparency_evolution (s, 100, 7);
}

function room_Load()
{
  SetBackgroundFrame(0);
  oLeftDoor.SetView(112);
  oDoorRight.SetView(111);
  oOphidian.SetView(237);
  oOphidian.Animate(0, 2, eRepeat, eNoBlock);
  player.x=1;
  player.y=300;
  Steamy();
  player.ChangeView(11);
  player.SpeechView=12;
  oFoot.Transparency=80;
  
  oCoverUp.Clickable=false;
  oDirt.Visible=false;
  
  Hand=1;
  gTriforce.Visible=true;
  aSteam.Play();
}

function room_AfterFadeIn()
{
  StartCutscene(eSkipESCOnly);
  oLeftDoor.Animate(0, 1, eOnce, eBlock, eForwards);
  player.Walk(210, 340, eBlock, eAnywhere);
  oLeftDoor.Animate(0, 1, eOnce, eNoBlock, eBackwards);
  player.Say("&677 Medea mentioned radiation, so I took the precaution of changing into....");
  player.Walk(440, 340, eBlock, eAnywhere);
  player.Say("&678 IS THAT PHILO?!");
  EndCutscene();
}

function room_Leave()
{
  while (PS.num_systems) PS.DeleteLastSystem();
}

function hFloor_AnyClick()
{
  short TargetY=400;
  if (mouse.Mode==eModePointer) { player.Walk(mouse.x + GetViewportX(), mouse.y, eNoBlock, eWalkableAreas); }
  if (mouse.Mode==eModeCamera) { player.Say("&192 I don't need a picture of this."); }
  if (mouse.Mode==eModeXRay) { player.Say("&306 Not gonna be able to penetrate that with real x-rays, much less a terahertz scanner."); }
  if (mouse.Mode==eModeInternet) { player.Say("&307 It's not precisely an internet ready appliance."); }
  if (mouse.Mode==eModeFlashligh) { player.Say("&308 Running various bandwidths of UV light across the surface to look for either blood or bacteria... and nothing.");  }
  if (player.ActiveInventory==iDirt) {
    TargetY=mouse.y;
    if (TargetY < 270) TargetY=270;
    player.Walk(mouse.x + GetViewportX() + 20, TargetY + 20, eBlock, eWalkableAreas); 
    player.ChangeView(38); //STOOP
    player.Animate(0, 1, eOnce, eBlock, eForwards);    
    player.LoseInventory(iDirt);
    oDirt.X=player.x - 20;
    oDirt.Y=player.y - 20;
    oDirt.Visible=true;
    oDirt.Baseline=5;
    DirtClean=false;
    player.Animate(0, 2, eOnce, eBlock, eBackwards);  //STAND
    player.ChangeView(11);
    cCleaner.StopMoving();
  } 
}

function SavePhilo() 
{
  player.Say("&679 No time. I have to rescue Philo!");
}

function hDirt_AnyClick()
{
  if (!Rescue) SavePhilo();
  else { /********************************/
    if (SpotCount>0 && !Steam) {
      if (!player.HasInventory(iDirt)) { 
        player.Walk(740, 399, eBlock, eWalkableAreas);
        player.FaceLocation(660, 100, eBlock);
        player.ChangeView(38);
        player.Animate(0, 1, eOnce, eBlock, eForwards);
        player.Say("&680 I'll scoop up a handful.");
        player.AddInventory(iDirt);
        Take(1669);
        player.Animate(0, 2, eOnce, eBlock, eBackwards);
        player.ChangeView(11);
      } else { player.Say("&681 I already have some."); }
    } 
    
    if (SpotCount==0 && !Steam)
    {
      player.Say("&682 There's some dirt and debris on the floor.");
    }
    
    if (SpotCount==0 && Steam) 
    {
      player.Say("&683 Whatever it is, it's cold enough to cover me in frost bite, THOUGH THE SUIT!");  
    }
  } /***************************************/
}

function hValve_AnyClick()
{
  if (!Rescue) SavePhilo();
  else { /********************************/
    if (Steam) {
      player.Walk(640, 290, eBlock, eWalkableAreas);
      if (mouse.Mode==eModePointer) player.Say("&684 The valve is freezing cold!  I can't touch even with my suit on.");
      if (mouse.Mode==eModeCamera) { player.Say("&192 I don't need a picture of this."); }
      if (mouse.Mode==eModeXRay) { player.Say("&306 Not gonna be able to penetrate that with real x-rays, much less a terahertz scanner."); }
      if (mouse.Mode==eModeFlashligh) { player.Say("&308 Running various bandwidths of UV light across the surface to look for either blood or bacteria... and nothing.");  }
      if (mouse.Mode==eModeInternet)
      {
        PS.emitter_creation_mode (s, rmNumberOfTimes, 1, 1, 0);
        oFoot.TweenTransparency(0.60, 0, eEaseOutTween, eNoBlockTween);
        Wait(25);
        while (PS.num_systems) PS.DeleteLastSystem();
        cCleaner.ChangeRoom(41, 1440, 360);
        Steam=false;
        aSteam.Stop();
        aFutugreek.Play();
        Gas=true;      
        player.Say("&685 That did it!");
        Vapor();
      }
    } else {
      player.Say("&686 I am *NOT* going to reopen the valve.");
    }
  } /***************************************/
}

function region1_WalksOnto()
{
  if (Steam) {
    player.Walk(600, player.y, eBlock, eWalkableAreas);
    player.Say("&687 I'm *NOT* walking into the freezing exhaust.");
  }
}

function hExhaust_AnyClick()
{
  if (Steam)
  {
    player.Say("&688 Whatever it is, it's cold enough to give me instant frostbite, THOUGH THE SUIT!");    
  } else {
    hFloor_AnyClick();
  }
}

function hTanks_AnyClick()
{
  short Total=4;
  if (CntTanks%Total==0)  player.Say("&689 I have no idea what's in these tanks.");
  if (CntTanks%Total==1)  player.Say("&690 Normally I'd pull up any information I needed on these with my Visor, but now I have an actual Avatar and...  I don't seem to be able to read any more.");
  if (CntTanks%Total==2)  player.Say("&691 I can't read.  I'm illiterate?!  I have a Masters and a PhD, and I'm illiterate?  How much more screwed up can my life get?!");
  if (CntTanks%Total==3)  player.Say("&692 I really shouldn't mess with these unless it's ABSOLUTELY necessary.");
  CntTanks++;
}

function hComputer_AnyClick()
{
  if (!Rescue) SavePhilo();
  else { /********************************/  
    player.Walk(430, 300, eBlock, eWalkableAreas);
    player.FaceLocation(333, 0, eBlock);  
    short Total=5;  
    if (CntComp%Total==0) 
    {
      oSyn.SetView(5, 0, 0);
      oSyn.Visible=true;
      oSyn.Transparency=0;
      oSyn.SetPosition(GetViewportX(), 400);
      aSyn.Play();
      oSyn.Animate(0, 2, eOnce, eBlock, eForwards);
      int x = 0;
      while (x<=100) {
        oSyn.Transparency=x;
        x=x+10;
        Wait(1);
      }
      oSyn.SetPosition(0, 0);
      oSyn.Visible=false;
    }    
    if (CntComp%Total==1) 
    {
      player.Say("&693 With the Avatar installed in my head, the wiring across sections of my brain has created cross-communication where none should exist.");
      player.Say("&694 I think this is how it's manifesting for me.  When I try to read VR text, I get bombarded with other sensations.");
    }
    if (CntComp%Total==2) player.Say("&695 Mixed sensory signals is called synethesia.  It's the most common form of Ludwig's Disease.");
    if (CntComp%Total==3) player.Say("&696 It's impossible for me to read anymore.");
    if (CntComp%Total==4)
    {
      player.Say("&697 I'm illiterate.  I'm freakin' illiterate.");
      player.Say("&698 How screwed up is that?");
    }
    CntComp++;
  } /***************************************/
}

function oPhilo_AnyClick()
{
  if (!Rescue)
  {
    Rescue=true;
    player.Walk(610, 390, eBlock, eWalkableAreas);
    oPhilo.SetView(238, 0, 0);
    oPhilo.Animate(0, 4, eOnce, eNoBlock);
    player.Walk(525, 370, eBlock, eWalkableAreas);
    player.FaceLocation(700, 370, eBlock);
    player.StopMoving();
    player.ChangeView(105);
    oPhilo.Move(320, 390, 2, eNoBlock, eAnywhere);
    player.Walk(325, 370, eBlock, eWalkableAreas);
    oPhilo.Animate(1, 1, eOnce, eNoBlock);
    player.ChangeView(11);
    player.FaceLocation(player.x+200, player.y);
    player.Say("&699 He's missing a foot.");
  } else {
    if (player.ActiveInventory==iRope)
    {
       player.LoseInventory(iRope);
       player.Walk(480, 395, eBlock, eWalkableAreas);
       player.FaceLocation(410, 0, eBlock);
       player.StopMoving();
       player.ChangeView(38);
       player.Animate(0, 1, eOnce, eBlock, eForwards);
       Wait(20);
       oPhilo.Graphic=2345;
       player.Animate(0, 1, eOnce, eBlock, eBackwards);
       player.StopMoving();
       player.ChangeView(11);
       player.Say("&700 That should help.");
       Turniquet=true;  
    } else {
      short Total=4;
      if (CntPhilo%Total==0) player.Say("&701 That leg will eventually... ah... thaw.  When it does he could bleed to death.");
      if (CntPhilo%Total==1) player.Say("&702 The foot froze solid and broke off when I moved him.");
      if (CntPhilo%Total==2) player.Say("&703 At least he's alive.");
      if (CntPhilo%Total==3) player.Say("&704 Well, living with a regenerated limb beats the hell out of dying.");
      CntPhilo++;
    }
  }
}

function oFoot_AnyClick()
{
  short Total=4;
  player.FaceObject(oFoot);
  player.FaceLocation(700, 0);
  if (CntFoot%Total==0) player.Say("&705 It's Philoctetes' foot?!");
  if (CntFoot%Total==1) player.Say("&706 The freezing exhaust, just...  His foot broke off when I moved him.");
  if (CntFoot%Total==2) player.Say("&707 I am not touching that!  There's no point.  And it's really morbid.");
  if (CntFoot%Total==3) player.Say("&708 Losing your foot...  Ugh!");
  CntFoot++;
}

function oOphidian_AnyClick()
{
  hComputer_AnyClick();
}

function oDoorRight_AnyClick()
{
  if (Gas && !OpenDoor) { 
    oDoorRight.Animate(0, 1, eOnce, eBlock, eForwards);
    SetTimer(1, 160);
    OpenDoor=true;
    if (count==1) { 
      StartCutscene(eSkipESCOnly);'
      cHera.Say("There is a boric acid spill on the floor of engineering.");
      player.Say("How hazardous is it?");
      cHera.Say("It's non-toxic to humans, however, it will react violently with the fabric of your suit.");
      player.Say("And leave me vulnerable to radiation?");
      cHera.Say("Assuming you survive when the suit combusts, yes.");
      player.Say("Ah."&709 );
      EndCutscene();
    }
    if (count>1 && count<=3) cHera.Say("Please do not enter engineering.");
    if (count>3) player.Say("Maybe I could get SPOT to clean up the boric acid spill!");
  } else if (!Gas) {
    oDoorRight.Animate(0, 1, eOnce, eBlock, eForwards);
    player.Walk(1335, 250, eBlock, eAnywhere);
    if (Turniquet) 
    {
      oDoorRight.Animate(0, 1, eOnce, eBlock, eBackwards);
      player.ChangeRoom(10);
    } else { 
      player.Walk(1380, 350, eBlock, eAnywhere);
      player.Say("I can't just LEAVE Philoctetes?! There's got to be something I can do for him.");
      oDoorRight.Animate(0, 1, eOnce, eBlock, eBackwards);
    }
  }  
  count++;
}


function room_RepExec()
{
  if (OpenDoor && IsTimerExpired(1) && cCleaner.y>290) {
    OpenDoor=false;
    oDoorRight.Animate(0, 1, eOnce, eBlock, eBackwards);
  }
  
  // Random Cleaner Moving
  if (Gas) 
  {
    if (!cCleaner.Moving && DirtClean) {
      if (cCleaner.x<900) cCleaner.Walk(1240+Random(20), 350+Random(40), eNoBlock, eWalkableAreas);
      else cCleaner.Walk(730+Random(20), 370+Random(40), eNoBlock, eWalkableAreas);
    }
  }
  
  // Send Cleaner After the DIRT!
  if (!cCleaner.Moving && !DirtClean && !Mission) {
    cCleaner.Walk(oDirt.X, oDirt.Y, eNoBlock, eWalkableAreas);
    Mission=true;
    SetTimer(2, 3200);
  }
  
  //Dirt Finally cleaned up
  if (IsTimerExpired(2)) {
    oDirt.Visible=false;
    Mission=false;
    DirtClean=true;
  }
  
  // Cleaner in Engineering
  if (Mission  && OpenDoor && cCleaner.y<290) { 
    cCleaner.Move(1355, 250, eBlock, eWalkableAreas);
    aBlip.Play(); //Need better sound - More R2D2 - panicked little robot noise
    OpenDoor=false;
    Gas=false;
    oDoorRight.Animate(0, 1, eOnce, eBlock, eBackwards);
    oSpill.Visible=false;
    while (PS.num_systems) PS.DeleteLastSystem();
    SetBackgroundFrame(1);
    
    //A FEW MINUTES LATER
    oFewMin.Transparency=100;
    oFewMin.X=100+GetViewportX();
    oFewMin.Y=300;
    oFewMin.TweenTransparency(0.5, 0, eEaseInTween, eBlockTween);
    Wait(40);
    oFewMin.TweenTransparency(0.5, 100, eEaseOutTween, eBlockTween);
    oFewMin.Y=0;
    
    cHera.Say("The boric acid spill has been cleaned.  It is now safe to enter.");
    cCleaner.ChangeRoom(10, 619, 343);
  }
  if (Mission && !OpenDoor && cCleaner.y<290) { 
    aClunk.Play(); //Need better sound
    cCleaner.y=310;
  }
}

function hCoolant_AnyClick()
{  
  if (!Rescue) SavePhilo();
  else { /********************************/
    player.Say("It's the Ophidian Coolant System.  That much is obvious, and I assume it helps with the reactor.  So it's probably bad that it's damaged.");
    player.Say("However, I don't know anything about it.  So, I should use the computer station.");
    player.Say("And be extraordinarily cautious about it.");
  }
}

function region2_Standing()
{
  if (Gas) {
    if (!OpenDoor) { 
      oDoorRight.Animate(0, 1, eOnce, eBlock, eForwards);
      SetTimer(1, 160);
      OpenDoor=true;
    }
    player.Walk(1380, 350, eBlock, eAnywhere);
    player.Say("I really don't need to catch on fire.");
  } /*else {
    if (!Steam && !Turniquet) 
    {
      player.Walk(1380, 350, eBlock, eAnywhere);
      player.Say("I can't just LEAVE Philoctetes?! There's got to be somethimg I can do for him.");
    }    
  }*/
}

function hRupture_AnyClick()
{
  short Total=4;
  if (CntRupt%Total==0) player.Say("That is a serious looking rupture.");
  if (CntRupt%Total==1) player.Say("I'm not a nuclear engineer or anything, but I'm thinking that's the source of the problem.");
  if (CntRupt%Total==2) player.Say("Seriously, though, what happened?  How does a pipe just break like that?");
  if (CntRupt%Total==3) player.Say("How bad is it for the reactor when the cooling system is shut down?!");
  CntRupt++;
}

function hChair_AnyClick()
{
  short Total=4;
  if (CntChair%Total==0) player.Say("It's a chair.");
  if (CntChair%Total==1) player.Say("You sit on it and stuff.");
  if (CntChair%Total==2) player.Say("There's nothing on the chair or under it.");
  if (CntChair%Total==3) player.Say("What is wrong with me that I'm obsessing over a chair?!");
  CntChair++;
}

function hGloveTable_AnyClick()
{
  short Total=4;
  if (CntGloveT%Total==0) player.Say("It's the other work glove.");
  if (CntGloveT%Total==1) player.Say("They're made for working with freezing materials.");
  if (CntGloveT%Total==2) player.Say("If I took it, I would break up the set.");
  if (CntGloveT%Total==3) player.Say("Nah, I'll leave it where it is.");
  CntGloveT++;
}

function hGlovePipe_AnyClick()
{
  short Total=4;
  if (CntGloveP%Total==0) player.Say("There's a work glove stuck on top of that pipe.");
  if (CntGloveP%Total==1) player.Say("That would have been really handy a few minutes ago, but I did ok.");
  if (CntGloveP%Total==2) player.Say("I want to give it high five or something.");
  if (CntGloveP%Total==3) player.Say("Nah, I'll just leave it where it is.");
  CntGloveP++;
}

function hMask_AnyClick()
{
  short Total=4;
  if (CntMask%Total==0) player.Say("That's a full protective face mask.");
  if (CntMask%Total==1) player.Say("Probably part of the rest of the protective gear.");
  if (CntMask%Total==2) player.Say("Just a clear face mask.");
  if (CntMask%Total==3) player.Say("I really don't want it."&710 );
  CntMask++;
}

function hLabCoat_AnyClick()
{
  short Total=4;
  if (CntLabC%Total==0) player.Say("It's a lab coat.");
  if (CntLabC%Total==1) player.Say("It looks like there might be something in the pocket.");
  if (CntLabC%Total==2)
  {
    if (!TakeRope)
    {
      player.Say("Hey, there's a bit of green rope in there.  I think I know where to use this.");
      Take(2355);
      player.AddInventory(iRope);
    } else {
      player.Say("Nope."&711 );
    }
  }
  if (CntLabC%Total==3) player.Say("I'll just leave it where it is.");
  CntLabC++;
}


Clearly everything goes wrong starting with this line 356, but let me be clear, the automatic voice line number added &709 in the wrong spot, not me.  I can clear it out, try again and get the same error.  Whatever happened there threw a monkey wrench into the Auto line numbering and I can't figure out what it is.  Line 334 looks good, as does every line in between.

Any help would be greatly appreciated.

- Cogliostro
#8



Between the Pillars of Creation - GiP Link

I'm looking for three beta testers.  PM if you're interested. 

- Cogliostro
#9

Not sure if anyone else ever commented on this , but I was having issues where my sound files would pick up static.  The static wasn't in the source file or in the edited copy.  Didn't matter if I used WAV or MP3.  Would eventually show up in my music files and became a real problem with short sound files.  (Those less than a second.) 

Upgraded my version of AGS from 3.2.1.111 to 3.3.2 and the problem with static went away.

This isn't a request for help, more of documenting a known problem and fix.

- Cogliostro
#10

Okay, I have a LONG animation sequence, 85 frames long, with a delay of 5.  I'm trying to sync the audio file I created for the animation.  And when I say SYNC I really mean it.  (i.e. Mechanical humming starts from the first frame, amps up at frame 50, and continues to frame 425.  Metal banging begins at frame 290 and completes at frame 380.  You get the idea.)

I'm running into trouble.  I have a total of 425 frames.  I *assumed* 40 frames per second, for a animation length of 10.625 seconds, however, it turns out to be closer to 16 seconds, and I'm hoping someone can tell me the ratio of frame/delay to seconds.

- Cogliostro
#11

Okay, my code works, but it seems "kludged" together and I'm trying to find out if there was a simpler way to pull this off.  Specifically, adding a value to the function that can be automatically passed.

I created a GUI (called gRobotHunt) with 20 buttons that have their text randomly generated - each button being the name of a robot on that level of the ship.  Trying to keep the code clean and I wanted one function to cover all 20 buttons.  This is what I came up with....

Code: ags

Button *NameCheckBtn;
function Button20_OnClick(GUIControl *control, MouseButton button)
{
  //Display("Button #: %d", control.ID);
  NameCheckBtn = gRobotHunt.Controls[control.ID].AsButton;
  if (  NameCheckBtn.Text == "Wall-E" ) {
    Display("You found the right one.  John Lassiter would be pleased.");
  }
  else {
    Display("That's the wrong robot!");
  }
}


All in all, I don't think it's too bad.  But what variable would I add to the function so I could access the button directly, rather than muck about with "NameCheckBtn"?

- Cogliostro

Yeah, I know, it works, and this isn't exactly urgent, but in the interest of furthering my scripting skills, I was hoping someone knew the answer.
#12
A long time ago, in a distant MAGS competition, a game was born.



Musician
I'm looking for two pieces of music.  One for the final battle, and another for the video sequence that ends the game.

PM me if you're interested.
- Cogliostro

I have my musician.
#13
Okay, I created a video in an attempt to shave a 100MB off the download size.  I put the Earth.avi in the main folder with the Game.agf, run the game, and I get an error stating it cannot find the file.  Check the wiki, the AVI files are supposed to go into the COMPILED folder.  Put the AVI in the COMPILED folder, compile the game, run setup, launch the game, and get the same error.

Use VLC Media Player to convert the game from an AVI to an OGG, get the same error.  Regardless of the folder.
Rename the extension to OGV and it works in the main folder.   

    PlayVideo("Earth.ogv", eVideoSkipEscKey, 11); // works
    PlayVideo("Earth.ogg", eVideoSkipEscKey, 11); // failed
    PlayVideo("compiled/Earth.ogg", eVideoSkipEscKey, 11); // failed
    PlayVideo("Earth.avi", eVideoSkipEscKey, 11); // failed
    PlayVideo("compiled/Earth.avi", eVideoSkipEscKey, 11); // failed

I sort of have a solution, since the OGV works and is 99% smaller!!  However, there's serious loss in the video quality. 

Regardless of anything else, where should the AVI files go to get PlayVideo() to work?  Beyond that, is there a better app for converting video?

- Cogliostro
#14
Okay, running AGS 3.2, and I wanted GUI's that reflected the appearance of my game rather than the default game.  So I just created an image and used it as the background for the existing GUI using the same functions -- or nearly so.  The gRestoreGame works okay, but the save, delete, and cancel buttons on gSaveGame don't work at all.  I can type in the name of a game to save and hit ENTER, but clicking on Save accomplishes nothing. 



The buttons are all using blank GIFs without any text.  With the actual graphic being part of the background image, but that doesn't seem to effect anything except this one GUI!  The default GUIs were created for a game set at 320X200, and my game is 634x400, but again that hasn't effected any of the other GUIs.  I did go back and make sure all of the buttons are named the same.  And I even compared the scripting and GUI settings between this game and one using the default GUIs - everything looks the same, it just doesn't work.

Code: ags

function show_save_game_dialog()
{
  gSaveGame.Visible = true;
  // Get the list of save games
  lstSaveGamesList.FillSaveGameList();
  if (lstSaveGamesList.ItemCount > 0)
  {
    // If there is at least one, set the default text
    // to be the first game's name
    txtNewSaveName.Text = lstSaveGamesList.Items[0];
  }
  else
  {
    // No save games yet, default empty text.
    txtNewSaveName.Text = "";
  }
  mouse.UseModeGraphic(eModePointer);
}

function close_save_game_dialog()
{
  gSaveGame.Visible = false;
  mouse.UseModeGraphic(eModePointer);
}


function btnDeleteSave_OnClick(GUIControl *control, MouseButton button)
{
  if (lstSaveGamesList.SelectedIndex >= 0)
  {
    DeleteSaveSlot(lstSaveGamesList.SaveGameSlots[lstSaveGamesList.SelectedIndex]);
    lstSaveGamesList.FillSaveGameList();
  }
}

function btnCancelSave_OnClick(GUIControl *control, MouseButton button)
{
  close_save_game_dialog();
    if (Hand==1) BtnTriforce.Visible=true;  //This brings up a spinning icon used to access all of the menus.
}

function btnSaveGame_OnClick(GUIControl *control, MouseButton button)
{
  int gameSlotToSaveInto = lstSaveGamesList.ItemCount + 1;
  int i = 0;
  while (i < lstSaveGamesList.ItemCount)
  {
    if (lstSaveGamesList.Items[i] == txtNewSaveName.Text)
    {
      gameSlotToSaveInto = lstSaveGamesList.SaveGameSlots[i];
    }
    i++;
  }
  SaveGameSlot(gameSlotToSaveInto, txtNewSaveName.Text);
  close_save_game_dialog();
    if (Hand==1) BtnTriforce.Visible=true;
}


function txtNewSaveName_OnActivate(GUIControl *control)
{
  // Pressing return in the text box simulates clicking the Save button
  btnSaveGame_OnClick(control, eMouseLeft);
}


And since this could be important, here are the settings I used for the buttons on gSaveGame.

GUI: gSaveGame:
Button Name: btnSaveGame
Action: RunScript
OnClick: btnSaveGame_OnClick

GUI: gSaveGame:
Button Name: btnDeleteSave
Action: RunScript
OnClick: btnDeleteSave_OnClick

GUI: gSaveGame:
Button Name: btnCancelSave
Action: RunScript
OnClick: btnCancelSave_OnClick

GUI: gSaveGame:
Text Box: txtNewSaveName
OnClick: txtNewSaveName_OnActivate

**ANY** suggestions about where to look for the trouble? 

- Cogliostro

p.s.  Wow!  Am I rambling and incoherent while posting this.
#15
Okay, the idea is this, when you click on an object it calls a function and generates different results based on the ID of the object. 

IN THIS CASE, I have 10 buttons (all objects) on screen, when you click it, a different object briefly becomes transparent.  (i.e. Click on Object[10] and Object[0] briefly appears.)

Is there a more elegant way to do this - presumably using EXTENDER FUNCTIONS - or am I reduced

Code: ags

function Syn (short value) {
  object[value].TweenTransparency(0.5, 0, eEaseInTween, eBlockTween);
  object[value].TweenTransparency(0.5, 100, eEaseOutTween, eBlockTween);
}

function oBut0_AnyClick() //Object 10;
{
  Syn(0);
}

function oBut1_AnyClick() //Object 11;
{
  Syn(1);
}

//et cetera...


- Cogliostro
#16
This particular module was created by Miguel García Díaz (Jerakeen), and was difficult for me to find, so I thought I would repost it.  I also _slightly_ updated the module so it will run on current version of AGS and created ptCharPosition to be used with PS.emitter_set_position so that an effect can follow the player around the screen.

Particle System Manager

One side note, I ran into a problem when using the PSM to draw smoke (or whatever) on the background.  When you are doing this neither SetBackgroundFrame(x) nor object(x).MergeIntoBackground will work.  Understandable in hindsight, but it gave me a headache when I ran into it and I thought I would forewarn everyone.

- Cogliostro

EDIT - I originally made the changes in the DEMO but not the actual SCM file.  That oversight has been corrected, and the SCM file works with the current versions of AGS.
#17

Spoiler

Made it into Delano's room.  Got the suitcase open but still cannot escape the room.  So, I assume I have to get the safe open.  I tried every # on his driver's license, and every combination I imagined could be hidden in the knick-knacks.  Safe is still locked tight.  What am I missing?
[close]

- Cogliostro
#18
Okay, going a bit bonkers here.  Created an ENUM, built an array with it, "Displayed" the contents, and it all shows up pretty as a picture.  Then I move the ENUM and ARRAY to Global Script and try to write all of the exact same text into a GUI Label, and I get an error: "One of the String arguments supplied was not a string."  If I eliminate the string it works, so *most* of the code it valid, but how do I get it to display the name?!

Code: ags

//Global Script.ash
struct Place {
  String Name;
  int ID;
  int CurRoom;
  int Order;
  int PosX;
  int PosY;
  int ObjNum;
};
      
Place Details[11]



THIS CODE WORKS!
Code: ags

function ShowOff() {
    Display("Name: %s[ID: %d[PosX: %d[PosY: %d[Room: %d",
      Details[DetailProp].Name,
      Details[DetailProp].ID, 
      Details[DetailProp].PosX, 
      Details[DetailProp].PosY, 
      Details[DetailProp].CurRoom);
}


But this code generates the error?!  What's the difference?!
Code: ags

//Room Script
function room_Load()
{
  lProp.Text=String.Format("Name: %s[ID: %d[PosX: %d[PosY: %d[Room: %d",
      Details[DetailProp].Name,
      Details[DetailProp].ID, 
      Details[DetailProp].PosX, 
      Details[DetailProp].PosY, 
      Details[DetailProp].CurRoom);


Any help would be appreciated,
- Cogliostro


Edit by Andail: fixed code tags.
#19
Hints & Tips / Skumring
Tue 30/04/2013 13:09:51
I'm 77% of the way through the Skumring and...

Spoiler

I'm back at the art gallery.  Spoke to everyone: Kongo, kid, actress, and the "gray man". 
I've shown the photograph to Kongo and established that he knows him.
What do I do next?
[close]

- Cogliostro
#20
I came up with a clever idea, and after a quick search, discovered it had first been posted nine years ago by Pumaman himself -- how to easily do a spell check in AGS.

Short explanation for SPELL CHECKING
1) Create a translation file.
2) Export it into MS Word, or whatever spell checker you want to use.
3) Find each typo in MS Word, switch back to AGS, do a "FIND" in "CURRENT PROJECT" for that typo and fix it.
4) Repeat step 3 until all of the typos are gone.

On the same note...

Short explanation for LANGUAGE TRANSLATION
1) Create a translation file.
2) Open it up and paste the results into Column A in EXCEL
3) Copy those lines into the Google Translator
4) Paste those results from Google into Excel in Column B, but shift down one cell.
5) In column C copy the results from the first two columns
    i.e.   [Cell C1]=A1, [Cell C2]=B2, et cetera.
6) Copy the results from Column C back into the Translation file.
7) Save.

Thought I'd bring it to the attention of those who hadn't thought of it yet.

- Cogliostro

EDIT: I just posted this to the wrong forum, could one of the moderators move it?
SMF spam blocked by CleanTalk