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

#61
I've noticed the following weird behaviour.

My sprite has a wide area under him:



...so to make him walk back and forth on the path set out, I need to either:
a) export, change, and re-import all the masks for every room (not happening, too complex, will take 3 months, plus I have to resize paths with continuous scaling, and just editing a mask .bmp is paint.net or paint.exe results in it saving wrong)
OR
b) make his z coords good for "lowering" him to the path

I've already come up with an equation which seems to work 100% of the time depending on his scaling:

cJulius.z = 0 - ( FloatToInt( (Z_FACT / 100.0) * IntToFloat(cJulius.Scaling), eRoundDown ) );

Where cJulius is my sprite
Z_FACT is a floating point constant of 72.0 (about the distance his feet are from the bottom of his frame, 72pixels)

The final result for cJulius.z is always a negative number.

I have a usual interact function: walk to object, face object, say something, pickup object (play an animation of him bending down to get it).
The pickup animation is the same size exactly as the standard walk animations; it goes seemlesly.

HOWEVER

When I have a .Walk() anywhere near to the .PickupUp() animation, it 'resets' itself after I've done this --  in other words, it seems to jump a random amount in height, for no known reason:
https://bluekeystudios.com/img/julius reset.webm

When I take out the walking line, no reset:
https://bluekeystudios.com/img/julius no reset.webm

The code is:

Code: ags

function oWallet_Interact()
{
cJulius.Walk(587, 396, eBlock, eWalkableAreas);    <-- THIS LINE CAUSES RESET; if I comment it out, no reset occurs.
cJulius.FaceObject(oWallet);
cJulius.SayBubble("My wallet! Something survived the time-travel. Oh... it's got all the money missing.");
cJulius.PickUp(eLow, iWallet, oWallet, false, 8, player.Room);
}



Also, here's the .PickUp() code:

Code: ags

function PickUp (this Character*, PickUpHeight height, InventoryItem *i, Object *o, bool visibility, int obj, int room)
{
 
int _loop_down=0;
int _loop_up=0;
 
if (height == eLow) {
_loop_down=138; //low
_loop_up=140;
}
... //other heights, this just sets the view number for the pickup down, pickup up views
 
int cur_loop=this.Loop;

this.LockView(_loop_down);
this.Animate(cur_loop, 1, eOnce, eBlock);
this.UnlockView();

this.AddInventory(i);
o.Visible = visibility;

this.LockView(_loop_up);
this.Animate(cur_loop, 1, eOnce, eBlock);
this.UnlockView();

}



Now - obvious questions:

Have you tried setting Julius' loop to the same each time, even when you don't include the .FaceObject() function call? Yes - still happens.
Have you tried peppering Wait(1); between each line of code, and the .PickUp animation code? Yes - still happens.
Have you created a new room, with all the same objects, paths, masks and scaling, and see if it does this still? Yes - still happens.
Have you tried making a generic room with only the Walk,Speak,Pickup code in it? Yes - still happens.
Have you tried deleting the line to do with the .FaceObject() function, so it's walk,speak,pickup; or for that matter walk,pickup; or walk/wait/speak/wait/pickup; or walk,wait,pickup; or...? Yes - still happens as long as .Walk() is there.
What about when Julius walks to an object by guidance of the mouse, not a Walk() command It works when I send him to a point, but not the command .Walk(). However, don't really see how I can get rid of this.
Is the .z variable the same before, after and during? Yes, tested thoroughly, but .z is miss-set when I pickup something, as opposed to the clone rooms. When set .z based on scaling alone eg. if .scaling=5 then .z=-16 or whatevs -- it sets the .z different to other rooms, and the 'reset' still happens. However, the .z it's set to is always the same mis-set number.
What's the function for the setting Julius' .z variable?

Code: ags

function repeatedly_execute()
{
cJulius.z = 0 - ( FloatToInt( (Z_FACT / 100.0) * IntToFloat(cJulius.Scaling), eRoundDown ) );
....
}


