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

#681
By letters I assume you mean in the Lip Sync editor, where you provide multiple letters (A/F/R/...) for a frame?
Doesn't work for Lucasarts games. Just plays the whole set of frames, over and over.

I've read the manual.

"Skip the box that will get the most letters, then enter that number as default in the properties." - what does this mean?
#682
Hi all
I've recently been playing with lip-sync in the latest AGS (3.4.0). I've heard that Lucasarts style games (the one I also used in my game) don't support lip sync; or that they support 2 frames; or vowels are frame 0... or something :/
I've also tried Lipsync Centre here, but it's very complex. It appears to add Pamela/.PAM file to Lucasarts games; but will only play them (in the portrait) of Sierra style games. Eg. the player character just does same animation over and over, but portrait animation chooses frames based on phonemes.

Also: when I choose "Type: Text (automatic)" in the lip-sync Properties box; is this automatically lip-synced to audio, or not lip-synced and runs continuously, or...? In Lucasarts, it just runs continuisly.

Basically I just can't find any information on speech lip-sync. Is there any way to get into Lucasarts games?
Existing plugins or scripts? All except Lipsync Centre are broken links.
Some tried a true method I haven't discovered yet?

Please help.
#683
SOLVED

The first line of UpdateMouseGraphic() is
  if (player.ActiveInventory != null) return;
It should be:
  if (mouse.Mode==eModeUseinv) return;

Otherwise, after someone picks an object out of the inventory, all cursors are frozen/

I didn't *show* these pieces of UpdateMouseGraphic(), which is why no-ones worked it out (or, you know, didn't care :P)

Won't ever steal a bit of code from here without knowing what every line does :P
#684
Hello all

Having a problem with a bug - in my code, or in the AGS interpretor?

in globalscript, in function UpdateMouseGraphic:

Code: ags

...
else if (mouse.Mode==eModeLookat) {
    newGraphic=105; //eye close
    if (lt == eLocationHotspot) {
      Hotspot *hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      if (hs != hotspot[0]) {
        if (hs.GetProperty("hidden")==false) { 
            newGraphic=2056;  //eye open
        }
      }
    }
  }
  else if (mouse.Mode==eModeInteract) {
    newGraphic = 2;  //interact off
    Hotspot *hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
    if (hs != hotspot[0]) {
      if (hs.GetProperty("hidden")==false) {
        newGraphic=286;
      }
    }
    if (lt == eLocationObject) {
      newGraphic=286;
    }
  }  
...


also in globalscript:

Code: ags

function Candlelight_on (Object *obj, InventoryItem *Inv) {
  if (!cJulius.HasInventory(Inv)) {

    obj.Visible=true;
    obj.Clickable=true;

    if ((mouse.x - obj.X) >= 0) {
      if ((mouse.y - obj.Y) >=0) {
        trans = (( (mouse.x - obj.X) + (mouse.y - obj.Y) ) /2);
      } else
      if ((mouse.y - obj.Y) <=0){
        trans = (( (mouse.x - obj.X) - (mouse.y - obj.Y) ) /2);
      }
    } else
    if ((mouse.x - obj.X) <= 0){
      if ((mouse.y - obj.Y) >= 0){
        trans = (( (mouse.x - obj.X) - (mouse.y - obj.Y) ) /2);
      } else
      if ((mouse.y - obj.Y) <= 0){
        trans = (( (mouse.x - obj.X) + (mouse.y - obj.Y) ) /2);
      }
    }
  

    if (trans<0) {
      trans=trans*-1;
    }
    if (trans>100) {
      trans=100;
    }
    
    obj.Transparency=trans;
  }
   
}


and in room 28:

Code: ags

