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

#401
That was exactly what I was doing.

Finished code (with no floats, got confused):


Code: ags

    if (EmotionsSwitch) {
      if ( (mouse.x >= (oEPS.X + (EPS_Width/4))) && mouse.x <= ((oEPS.X + EPS_Width) - (EPS_Width/4)) ) {
        if ( (mouse.y >= ((oEPS.Y - EPS_Height) + (EPS_Height/4))) && (mouse.y <= (oEPS.Y - (EPS_Height/4))) ) {
            Display("cowemotions true at %d, %d", mouse.x, mouse.y);
            ThreeCowEmotions=true;
            EmotionSwitch=false;
        }
      }
    }

#402
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;
            }
          }
        }
      }
    }
#403
Would you say the time to fix remaining problems is closer to one month or six months?
#404
So is, uh, beta 6 coming along nicely? Are there many betas left?
I ask this only to check if the full version will be out by September 2019 or, like, February next year. All is good, whenever it's done it's done, I was just wondering as I'm thinking of releasing my game soon.
#405
Do I have to run it from 'Build...' every time and choose OpenGL every time? Or does it just default to my first choices when running the game using F5 (debug)?
#406
Obviously I change winsetup.exe but... in the debug area?? When it compiles it defaults to OpenGL, so.....??
#407
Cool okay - It's just running slow when I press F5 and run debug, do I have to compile it for the OpenGL to work or do I have to edit something in my code?
#408
Firstly, if not IgnoreWalkBehinds(), how can I get the candlelight (a large round translucent bit of yellow light that follows the mouse) to show up on all surfaces? By allowing walkbehinds, I can a) see them with the candlelight, as it goes 'behind' them, and b) can't you know, get rid of them.
Is there any graphics engine it work with? Why have the function at all? Hasn't caused any problems so far, and this command is in every room.

Would using a GUI get past all of this, instead of the oCandlelight object?

Also: it's the cages slowing everything down. 1 slows down things a bit, and can't be detected; 2 slows down things noticeably; 3 slows down things to a crawl. They're objects. Is there any way to make them faster, if not to have them in the background itself? If the do have to be in the background then a) doing a 'climbing through a hole in the wall' animation (the hole appears as part of the story) is very, very complicated; and b) they... look like shit. I can't use walk-behinds on the bars, hence I used objects to easily simulate things the animals are behind.

Any solutions to the above problems?
#409
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
#410
No this was to cover the edge of the hole, so Julius can 'climb' into it.
http://redrom.ltd/img/image3.png
#411
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.
#412
Hi, just a question you probably answered 1500 posts ago -- is there coming back from this version?
What I mean is: If a have a project done in 3.4.3, and I update to 3.5beta, will my actual project file no longer be able to be edited with 3.4.3 or anything lower? I understand the game savegames are non-compatible, but is the game.agf etc. file?
#413
Solved - it was an invisible character with a wide base blocking the path :)
I will remember Ctrl-A - anywhere I can find some more cheats?
#414
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?
#415
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?
#416
Yes, but how to walk on mouse click?
I don't know how to get it to process a click or check for left mouse button, and I don't know how to make it go there when I click (as opposed to constantly following the mouse cursor and walking all the time).
#417
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?
#418
As I thought - I've created a custom property.
Thanks :)
#419
That didn't work (deleted AudioCache file, reimported) BUT changing the file's name in the editor did. Hopefully some illumination as to what's causing the bug.
#420
Understood, changed while to if.

Code: ags
while (o.Valid) Wait(1);

Still won't work because this is SayBackground(), but blocking. The game will get stuck here and not update timers, not alter the transparency of the black screen, etc.
Unless, once again I've missed something. Put the timer/screen blackening in the "while (o.Valid)" loop?
SMF spam blocked by CleanTalk