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

#121
Hi
I've been trying to select objects, but if they're quite small, I can't do it. Take for example a key, whose spine is very thin; I can only select with the mouse pixel-perfect, and it takes ages. I've thought of a solution to this (compare mouse cursor to a range), but can't figure out how to implement it. Also I've though of surrounding the graphic with a colour one shade above transparent (very difficult, always comes out white, no idea how to use transparency), and attach a small 10x10 pixel object the mouse x,y, and check whether it's colliding with anything (also no idea how to do this, having a general object in Global mode).

Can anyone help? Has anyone had this pesky problem before? I imagine so but can't find any solutions to it.
#122
Hi there,
Been playing with animation. I want to have a background character:
1. choose a random number
2. choose animation based on number
3. play the animation, NO blocking; so it plays in the background
4. while it's animating, don't allow the routine to choose another animation.

Code for this is:
Code: ags

function room_RepExec()
{
	if (cPig.Animating==false) {
		PigRandAnim=Random(2);
		if (PigRandAnim==1) {	//idle
			cPig.LockView(53);
			cPig.Animate(1, 1, eOnce, eNoBlock);
			cPig.UnlockView();
			Display("finished normal view");
		} else if (PigRandAnim==2) {	//drinking
			cPig.LockView(5);
			cPig.Animate(1, 1, eOnce, eNoBlock);
			cPig.UnlockView();
			Display("finished drinking view");
		}
	}
}


But this doesn't work - I just get constant reminders that "finished <something> view", the animation doesn't actually occur.

If I do eBlocking, everything works fine; but I can't do anything since this isn't happening in the background, and stops everything else.

IdleView and NormalView are set. I've tried with MovementLinkedToAnimation as true and false, no dice.

I feel like this has something to do with NormalView showing only frame 0 if not moving (character never moves); but I can't get my head around it. Maybe you can help?

#123
Hi,

I recently discovered Overlays for writing text on screen. However, they only go for a few secnods, and cause a runtime error. So:

for (...) {
    set an overlay
}

Presumably this writes it every frame and then overflows; but how can be done any other way? If I want to display a timer, or a variable, do I always have to add "if (value has changed) { draw an overlay }" ?
#124
Or is there only one inventory?

I'm trying to do something in the game where the player character's inventory is has no items - it gets stolen - and then returned.

Should I use another character's inventory?
How do I display it in gInventory.Visible?
Should I do this, or just make another identical gInventory GUI without the inventory "window" (invCustomInv) in it?
#125
I'm just wondering if this property applie to anything other than Characters? How would I artifically/scripting this solution?
#126
Please see video: http://redrom.ltd/img/ice_video_20170611-130152.webm

Why is the second part happing, when the main character picks the croissant off the floor?
It's supposed to:
-walk down the screen to a predefine point
-oustretch arm
-croissant is gone

What actually happens
-slides down screen, repeatedly going the outstrething arm animation
-stops, does the animation again
-croissant is gone

I've tried two different walkable areas -- straight down the side, and jagged -- but it still happens.
Here's the code:

Code: ags

function oFishBowl_Interact()
{
	cJulius.Walk(472, 476, eBlock, eWalkableAreas);
	cJulius.Phylactere("How am I making room for all these objects?");
	cJulius.Animate(8, 0, eOnce, eBlock);			//high pickup left
	cJulius.AddInventory(iFishEye, 0);
	oFishBowl.Visible=false;
}

function oFishBowl_Look()
{
  cJulius.Phylactere("A lens which is home to a fish.");
}


function oCroissant_Interact()
{
	cJulius.Walk(315, 719, eBlock, eWalkableAreas);
	cJulius.Animate(8, 0, eOnce, eBlock);			//high pickup left
	cJulius.AddInventory(iCroissant, 0);
	oCroissant.Visible=false;
}

function oCroissant_Look()
{
	cJulius.Phylactere("Delicious.");
}


Both the first (fishbowl) and second part (croissant) are the same; but they have two different results.

It happens sometimes in other situations, but ALL the time in the one shown in this video.

I've moved the location of the main character, but it stil happens.
#127
Hi,

I have a GUI with the icon bar in it; the bExit button runs a script, which, from the other buttons, I assume is bExit_Click:

Code: ags

...
function btnIconSave_Click(GUIControl *control, MouseButton button) 
{
  show_save_game_dialog();
}

function btnIconLoad_Click(GUIControl *control, MouseButton button) 
{
  show_restore_game_dialog();
}

function bExit_Click(GUIControl *control, MouseButton button)
{
  QuitGame(1);
}
...


This is all in globalscript.

This is the *only* button that doesn't work - clicking it just make the iconbar invisible.
All other *exactly the same buttons* work.

I've tried using breakpoints next to the 'QuitGame(1)', and it never reaches it.

What do I do?

#128
I've added a few loops for my main character, taking up loops 8 and 9, and notice when it plays, it's much slower than walking animations (DLY=0?).

When I speed it up (by changing DLY delay below each and every tedious frame), it stutters in parts and animates slowly, then quickly. It always stutters in the same part: but *every* frames is set to -7 delay (I have 30-40 frame animations, -7 works well for AnimationSpeed).

-Why is loops upward from 7 not controlled by AnimationSpeed? (currently -7)
-Why does loops like this stutter?
-Do I need to adjust DLY on every frame, or is there another way/function?

Any help would be greatly appreciated :)

edit: it had not every frame to -7, one was 0, one was 7.
#129
Hi

I'm trying to see if there a way to:
-instantly scroll to the bottom of inventory icons, each time the window is displayed; OR
-reverse the order of inventory icons, so that new ones appear at the top of the list

This would have to happen automatically; it would show the recently added objects, each time you open the inventory.
#130
Hi
Does anyone know if this is possible?
I have a character whose movement loops are 0-7: up, down, left, right, up-left, up-right etc.
But I want to change his view, in some rooms, to the 'old' version of him, and have him move like this: using keys or mouse, he walks around as before, but the movement loops are different (loop 8-15?)

Is it possible to have a character move in a second set of loops, without dynamic change of every single frame in the current sets?
#131
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.
#132
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! :)
#133
How do I do this?
Tring to find the player character so they are ignored when Looking at them.
#134
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?
#135
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?
#136
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
#137
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?
#138
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