Have you tried writing it walk/say/nothing You mean leave out the PickUp() animation? Or the .SayBubble()? It still does the reset wherever there's a Walk() command.
Is it something to do with the .SpeechBubble() code? Perhaps - I've got 0.8 but made a few minor changes to integrate it. Anyone wanting to see it I'll PM it to.

Am I missing something here? Does walk always do this, reset graphics somehow? Does walk() do something which the standard code for getting a character to walk somewhere based on a mouse-click in eModeWalk doesn't?
Am I insane, or as usual overthinking?

Plz help :(
#62
Code: ags
function getZFactor()
{
  int x=0;
  int scale=player.Scaling;
  
  if (scale==0) {
    return 0;
  } else {
    switch (scale) {
      1:    x=0; break;
      2:    x=-1; break;
      3:    x=-2; break;
...


"GlobalScript.asc(6): Error (line 6): Invalid keyword '1' in switch statement block"

But... switch *only* takes integers?? So....?
Completely confuzzled.
#63
You set a max/min-volume for a position; the closer the player character gets to this position, the higher the volume is; and the further away is a downshift in volume.

Does anyone know if a sound function like this exists? I seem to remember seeing something like it a couple of years ago, but not sure where it is or exactly what it entails.

And 99% of you will say 'check tween', but do you know if anything like this exists in AGS?
#64
Hi, just wondered something I could know by looking at the code for 4 hours, but this is quicker... :P

Why does it take so long to save the game when new images are imported? Does it have to: open the compressed image file (long time at 3.5GB); save the new images; index them all again; close the compressed file,
OR
Does it use a custom technique for saving and indexing sprites which is O(n^2) for time, so time increases exponentially with the number of sprites,
OR
Some other reason.

??
#65
As title says - every ICO file I try results in an error 'cannot use this file as a custom icon file' or thereabouts.
Then there's Axialis IconGenerator - except that either doesn't, or I can't find how, you take an image of your own, open it, and save is an ICO. Seriously, no way out - unless I want to use a New File icon as my games icon :/
Anyone else having this problem? Could you offer advice?
#66
I've tricked taking button_onclick(), and changing the button graphic (from an empty box to a checked box and visa-versa), however it says '.Graphic is read only'.
What do I do? I can't change the button image, so I'm screwed it would appear.
#67
AGS Games in Production / Lost on Cow Island
Thu 22/08/2019 09:32:01
DEMO
v1.3 added end-game state and speech-skipping on mouse click

'Lost on Cow Island' is a comedy adventure game about being on a desert island after a time-travelling accident strands you there.

You play as a nervous art-student named Julius, with drunk but reliable friend Dr Braun (pronounced Brown) diligently fixing the broken time-machine. Julius must find car parts throughout the island, and get them back to their own time...



[imgzoom]https://bluekeystudios.com/img/preview/prev1.png[/imgzoom]
[imgzoom]https://bluekeystudios.com/img/preview/prev2.png[/imgzoom]
[imgzoom]https://bluekeystudios.com/img/preview/prev3.png[/imgzoom]
[imgzoom]https://bluekeystudios.com/img/preview/prev4.png[/imgzoom]
[imgzoom]https://bluekeystudios.com/img/preview/prev6.png[/imgzoom]
[imgzoom]https://bluekeystudios.com/img/preview/prev7.png[/imgzoom]

Features:

-1366x768 (16:9) resolution of 50+ painterly backgrounds
-3,600+ lines of dialogue
-Full English voice acting directed by Ben Rich through irregular emails
-Original soundtrack by composer VanillaPear Sound comprising 18+ songs

The Team:

Ben Rich - Development, Writing, Puzzles, Coding, Project Management
MichaЂ Bukowy - Art, Animation (secondary characters)
Rocky Wahyudi - Animation (Julius and Dr Braun)
VanillaPear Sound - Music, SFX, VO Leveling
and a tonne of voice actors from around the world! (but mostly America)

Story/Puzzles - 100%
Scripting - 100%
Animation - 100%
SFX/Music - 99%
Voice Samples - 90%

Notes:

Developed by Blue Key Studios.
Release due in mid-2022, or publisher schedule.
#68
I have this:



It displays the current Description of a hotspot, object etc. at the top of the screen.
Then I learned about this:




Which allows custom borders for everything inside of it.
However - How do I make the 1st one the 2nd?

There is no option for adding a text label in the text window gui.
#69
I've added this piece of code - it's supposed to transfer inventory items from cDummy to player (cJulius):

Code: ags

  //lose playerstartswith items from inventory - now it's totally empty
  cJulius.LoseInventory(iKnife);
  cJulius.LoseInventory(iRope);
  cJulius.LoseInventory(iNotepad);
  
  cDummy.AddInventory(iCarCoolant); //4
  cDummy.AddInventory(iCarPetrol);  //5
  cDummy.AddInventory(iFacePlate);  //6
  cDummy.AddInventory(iFuzzyDice);  //8
 
  cJulius.AddInventory(iFurstPrize);    //68

  //get all other inventory items
  for (int i = 1; i <= 10; i++) {
    player.InventoryQuantity[i] = cDummy.InventoryQuantity[i];

    //the below 2 lines report that items 4, 5, 6, and 8 are '1' for both
    Display("dummy %d inventory %d",i, cDummy.InventoryQuantity[i]);
    Display("julius %d inventory %d",i, player.InventoryQuantity[i]);

    //set dummy inventory quantity to 0 - delete this item from the inventory
    cDummy.InventoryQuantity[i] = 0;
  }


Then I have a look at the inventory - only iFurstPrize (68) is in there, not items 4, 5, 6, and 8.
Same thing happens if I put 'cJulius' instead of 'player'.

What's going on?

This is a modified version of the code used in the game, given to me by CrimsonWizard a while ago, to transfer items between 2 inventories.
#70
Increase the size of individual frames in a view. Resolutions are much bigger; frames are still 20px wide. Perhaps a slider for size?
It's possible to work with at the moment, though I have to scan through frames on preview->animate to see them properly, takes a bit of extra time.
#71
Is there a way to amplify sound that's already there?
If I have a slider, can I set it to 200 and have the volume in/decrease from 100%?
Or is 100% the max, no amplification?
#72
The game will not respond to middle click in the inventory.
General Settings -> Inventory -> Override built-in inventory window click handling is set to False.
(though if I write it as True, nothing happens on_mouse_click(), so I'll stay away from that)

Basically, I want to have:
MouseWheelNorth - go up in inventory (works)
MouseWheelSouth - go down in inventory (works)
LeftClick - work's opposite way, it Uses
RightClick - work's opposite way, it LooksAt
MiddleClick - I want deselect the currently selected item (not totally sure how to do this either). It Uses whatever invitem it's over. Display code is ignored completely.

When I make General Settings -> Inventory -> Override built-in inventory window click handling set to True, it does nothing at all with any mouse click.

Code: ags

function on_mouse_click(MouseButton button)
{

// Game paused?

  if (IsGamePaused() == 1) {                                            // do nothing if paused
  } else

  if (gInventory.Visible) {                                             // if inventory is visible...
    
    
    
    //move up and down throught inventory with mouse wheel:
    if (button == eMouseWheelNorth) {
      invCustomInv.ScrollUp();
    }
    
    if (button == eMouseWheelSouth) {
      invCustomInv.ScrollDown();
    }
  
    //left click look, right click use
    if (button == eMouseLeft) {
      mouse.Mode=eModeLookat;
    }
    
    if (button == eMouseRight) {
      mouse.Mode=eModeInteract;
    }
    
    if (mouse.IsButtonDown(eMouseMiddle) || button==eMouseMiddle) {
      Display("thasth");           //NEVER DISPLAYS
    }
#73
I have a top-bar menu which is invisible most of the time, but comes into view when you move the mouse cursor over the general area.
How can I get it to *not* display (or display greyed out?) when I'm a) in conversation (dialog) or b) during a process that is blocking ?
#74
Hi, been having a strange intermittent problem.

I'm using AGS 3.4.1.15 NMP.

This sprite error has happened twice, with the same sprite number, 6436. The sprite is nowhere near the View frames for Julius (main character, walking along to left), or the Farmer Cow (secondary character, running to left special animation) sprites. It has happened during the Farmer's running animation to the right in room x, and Julius walking in room y. They're both part of the same scene, but the rooms are 3 and 47, unrelated and made a long time apart, so god knows.
It's happened once while talking to the farmer (in room 47), which culminated in him running away right (then 2 seconds, sprite error); once with Julius walking towards the Farmer (room 3) - 2,3 seconds, sprite runtime error.

The sprite is close to 6435 and 6437, which occurs in the section I was importing/redoing after the sprite cache was corrupted (when I changed it from compressed to uncompressed; errors and some sprites replaced with blue teacup; turned it back, re-imported sprite, all good apparently). My thought is that somehow, the sprite number was corrupted, redone, but something of the corruption remained in the sprite library for some time. Not sure. Not sure how to fix or read an error log :/

Truly, truly hoping I don't have to manually re-import all sprites, all views, and spend the next 6mo redoing this one part of the game. it has 6-8000 sprites. I mean, originally I just went to general settings, sprite library, compressed->un-compressed->save->f'd up->compressed (after realizing the sprte library was now too large)->re-import. If this causes an immediate and lingering error, whys it even allowed?

Hoping for some good advice. Also, *it may not be* the sprite library (the sprites this probabaly effected, 6435-6437, are not part of a view which is used yet anywhere in the game), but I don't know.

Lost and frustrated :/

pics:
[imgzoom]https://redrom.ltd/img/room3.png[/imgzoom]

[imgzoom]https://redrom.ltd/img/room48.png[/imgzoom]
#75
mouse.x and mouse.y are integers (I assume)
oEPS.X and oEPS.Y (X and Y of bottom left corner of an Object) are integers (I assume)
EPS_Width and EPS_Height are floats.

Error I get is: [line 9] Type mismatch: cannot convert 'float' to 'int'
What is wrong (apart from hundreds float<->int conversions) with this code?

This is a basic programming question... but it's also driving me insane, so I had to ask.

PS. what I'm trying to do is say: 'if the mouse is in the area of an object's dimensions, 1 quarter in, please set the ThreeCowEmotions switch to true'.
If anyone has a quicker way of doing this, I'm all ears.

Code: ags

function room_load() {
    EPS_Width = IntToFloat(Game.SpriteWidth[oEPS.Graphic]);
    EPS_Height = IntToFloat(Game.SpriteHeight[oEPS.Graphic]);

...

function room_RepExec() {
    if (EmotionsSwitch) {
      if (mouse.x >= FloatToInt(oEPS.X + (EPS_Width/4))) {
        if (mouse.x =< FloatToInt((oEPS.X + EPS_Width) - (EPS_Width/4))) {
          if (mouse.y >= FloatToInt(oEPS.Y - (EPS_Height/4) ) - (EPS_Width/4)) {
            if (mouse.y =< FloatToInt((oEPS.Y - EPS_Height) - (EPS_Width/4))) {
              Display("cowemotions true at %d, %d", oEPS.X, oEPS.Y);
              ThreeCowEmotions=true;
              EmotionsSwitch=false;
            }
          }
        }
      }
    }
#76
I can't for the life of me find what is slowing this game down; it's trying to do something every 1/40th of a second. Can anyone help?

Code: ags

function room_FirstLoad()
{
  oCandlelight.IgnoreWalkbehinds=true;
}

//----------------------------------------------------------------------------------------------------------------------
// Room Load
//----------------------------------------------------------------------------------------------------------------------

function room_Load()
{
  JULIUS_WALKSPEED_X = 8;
  JULIUS_WALKSPEED_Y = 7;
  cJulius.SetWalkSpeed(JULIUS_WALKSPEED_X, JULIUS_WALKSPEED_Y);

  TOD=0;     //cheat
  


// TOD = 1;
// TimeHoleMade = false;
// TimeHoleMade = true;
	
// TOD = time of day
// 0 day
// 1 early morning
// 2 night

	
  DrawingSurface* surface = Room.GetDrawingSurfaceForBackground();
  switch (TOD)
  {
    case 0:                                                           // day time
      if (TimeHoleMade) {
        oTimeHole.Visible=true;
      } else {
        oTimeHole.Visible=false;
        if (HoleMade) {
          surface.DrawImage(0, 0, 2558, 0);                             // day / hole
        } else {
          surface.DrawImage(0, 0, 2561, 0);                             // day / no hole
        }
      }
      
      //ape awake
      SetTimer(TIMER_APE, GetGameSpeed()*6);
      if (!ApeConvoDone) cApe.SetProperty("convodone",0);
      
      //giraffe asleep
      cGiraffe.LockView(178);
      cGiraffe.Animate(0, 10, eRepeat, eNoBlock);
      cGiraffe.SetProperty("convodone",1);
      
      break;

    case 1:                                                             // morning
      if (TimeHoleMade) {
        oTimeHole.Visible=true;                                        // morning / hole
      } else {
        oTimeHole.Visible=false;
        if (HoleMade) {
          surface.DrawImage(0, 0, 2557, 0);                             // morning / hole
        } else {
          surface.DrawImage(0, 0, 2560, 0);                             // morning / no hole
        }
      }
      
      //giraffe awake
      cGiraffe.SetIdleView(175, 12);
      if (!GiraffeConvoDone) cGiraffe.SetProperty("convodone",0);
      
      //tiger awake
      cTiger.SetIdleView(16, 10);
      if (!TigerConvoDone) cTiger.SetProperty("convodone",0);
      
      //ape asleep
      cApe.LockView(177);
      cApe.Animate(0, 7, eRepeat, eNoBlock);
      cApe.SetProperty("convodone",1);
      
      //tiger asleep
      cTiger.ChangeView(179);
      cTiger.SetProperty("convodone", 1);
      
      break;

    case 2:                                                             // nightime
      if (TimeHoleMade) {
        oTimeHole.Visible=true;
      } else {
        oTimeHole.Visible=false;
        if (HoleMade) {
          surface.DrawImage(0, 0, 2556, 0);                             // night / hole
        } else {
          surface.DrawImage(0, 0, 2559, 0);                             // night / no hole
        }
      }
      
      
      //giraffe awake
      cGiraffe.SetIdleView(175, 12);
      if (!GiraffeConvoDone) cGiraffe.SetProperty("convodone",0);
      
      //ape's asleep
      cApe.LockView(177);
      cApe.Animate(0, 7, eRepeat, eNoBlock);
      cApe.SetProperty("convodone",1);
      
      //tiger asleep
      cTiger.ChangeView(179);
      cTiger.SetProperty("convodone", 1);
      
      break;
	}	
  surface.Release();
  
}


//----------------------------------------------------------------------------------------------------------------------
// Room Repeat Exec
//----------------------------------------------------------------------------------------------------------------------

function room_RepExec()
{
  if (CandleLit) {
    oCandlelight.X = mouse.x+OFFSET_X;
    oCandlelight.Y = mouse.y+OFFSET_Y;
  }
  oCandlelight.Visible = CandleLit;
  
  if (!cApe.Animating && IsTimerExpired(TIMER_APE) && TOD!=0) {
    if (AngryApe) {
      cApe.LockView(174);
      cApe.Animate(0, 3, eOnce, eNoBlock, eForwards);
    } else {
      cApe.LockView(173);
      cApe.Animate(0, 5, eOnce, eNoBlock, eForwards);
    }
    SetTimer(TIMER_APE, GetGameSpeed()*16);
  }
  
  if (!cTiger.Animating && IsTimerExpired(TIMER_TIGER) && TOD!=1) {
    cTiger.LockView(179);
    switch (Random(1)) {
      case 0:
        cTiger.Animate(0, 6, eOnce, eNoBlock); break;
      case 1:
        cTiger.Animate(1, 14, eOnce, eNoBlock); break;
    }
  }
}


Here is a video:
https://redrom.ltd/img/zoovidslow.webm
#77
I'm having a problem (or design fault :P) with walk behinds.

I want to:
1. take a picture of the background+characters
2. activate (ie. reset base) the walk behinds
3. draw the picture of the background and affected character back to screen, so the character is not half wiped out by the walkbehind.

Is there a simple way of doing this?

1. http://redrom.ltd/img/image002.png - background and ape character as they are
2. http://redrom.ltd/img/image001.png - ape wiped out by walkbehind activating for main character Julius

I just want to take a localised screen shot of (1), and draw it back when (2) happens.

There are two separate walk-behinds - one for the wall, one for the bars. I want bars to always be active; the wall 'hole' should only be active when Julius is walking towards it and about to climb through it.
#78
I'm having trouble with an animated object I wish my character to 'step over' (he's lying on the ground) to reach a Walk location, pick up an item, and then step over him again.
Except I can't make the object passable. I've tried Solid=false, BlockHeight/Width=0, etc. nothing works.
What am I doing wrong?
#79
At the moment I'm making a levitating robot.
When standing still, there's one frames (like all sprites).
When he moves, he first takes 2 frames to get up to speed, then the remaining frames can be repeated until he stops.
So in other words: 1 standing -> 2, 3 speed up -> 4,5,6,4,5,6,4,5,6,4,5,6 'walking' -> 1 stop  (or even: 3, 2 slow down -> 1 stop).

Is there any way to actually do this? Multiple views? A plugin for this purpose?
#80
Basically I have a system where:
-the mouse has a walk to/look at/interact with/talk to cursors
-you change cursor using the mouse wheel or tapping the left mouse button

When you, ie. have the lookat icon, whatever object or character the mouse is over, the mouse cursor will change to activated ("eyes open" for lookat)
When it's not, it's "eyes closed".

But when you click on an area where there is just blank space (walkable area != 0), then I want it to walk there.

So...
Code: ags

......
    else if (mouse.Mode == eModeLookat)                              // LOOKAT
    {
      newGraphic = 105;                                         // eye close
      Hotspot* hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
      Object* ob = Object.GetAtScreenXY(mouse.x, mouse.y);
      Character* ch = Character.GetAtScreenXY(mouse.x, mouse.y);
      InventoryItem* inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

      if (gInventory.Visible == true && inve != null)
      {
        if (inve.IsInteractionAvailable(eModeLookat))
        {
          newGraphic = 2056;                                    // eye open
        }
      } else {
        if (lt == eLocationHotspot)
        {
          if (hs != hotspot[0])
          {
            if (hs.GetProperty("hidden") == false)
            {
              if(hs.IsInteractionAvailable(eModeLookat))
              {
                newGraphic = 2056;                              // eye open
              }
            }
          }
        }
        else if (lt == eLocationCharacter)
        {
          if (ch != null)
          {
            if (ch.IsInteractionAvailable(eModeLookat))
            {
              newGraphic = 2056;                                 // eye open
            }
          }
        }
        else if (lt == eLocationObject && ob.IsInteractionAvailable(eModeLookat) && ob.Visible == true)
        {
          newGraphic = 2056;                                    // eye open
        }
        
        else if (GetWalkableAreaAt(mouse.x, mouse.y)!=0) {          //NONE OF THIS WORKS
          if (mouse.Click(eMouseLeft)) {    //walking          //NONE OF THIS WORKS
            ProcessClick(mouse.x, mouse.y, eModeWalkto);          //NONE OF THIS WORKS
          }
        }
        
      }
    }
    else if (mouse.Mode==eModeInteract)                              // INTERACTION
.....


Basically I want to say, "when the player clicks left mouse button in a space that's a walkable area only and is not a null walkable area (walkable area 0), I want them to walk there, regardless of what type of icon it is".
If someone has the eModeLookAt, and they're on an object - look at the object.
Otherwise, walk there.
Simple, but not simple.

What am I doing wrong?
SMF spam blocked by CleanTalk