function room_RepExec()
{

  if (CandleLit==true) { 

    Interdimensional_Candle();
    
    Candlelight_on(oGoldCoin1, iWoodCoin1);
    Candlelight_on(oGoldIngot, iGoldBrick);
    Candlelight_on(oGoldPen, iGoldPen);
    
    if (!cJulius.HasInventory(iGoldPen)) {
      hGoldPen.SetProperty("hidden",false);
    }
    if (!cJulius.HasInventory(iWoodCoin1)) {
      hGoldCoin.SetProperty("hidden",false);
    }
    
    if (SafeOpen==true){
      
      DynamicSprite *sprite = DynamicSprite.CreateFromExistingSprite(137, true);  //safe closed
      DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
 
      sprite.Crop(mouse.x-65, mouse.y-65, 240, 240);
      sprite.CopyTransparencyMask(444);
  
      surface.DrawImage(mouse.x-65, mouse.y-65, sprite.Graphic, 20);
      
      surface.DrawImage(0, 0, 486, 90);            //safe closed
      surface.Release();
      sprite.Delete();
      

    } else {
      DynamicSprite *sprite = DynamicSprite.CreateFromExistingSprite(169, true);  //safe open
      DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
      
      sprite.Crop(mouse.x-65, mouse.y-65, 240, 240);
      sprite.CopyTransparencyMask(444);
      
      surface.DrawImage(mouse.x-65, mouse.y-65, sprite.Graphic, 20);

      surface.DrawImage(0, 0, 487, 90);            //safe open
      
      surface.Release();
      sprite.Delete();
    
    }
    
  } else {
    
    
    if (SafeOpen==true){
      DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
      surface.DrawImage(0, 0, 486, 0);            //safe open
      surface.Release();
    } else {
      DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
      surface.DrawImage(0, 0, 487, 0);            //safe closed
      surface.Release();
    }
    
    
    hGoldPen.SetProperty("hidden",true);
    hGoldCoin.SetProperty("hidden",true);
    
    oGoldCoin1.Visible=false;
    oGoldIngot.Visible=false;
    oGoldPen.Visible=false;
  }
}



function oGoldIngot_Interact()
{
  if (CandleLit && !cJulius.HasInventory(iGoldBrick)) {
    cJulius.Walk(626, 595, eBlock, eWalkableAreas);
    cJulius.Phylactere("A gold brick! Well, a gold ingot.");
    cJulius.Phylactere("It's yellow reminds me off summer eggs...");
    cJulius.AddInventory(iGoldBrick);
    oGoldIngot.Visible=false;
  }
}


function hGoldPen_Interact()
{
  if (CandleLit && !cJulius.HasInventory(iGoldPen)) {
    cJulius.Walk(355, 650, eBlock, eWalkableAreas);
    cJulius.Phylactere("A gold pen - gee, whoever lived here didn't really care about their fine stuff.");
    cJulius.AddInventory(iGoldPen);
    oGoldPen.Visible=false;
  }
}

function hGoldCoin_Interact()
{
  if (CandleLit && !cJulius.HasInventory(iWoodCoin1)) { 
    cJulius.Walk(353, 646, eBlock, eWalkableAreas);
    cJulius.Phylactere("A gold coin!");
    cJulius.AddInventory(iWoodCoin1);
    oGoldCoin1.Visible=false;
  }
}


"hidden" is a special field in Properties of hotspots is set to =true on oGoldCoin1 and oGoldPen.

The aim of this code is: when the candle is lit (CandleLit), hidden parts of the room appear.
The Candlelight_On function is to set transparancy equal to the proximity of the flame - when close they're visible, when far away they're are progressively more transparent until becoming invisble.

There are hotspets set over the oGoldCoin1 and oGoldPen, set initially to hidden=true. They are there so the person can click on the objects, as there's a time-limit to the candle, and they wouldn't be able to hit the 'pixel perfect' crosshair otherwise.

The UpdateMouseGraphic() function is passed on from repeatedly_execute() in globalscript; icons change to viewable, interact-able, etc when mouse is over them.

The behaviour is that the 'eyes' (look at) icon and 'hand' (interact) are not activated during when CandleLit is off; but they AREN'T when CandleLit is on -- when they SHOULD be, as the "hidden" objects are now visible.
Worse, after CandleLit comes off, the behaviour freezes - hand and eye no longer react to (other) hotspots after this, and eye is premenantly open, no matter where it is.

Is this an insanely difficult bug (which perhaps someone can solve and save me another 3 days of agony), or just a bug in the interpretor?

Happy to provide any and all information if needed. Thanks! :)
#685
It works, thankyou :D
#686
How do I do this?
Tring to find the player character so they are ignored when Looking at them.
#687
Hello all

I've set a custom propery for hHotspot5, in room 2. I have a function in globalscript which checks the mouse cursor, and updates it due to it's location.
I have a custom property for hotspots called "hidden", which is a bool; on one hidden hotspot, I've made it true - all others false.

Code: ags

function UpdateMouseGraphic ()
{
  int newGraphic;
  int lt = GetLocationType(mouse.x, mouse.y);
  [b]bool hidden = hotspot[4].GetProperty("hidden");[/b]

  if (player.ActiveInventory != null) return;

  if (mouse.Mode==eModeWalkto) {
    newGraphic=2054;
  }
  else if (mouse.Mode==eModeLookat) {
    newGraphic=105; //eye closed
    [b]if (lt == eLocationHotspot) {
      if (hidden==false) {
        newGraphic=2056;    //eye open
      }[/b]
    }
  }
  else if (mouse.Mode==eModeInteract) {
    newGraphic = 286;  //interact
    if (lt == eLocationObject) {
      newGraphic = 2;
    }
  }  
  else if (mouse.Mode==eModeTalkto) {
    newGraphic = 2058;  //talk
    if (lt == eLocationCharacter) {
      newGraphic = 213;
    }
  } else {
    
  }

  if (newGraphic != mouse.GetModeGraphic(mouse.Mode)) {
    mouse.ChangeModeGraphic(mouse.Mode, newGraphic);
  }
}


The bolded lines are the ones of interest.
I want the eye to be open when over a not-hidden hotspot; and closed not over a hotspot, OR a hidden one.
I've tried both hotspot[5] and hotspot[4] (zero index); neither works. Is the correct way to acces them, for the current room? How does it handle different rooms?

On hotspot[4], it seems to work, but the eye opens on hidden=true hotspots.
On hotspot[5], all hotspots are =true, so the eyes never open.

What am I doing wrong?
#688
Hi

Been looking at character.Tint (tints a character), object.Tint (tints an object), and the game.SetAmbientTint (both characters and objects).

But is there a way to tint the *whole room background*? Even if it requires CreateDrawingSurfaceFromBackground, DrawImage, etc. that involve you drawing on to the background.

Or should I just make tinted versions of each background in Photoshop, then draw them on to the standard background?
#689
Thankyou, I'll put these into play :)

Basically what I'm asking is - how do I turn the game folder into an installed folder?
I only figured it out through trial and error. Is there a 'build final exe' option? Doesn't seem to be - or any documentation on how to 'install' your final game.
#690
Hi

I can get a game running with only the game folder, and the .exe in Debug/
But what about getting it running on Linux?

Why are there two speech .vox's of different sizes?
Why is the Debug/ .exe expected in the root directory but isn't?
Is the Linux one?
I can delete everything in Speech, but not AudioCache/ - why?
Can I delete all room data?
Is there an option to put all music, speech, rooms and other info into the .exe file?
What is the 'Datafile' format?

etc etc etc etc :P
#691
Does SetGameOption have to be in room script, global script, or global header?

Thankyou btw, it's all becoming much clearer :)
#692
I would like to crossfade, and I've spent 10hours trying to figure it out :/

Imagine, your room 1, where the game starts:

Code: ags

chan1 = global variable, audiochannel

room 1
function room_Load() {
  if (chan1==null) {        //this is the first time we've entered this first room
    play a track;           //setting volume etc. correctly
  }else{
    fadeout any track that's playing    //say, <room 2's track>
    wait 1 second
    fadein <room 1's track>
  }
}



That's it. That's all I need to do - but I've written 15 pages of code over many hours, and I can't get it. There's no howto, there's no Tween howto :(
Please, please show me how to achieve the above, with Global variable, GlobalScript definitions etc. Please :|


ps. tried your example below Snarky, and it's all good except I can't make trackToPlay a variable - not global (because god knows?), or defined in GlobalScript header (also no idea), or local (because the GlobalScript needs it). If you want to update that example, please be very specific about where these functions are.

pps. noticed that 'Sounds' and 'Music' seem to be on different channels/systems? They're the *only* examples of TweenFadeIn/TweenFadeOut that actually work.
#693
Following on, I'm now having a problem with hidden objects.

I try the code:

Code: ags


  if (CandleLit==true) {
    oMcguffin.Visible=true;
    oMcguffin.Transparency=90;
    //100 = invisible

    trans=(100 - ((oMcguffin.X) - mouse.x)/(oMcguffin.Y - mouse.y));

    if (trans<0) {
      trans=0;
    }
    if (trans>100) {
      trans=100;
    }
    oMcguffin.Transparency=trans;
  } else {
    oMcguffin.Visible=false;
  }


This take an object mcguffin. When the candle is lit, the hidden background is revealed; the object has a level of transparancy so it will only be completely visible when the mouse is over it -- and invisible (or barely) when the mouse cursor moves 100px away.

I'm still having a few problems:
-Is the division of (oMcguffin.X) - mouse.x) by (oMcguffin.Y - mouse.y) the correct way to get this effect? It seems to be, but there might be something simpler. Beacause there are 2 values instead of 1, my brain just stopped, and this was all I could come up with.
-When the mouse is right on centre of the mcguffin, there's a divde by zero error; I've tried adding 1 to mcguffin.x, but it still happens. How do I solve this? Inttofloat also doesn't work.
-How do I make transparancy 'slower'? With this calculation, 1px is 1% transparency, so it seems to dissapear almost instantly. Divide equation by 2, or....???

While I'm at it - is there a function besides Dislplay which I can use for debugging? The function is fine, but since it's blocking, you have to click *every time* to update whatever info it's showing like Display("transparency =",%d);
#694
Hi everyone

I've already picked up on how to play a tune with AudioChannel (where chan1 is a global variable *AudioChannel type):

Code: ags

chan1 = aMusic.Play();


The music keeps playing between rooms, unless I use Game.StopAudio()

But when I have different tracks for 2 rooms, How do I fade out one, and fade-in the next? I've tried the following:

Code: ags

chan1 = aMusic-1.Play(eAudioPriorityNormal, eRepeat);

if (chan1.IsPlaying==true){
  for (int x=1; chan1.Volume<=0; x++){
    chan1.Volume=chan1.Volume-1;
  }
}

chan1 = aMusic-2.Play(eAudioPriorityNormal, eRepeat);


But doesn't work.

Is this correct syntax?

Is it reducing the volume so quickly I don't even here it before the Music-2 plays?

Also: is there a function to find out what an AudioChannel* is playing, AND THE NAME of what it's playing?
#696
Only one problem:

Can't get a circle shaped window to the 'hidden' room to work, only a square one.
Help?
#697
Eureka!

Useful for anyone else trying to do the same thing:

Code: ags

function room_RepExec()
{
  DynamicSprite *sprite = DynamicSprite.CreateFromExistingSprite(442, true);       //dynamic sprite that has the room background + changes (visible to, eg., a blacklight)
  sprite.Crop(mouse.x-65, mouse.y-65, 120, 120);                                   //have a small 120x120 square of the background, at mouse x,y (+/- some things to centre in cursor image)
      
  DrawingSurface *surface =Room.GetDrawingSurfaceForBackground();                  //get a drawing surface from the current room

  surface.DrawImage(mouse.x-65, mouse.y-65, sprite.Graphic, 20);                   //draw this sprite graphic ('room b/g with changes') at the current mouse x,y

  surface.DrawImage(0, 0, 441, 90);                                                //draw an image of the room (without changes) on-top

  surface.Release();      //destroy
  sprite.Delete();
}


Try it out and tell me if this works for you too...
#698
My room is called 'beach'.

Code: ags

function room_RepExec()
{
   DrawingSurface *bg0 = Room.GetDrawingSurfaceForBackground();
 
   bg0.DrawImage(0, 0, 437, 0);             //beach, no changes
  
   bg0.DrawingColor = 965;                  //(colour doesn't matter, just tinges circle with green)
   bg0.DrawCircle(mouse.x, mouse.y, 100);   //draw a circle
  
   bg0.DrawImage(0, 0, 436, 90);            //beach, some changes
  
   bg0.Release();                           //release
} 


OUTSIDE the circle: 'beach' background (solid), 'beach some changes' background almost totally transparent, still slightly visible.
INSIDE the circle: 'beach' is totally invisible, and 'beach with changes' is totally opaque. The circle makes the difference a lot more obvious.


But how do I make 'beach with changes' completely invisible OUTSIDE the circle? Why can't I have what's inside the circle -- but the opposite?

How does this thing even work?

This has taken me allm day: please help.
#699
I've been looking at the DrawingSurface functions such as:

DrawingSurface.DrawingColor property
DrawingSurface.DrawCircle
DrawingSurface.DrawImage
DrawingSurface.DrawSurface
etc.

I almost have in my head the solution to my problem, but can't quite bring it together - perhaps somone might know the answer?


Problem:

I want to draw a circle, at position x,y, of one background image; on to the main background image.
example: There are two background images - 1 and 2 - same size, with a 1-to-1 relationship to eachother. I want to take a circle of background 1 (at say, the mouse x,y at that given moment), and copy it to (or 'project it on') background 2. This way, wherever the mouse goes, the user will see a small circle of the 'hidden' image.

(This is similar to the 'tunnel of love' scene in Sam and Max Hit The Road - if anyone knows it - where using the blacklight torch allows you to see through the background to another, hidden background)



In the above image, there is a $20 note, with it's main 'background' (of green and white) on it; and another (hidden) 'background' of purple, revealing a hidden object (magnetic stripe).


Solution:

DrawingColor property can be set to 'COLOR_TRANSPARENT', allowing transparency to be drawn on to the surface - but what's behind it? The 2nd frame of background? Or....?
DrawCircle let's me draw a filled circle shape, at position x,y, with the DrawingColour (COLOR_TRANSPARENT), on the background - but how does it relate to the 2nd background?
DrawImage allows me to draw an image sprite on to the background, but only a single sprite;
DrawSurface allows me to set one image, with certain amount of transparancy, on top of another; but a circle of it? A piece of it? Maybe, probably not...

Solution: not found.

What should I do, AGS community?

SMF spam blocked by CleanTalk